24 1.SAMPLING AND RECONSTRUCTION H(fc)1=10-9.7/20= 3 1H(fD)l=10-17.6/20= 1 7.5 H月1-10-克 Hl=10-a30=22 1 Therefore,the resulting signal after reconstruction would be: .0=2(a+引)os10m)+2(B+)cos(30m) (1.4.9) 2F ,5cos(20πt)+)92C0s(35πt) Now the C and D terms are not as small and aliasing would still be significant.The situation can be remedied by oversampling,as discussed in the next example 口 Example 1.4.8:Oversampling can be used to reduce the attenuation requirements of the pre- filter,and thus its order.Oversampling increases the gap between spectral replicas reduc- ing aliasing and allowing less sharp cutoffs for the prefilter. For the previous example,if we oversample by a factor of 2,fs 2 x 40 80 kHz,the new Nyquist interval will be [-40,40]kHz.Only the fe =45 kHz and fr =62.5 kHz components lie outside this interval,and they will be aliased with fE.a =fE-fs =45-80 =-35 kHz fF.a=fF-f=62.5-80=-17.5kHz Only fr.lies in the audio band and will cause distortions,unless we attenuate fr using a prefilter before it gets wrapped into the audio band.Without a prefilter,the reconstructed signal will be: ya(t)=2Acos(10πt)+2Bcos(30πt) +2Ccos(50πt)+2Dcos(60πt) +2Ecos(-2π35t)+2Fcos(-2π17.5t) =2Acos(10πt)+2Bcos(30πt) +2C cos(50mt)+2D cos(60mrt)+2E cos(70mrt)+2F cos(35mrt) The audible components in ya(t)are: y1(t)=2Acos(10πt)+2Bcos(30πt)+2Fcos(35πt) Thus,oversampling eliminated almost all the aliasing from the desired audio band.Note that two types of aliasing took place here,namely,the aliasing of the E component which
24 1. SAMPLING AND RECONSTRUCTION |H(fC)| = 10−9.7/20 = 1 3 |H(fD)| = 10−17.6/20 = 1 7.5 |H(fE)| = 10−35.1/20 = 1 57 |H(fF)| = 10−49.3/20 = 1 292 Therefore, the resulting signal after reconstruction would be: ya(t) = 2 A + E 57 cos(10πt)+2 B + C 3 cos(30πt) + 2D 7.5 cos(20πt)+ 2F 292 cos(35πt) (1.4.9) Now the C and D terms are not as small and aliasing would still be significant. The situation can be remedied by oversampling, as discussed in the next example. Example 1.4.8: Oversampling can be used to reduce the attenuation requirements of the pre- filter, and thus its order. Oversampling increases the gap between spectral replicas reducing aliasing and allowing less sharp cutoffs for the prefilter. For the previous example, if we oversample by a factor of 2, fs = 2 × 40 = 80 kHz, the new Nyquist interval will be [−40, 40] kHz. Only the fE = 45 kHz and fF = 62.5 kHz components lie outside this interval, and they will be aliased with fE,a = fE − fs = 45 − 80 = −35 kHz fF,a = fF − fs = 62.5 − 80 = −17.5 kHz Only fF,a lies in the audio band and will cause distortions, unless we attenuate fF using a prefilter before it gets wrapped into the audio band. Without a prefilter, the reconstructed signal will be: ya(t) = 2A cos(10πt)+2Bcos(30πt) + 2C cos(50πt)+2D cos(60πt) + 2E cos(−2π35t)+2F cos(−2π17.5t) = 2A cos(10πt)+2Bcos(30πt) + 2C cos(50πt)+2D cos(60πt)+2E cos(70πt)+2F cos(35πt) The audible components in ya(t) are: y1(t)= 2A cos(10πt)+2Bcos(30πt)+2F cos(35πt) Thus, oversampling eliminated almost all the aliasing from the desired audio band. Note that two types of aliasing took place here, namely, the aliasing of the E component which
1.4.SAMPLING OF SINUSOIDS 25 remained outside the relevant audio band,and the aliasing of the F component which does represent distortion in the audio band. Of course,one would not want to feed the signal ya(t)into an amplifier/speaker system because the high frequencies beyond the audio band might damage the system or cause nonlinearities.(But even if they were filtered out,the F component would still be there.) Example 1.4.9:Oversampling and Decimation.Example 1.4.8 assumed that sampling at 80 kHz could be maintained throughout the digital processing stages up to reconstruction.There are applications however,where the sampling rate must eventually be dropped down to its original value.This is the case,for example,in digital audio,where the rate must be reduced eventually to the standardized value of 44.1 kHz (for CDs)or 48 kHz (for DATs). When the sampling rate is dropped,one must make sure that aliasing will not be reintro- duced.In our example,if the rate is reduced back to 40 kHz,the C and D components, which were inside the [-40,40]kHz Nyquist interval with respect to the 80 kHz rate, would find themselves outside the [-20,20]kHz Nyquist interval with respect to the 40 kHz rate,and therefore would be aliased inside that interval,as in Example 1.4.7. To prevent C and D,as well as E,from getting aliased into the audio band,one must remove them by a lowpass digital filter before the sampling rate is dropped to 40 kHz. Such a filter is called a digital decimation filter.The overall system is shown below. 80 80 40 x() ) kHz kHz kHz () prefilter 80 kHz digital down- recon- H() sampler filter sampler structor analog analog The downsampler in this diagram reduces the sampling rate from 80 down to 40 kHz by throwing away every other sample,thus,keeping only half the samples.This is equivalent to sampling at a 40 kHz rate. The input to the digital filter is the sampled spectrum of y(t),which is replicated at mul- tiples of 80 kHz as shown below. digital lowpass filter prefilter B 0102030405060708090100 120 140 160 kHz We have also assumed that the 30 dB/octave prefilter is present.The output of the digital filter will have spectrum as shown below
1.4. SAMPLING OF SINUSOIDS 25 remained outside the relevant audio band, and the aliasing of the F component which does represent distortion in the audio band. Of course, one would not want to feed the signal ya(t) into an amplifier/speaker system because the high frequencies beyond the audio band might damage the system or cause nonlinearities. (But even if they were filtered out, the F component would still be there.) Example 1.4.9: Oversampling and Decimation. Example 1.4.8 assumed that sampling at 80 kHz could be maintained throughout the digital processing stages up to reconstruction. There are applications however, where the sampling rate must eventually be dropped down to its original value. This is the case, for example, in digital audio, where the rate must be reduced eventually to the standardized value of 44.1 kHz (for CDs) or 48 kHz (for DATs). When the sampling rate is dropped, one must make sure that aliasing will not be reintroduced. In our example, if the rate is reduced back to 40 kHz, the C and D components, which were inside the [−40, 40] kHz Nyquist interval with respect to the 80 kHz rate, would find themselves outside the [−20, 20] kHz Nyquist interval with respect to the 40 kHz rate, and therefore would be aliased inside that interval, as in Example 1.4.7. To prevent C and D, as well as E, from getting aliased into the audio band, one must remove them by a lowpass digital filter before the sampling rate is dropped to 40 kHz. Such a filter is called a digital decimation filter. The overall system is shown below. prefilter H(f) 80 kHz sampler 80 kHz 80 kHz 40 kHz digital filter downsampler reconstructor x(t) y(t) ya(t) analog analog The downsampler in this diagram reduces the sampling rate from 80 down to 40 kHz by throwing away every other sample, thus, keeping only half the samples. This is equivalent to sampling at a 40 kHz rate. The input to the digital filter is the sampled spectrum of y(t), which is replicated at multiples of 80 kHz as shown below. 10 40 60 80 100 120 140 160 kHz 20 30 50 70 90 digital lowpass filter prefilter A A C C C C A A F E E E E F F F B B B B D D D D f 0 We have also assumed that the 30 dB/octave prefilter is present. The output of the digital filter will have spectrum as shown below
26 1.SAMPLING AND RECONSTRUCTION digital lowpass filter A B B A B B (-49dB) CDE EDC NARA ARA 0102030405060708090100 120 140 160 kHz The digital filter operates at the oversampled rate of 80 kHz and acts as a lowpass filter within the [-40,40]kHz Nyquist interval,with a cutoff of 20 kHz.Thus,it will remove the C,D,and E components,as well as any other component that lies between 20 s Ifl s 60 kHz. However,because the digital filter is periodic in f with period fs=80 kHz,it cannot remove any components from the interval 60 s f s 100.Any components of the analog input y(t) that lie in that interval would be aliased into the interval 60-80 sf-fs s 100-80,which is the desired audio band-20sf-fs s20.This is what happened to the F component, as can be seen in the above figure. The frequency components of y(t)in 60 s Ifl s 100 can be removed only by a pre- filter,prior to sampling and replicating the spectrum.For example,our low-complexity 30 dB/octave prefilter would provide 47.6 dB attenuation at 60 kHz.Indeed,the number of octaves from 20 to 60 kHz is log2(60/20)=1.585 and the attenuation there will be 30 dB/octave x 1.584 octaves 47.6 dB. The prefilter,being monotonic beyond 60 kHz,would suppress all potential aliased compo- nents beyond 60 kHz by more than 47.6 dB.At 100kHz,it would provide 30xlog2(100/20)= 69.7 dB attenuation.At fe 62.5 kHz,it provides 49.3 dB suppression,as was calculated in Example 1.4.7,that is,H (fr)=10-49.3/20 =1/292. Therefore,assuming that the digital filter has already removed the C,D,and E compo- nents,and that the aliased F component has been sufficiently attenuated by the prefilter, we can now drop the sampling rate down to 40 kHz. At the reduced 40 kHz rate,if we use an ideal reconstructor,it would extract only the components within the [-20,20]kHz band and the resulting reconstructed output will be: ya(t)=2Acos(10πt)+2Bcos(30πt) 2 292c0s(35mt) which has a much attenuated aliased component F.This is to be compared with Eq.(1.4.9), which used the same prefilter but no oversampling.Oversampling in conjunction with digital decimation helped eliminate the most severe aliased components,C and D. In summary,with oversampling,the complexity of the analog prefilter can be reduced and traded off for the complexity of a digital filter which is much easier to design and cheaper to implement with programmable DSPs.As we will see in Chapter 2,another benefit of oversampling is to reduce the number of bits representing each quantized sample.The connection between sampling rate and the savings in bits is discussed in Section 2.2.The subject of oversampling,decimation,interpolation,and the design and implementation of digital decimation and interpolation filters will be discussed in detail in Chapter 12
26 1. SAMPLING AND RECONSTRUCTION 10 40 60 80 100 120 140 160 kHz 20 30 50 70 90 digital lowpass filter A A A A F F F F B B B B C C DD C C E E D D E E f 0 (-49 dB) The digital filter operates at the oversampled rate of 80 kHz and acts as a lowpass filter within the [−40, 40] kHz Nyquist interval, with a cutoff of 20 kHz. Thus, it will remove the C, D, and E components, as well as any other component that lies between 20 ≤ |f | ≤ 60 kHz. However, because the digital filter is periodic in f with period fs = 80 kHz, it cannot remove any components from the interval 60 ≤ f ≤ 100. Any components of the analog input y(t) that lie in that interval would be aliased into the interval 60−80 ≤ f −fs ≤ 100−80, which is the desired audio band −20 ≤ f − fs ≤ 20. This is what happened to the F component, as can be seen in the above figure. The frequency components of y(t) in 60 ≤ |f | ≤ 100 can be removed only by a pre- filter, prior to sampling and replicating the spectrum. For example, our low-complexity 30 dB/octave prefilter would provide 47.6 dB attenuation at 60 kHz. Indeed, the number of octaves from 20 to 60 kHz is log2(60/20)= 1.585 and the attenuation there will be 30 dB/octave × 1.584 octaves = 47.6 dB. The prefilter, being monotonic beyond 60 kHz, would suppress all potential aliased components beyond 60 kHz by more than 47.6 dB. At 100 kHz, it would provide 30×log2(100/20)= 69.7 dB attenuation. At fF = 62.5 kHz, it provides 49.3 dB suppression, as was calculated in Example 1.4.7, that is, |H(fF)| = 10−49.3/20 = 1/292. Therefore, assuming that the digital filter has already removed the C, D, and E components, and that the aliased F component has been sufficiently attenuated by the prefilter, we can now drop the sampling rate down to 40 kHz. At the reduced 40 kHz rate, if we use an ideal reconstructor, it would extract only the components within the [−20, 20] kHz band and the resulting reconstructed output will be: ya(t)= 2A cos(10πt)+2Bcos(30πt)+ 2F 292 cos(35πt) which has a much attenuated aliased component F. This is to be compared with Eq. (1.4.9), which used the same prefilter but no oversampling. Oversampling in conjunction with digital decimation helped eliminate the most severe aliased components, C and D. In summary, with oversampling, the complexity of the analog prefilter can be reduced and traded off for the complexity of a digital filter which is much easier to design and cheaper to implement with programmable DSPs. As we will see in Chapter 2, another benefit of oversampling is to reduce the number of bits representing each quantized sample. The connection between sampling rate and the savings in bits is discussed in Section 2.2. The subject of oversampling, decimation, interpolation, and the design and implementation of digital decimation and interpolation filters will be discussed in detail in Chapter 12
1.4.SAMPLING OF SINUSOIDS 27 1.4.2 Rotational Motion A more intuitive way to understand the sampling properties of sinusoids is to consider a representation of the complex sinusoidx(t)=e2mift as a wheel rotating with a frequency of f revolutions per second.The wheel is seen in a dark room by means of a strobe light flashing at a rate of fs flashes per second.The rotational frequency in [radians/sec]is =2mf.During the time interval T between flashes,the wheel turns by an angle: 2πf w-2T=2πfT= fs (1.4.10) This quantity is called the digital frequency and is measured in units of [radians/samplel. It represents a convenient normalization of the physical frequency f.In terms of w,the sampled sinusoid reads simply x(nT)=e2nifTn =elwn In units of w,the Nyquist frequency f=fs/2 becomes wo=Tr and the Nyquist interval becomes[-π,π].The replicated set f+mfs becomes 2πf+mfs)_2m+2mm=w+2πm fs fs Because the frequency f =fs corresponds to w=2m,the aliased frequency given in Eq.(1.4.3)becomes in units of w: a=wmod(2π) The quantity f/fs=fT is also called the digital frequency and is measured in units of [cycles/samplel.It represents another convenient normalization of the physical fre- quency axis,with the Nyquist interval corresponding to [-0.5,0.5]. In terms of the rotating wheel,fT represents the number of revolutions turned dur- ing the flashing interval T.If the wheel were actually turning at the higher frequency f+mfs,then during time T it would turn by (f+mfs)T=fT+mfsT=fT+m revo- lutions,that is,it would cover m whole additional revolutions.An observer would miss these extra m revolutions completely.The perceived rotational speed for an observer is always given by fa=f mod(fs).The next two examples illustrate these remarks. Example 1.4.10:Consider two wheels turning clockwise,one at f=1 Hz and the other at f2=5 Hz,as shown below.Both are sampled with a strobe light flashing at fs=4 Hz. Note that the second one is turning at f2=fi+fs. n=0 n=0 /2 n=3◆ n=1 n=3 0=5元/2 n=2 n=2
1.4. SAMPLING OF SINUSOIDS 27 1.4.2 Rotational Motion A more intuitive way to understand the sampling properties of sinusoids is to consider a representation of the complex sinusoid x(t)= e2πjf t as a wheel rotating with a frequency of f revolutions per second. The wheel is seen in a dark room by means of a strobe light flashing at a rate of fs flashes per second. The rotational frequency in [radians/sec] is Ω = 2πf . During the time interval T between flashes, the wheel turns by an angle: ω = ΩT = 2πfT = 2πf fs (1.4.10) This quantity is called the digital frequency and is measured in units of [radians/sample]. It represents a convenient normalization of the physical frequency f . In terms of ω, the sampled sinusoid reads simply x(nT)= e2πjfTn = ejωn In units of ω, the Nyquist frequency f = fs/2 becomes ω = π and the Nyquist interval becomes [−π, π]. The replicated set f + mfs becomes 2π(f + mfs) fs = 2πf fs + 2πm = ω + 2πm Because the frequency f = fs corresponds to ω = 2π, the aliased frequency given in Eq. (1.4.3) becomes in units of ω: ωa = ω mod(2π) The quantity f /fs = fT is also called the digital frequency and is measured in units of [cycles/sample]. It represents another convenient normalization of the physical frequency axis, with the Nyquist interval corresponding to [−0.5, 0.5]. In terms of the rotating wheel, fT represents the number of revolutions turned during the flashing interval T. If the wheel were actually turning at the higher frequency f + mfs, then during time T it would turn by (f + mfs)T = fT + mfsT = fT + m revolutions, that is, it would cover m whole additional revolutions. An observer would miss these extra m revolutions completely. The perceived rotational speed for an observer is always given by fa = f mod(fs). The next two examples illustrate these remarks. Example 1.4.10: Consider two wheels turning clockwise, one at f1 = 1 Hz and the other at f2 = 5 Hz, as shown below. Both are sampled with a strobe light flashing at fs = 4 Hz. Note that the second one is turning at f2 = f1 + fs. n=0 n=0 n=1 n=1 n=2 n=2 n=3 n=3 f=1 f=5 ω=π/2 ω=5π/2 ωa=π/2
28 1.SAMPLING AND RECONSTRUCTION The first wheel covers fT=f1/fs=1/4 of a revolution during T 1/4 second.Its angle of rotation during that time interval is c=2mf1/fs=2T/4=Tr/2 radians.During the sampled motion,an observer would observe the sequence of points n=0,1,2,3,...and would conclude that the wheel is turning at a speed of 1/4 of a revolution in 1/4 second, or, 1/4 cycles 1 Hz 1/4 sec Thus,the observer would perceive the correct speed and sense of rotation.The second wheel,on the other hand,is actually turning by f2T=f2/fs 5/4 revolutions in 1/4 second,with an angle of rotation c2=57/2.Thus,it covers one whole extra revolution compared to the first one.However,the observer would still observe the same sequence of points n=0,1,2,3,...,and would conclude again that the wheel is turning at 1/4 revolution in 1/4 second,or,1 Hz.This result can be obtained quickly using Eq.(1.4.3): f2a f2 mod(fs)=5 mod(4)=5-4 =1 Thus,in this case the perceived speed is wrong,but the sense of rotation is still correct. In the next figure,we see two more wheels,one turning clockwise at f3 9 Hz and the other counterclockwise at f4 =-3 Hz. n=0 9 =0 =-3 0=元/2 =/2 n=3 n=3 00=9π/2 =-3/2 n=2 n=2 The negative sign signifies here the sense of rotation.During T=1/4 sec,the third wheel covers f3T 9/4 revolutions,that is,two whole extra revolutions over the fi wheel.An observer would again see the sequence of points n =0,1,2,3,...,and would conclude that f3 is turning at 1 Hz.Again,we can quickly compute,f3a=f3 mod(fs)=9 mod(4)= 9-2·4=1Hz. The fourth wheel is more interesting.It covers f4T =-3/4 of a revolution in the coun- terclockwise direction.An observer captures the motion every 3/4 of a counterclockwise revolution.Thus,she will see the sequence of points n =0,1,2,3,...,arriving at the conclusion that the wheel is turning at 1 Hz in the clockwise direction.In this case,both the perceived speed and sense of rotation are wrong.Again,the same conclusion can be reached quickly using f4a fa mod(fs)=(-3)mod(4)=-3+4=1 Hz.Here,we added one fs in order to bring f4 within the Nyquist interval [-2,2]. 口 Example 1.4.11:The following figure shows four wheels rotating clockwise at f =1.5,2,2.5,4 Hz and sampled at fs=4 Hz by a strobe light
28 1. SAMPLING AND RECONSTRUCTION The first wheel covers f1T = f1/fs = 1/4 of a revolution during T = 1/4 second. Its angle of rotation during that time interval is ω1 = 2πf1/fs = 2π/4 = π/2 radians. During the sampled motion, an observer would observe the sequence of points n = 0, 1, 2, 3,... and would conclude that the wheel is turning at a speed of 1/4 of a revolution in 1/4 second, or, 1/4 cycles 1/4 sec = 1 Hz Thus, the observer would perceive the correct speed and sense of rotation. The second wheel, on the other hand, is actually turning by f2T = f2/fs = 5/4 revolutions in 1/4 second, with an angle of rotation ω2 = 5π/2. Thus, it covers one whole extra revolution compared to the first one. However, the observer would still observe the same sequence of points n = 0, 1, 2, 3,... , and would conclude again that the wheel is turning at 1/4 revolution in 1/4 second, or, 1 Hz. This result can be obtained quickly using Eq. (1.4.3): f2a = f2 mod(fs)= 5 mod(4)= 5 − 4 = 1 Thus, in this case the perceived speed is wrong, but the sense of rotation is still correct. In the next figure, we see two more wheels, one turning clockwise at f3 = 9 Hz and the other counterclockwise at f4 = −3 Hz. n=0 n=0 n=1 n=1 n=2 n=2 n=3 n=3 f=9 f=−3 ω=9π/2 ω=−3π/ 2 ωa ω =π/2 a= π/2 The negative sign signifies here the sense of rotation. During T = 1/4 sec, the third wheel covers f3T = 9/4 revolutions, that is, two whole extra revolutions over the f1 wheel. An observer would again see the sequence of points n = 0, 1, 2, 3,... , and would conclude that f3 is turning at 1 Hz. Again, we can quickly compute, f3a = f3 mod(fs)= 9 mod(4)= 9 − 2 · 4 = 1 Hz. The fourth wheel is more interesting. It covers f4T = −3/4 of a revolution in the counterclockwise direction. An observer captures the motion every 3/4 of a counterclockwise revolution. Thus, she will see the sequence of points n = 0, 1, 2, 3,... , arriving at the conclusion that the wheel is turning at 1 Hz in the clockwise direction. In this case, both the perceived speed and sense of rotation are wrong. Again, the same conclusion can be reached quickly using f4a = f4 mod(fs)= (−3) mod(4)= −3 + 4 = 1 Hz. Here, we added one fs in order to bring f4 within the Nyquist interval [−2, 2]. Example 1.4.11: The following figure shows four wheels rotating clockwise at f = 1.5, 2, 2.5, 4 Hz and sampled at fs = 4 Hz by a strobe light