Chapter 9 Chapter 9: Multirate Digital Signal Processing... 76 9. Decimation... 76 9. Interpolation... 8 9.. Linear Interpolation... 85 9.. Sampling rate conversion by Non-integer factors... 86 9.. Illustration of Interpolation by a factor /... 88 9. Decimation by... 90 9. Interpolation by... 9 9.5 Summary... 0 Chapter 9: Problem Sheet 9 Chapter 9 75
Chapter 9: Multirate Digital Signal Processing The increasing need in modern digital systems to process data at more than one sampling rate has lead the development of a new sub-area in DSP known as multirate processing. The two primary operations in multirate proceeding are Decimation We can decrease the sampling rate of a given signal : This is sometimes called down sampling. Interpolation We can increase the sampling rate of a given signal : This is sometimes called up sampling. The process of decimation and interpolation are the fundamental operations in multirate signal processing. 9. Decimation A sampling rate decreaser is shown in Figure 9. below. We should confine our attention to a decrease by an integer factor M. e.g. M = M y[m] y[m] /M 0 5 6 7 8 9 n 0 m Figure 9.: A discrete-time signal,, is down-sampled by a factor of M=, yielding another discrete-time signal, y[n]. Chapter 9 76
Example: = {,,,, 5, -6, -8,, -, } Down sample by y[m] = {,,5,-8,-} The output signal y[n] is obtained by taking every M th sample of the input signal. If M =, we should just take every third sample of to form the desired signal y[m]. Obviously, it only makes sense to reduce the sampling rate if the information content of the signal we wish to preserve is band f limited to s ; half the desired sampling rate since the spectral 6 components above this frequency will be aliased into f frequencies below s according to the sampling rule. 6 Figure 9. shows a block representation of a times M decimator. We see that the signal is first passed through a low pass filter that attenuates the band from fs fs f to s M M to prevent aliasing Digital lowpass filter w[n] M y[m] /M / /M Figure 9.: Prior to down-sampling, a discrete-time signal must first go through a low-pass filter to remove its high-frequency components. This prevents aliasing. Chapter 9 77
- w / 0 w[n] 6 8 0 n n y[m] M= x 0 Figure 9.: Spectral description of the decimation process 5 m / The spectral description of the decimation process is shown in Figure 9.. Chapter 9 78
W Y = 6kH h[n] 6 kh kh Sampling frequency Image Input spectrum 0 5 6 fkh H cut-off frequency = /M π Digital low pass filter / 0 5 6 fkh W Filtered spectrum 0 5 6 fkh T = T = x = x Y x x 0 5 6 fkh 6 kh M M Figure 9.: Spectral interpretation of decimation of a signal: from 6kH to kh Chapter 9 79
Note: Such a processing requirement may arise, for example when a speech signal is over sampled at = kh. Since we are interested only in a band of 0- kh, sampling rate can be reduced to 8 kh, so the first step in the decimation process has to be the digital filtering of the signal is band limited to 8. Should we use IIR recursive or FIR non-recursive for the low pass filtering required? Using an IIR filter in this case has an obvious shortcoming. We cannot take advantage of the fact that we only have to compute every N th output, since previous outputs are required to compute the M th output. Thus no saving realied. On the other hand, using an FIR filter, in this case implies that we can do our computations at the rate M. Thus, using an FIR filter in the decimation process will lead to a significantly lower computation rate. Another advantage of using an FIR filter is the fact that we can easily design linear phase filters and this is desirable in many applications. Chapter 9 80
9. Interpolation The process of interpolation involves a sampling rate increase see Figure 9.5 L y[m] Y L Figure 9.5: A general block diagram representation of up-sampling process. Example: ={,,,,-5,6,-7,,,} y[m]={,0,,0,,0,,0,-5,0,6,0,-7,0,,0,,0,,0} The sequence was derived by sampling xt at a sampling rate of and we want to obtain a sequence y[m] that approximates as closely as possible the sequence that would have been obtained had we sampled xt at the rate L. This involves inserting between any two samples and x[n-] an additional L- samples. Chapter 9 8
- 0 5 6 8 f - / 0 / Y x L= -/ 0 / x Figure 9.6: Spectral description of the interpolation process. Sampling frequency of yn =. Signal must be band limited to We observe from Figure 9.6 that to go from to Y, we have to pass through a lowpass digital filter designated at the L sampling rate that attenuates sufficiently any frequency components above. Chapter 9 8
Sampling rate anti imaging increase W filter Y w[m] y[m] L insert L- eros L Digital low-pass filter h[m] L The LPF joins all the samples of w[m] to produce a waveform as if had been sampled at L. 0 n w[m] 5 6 0 y[m] 5 6 0 m m L = we assume that there are N- ero samples when computing an output w[n]. Figure 9.7: A general description of the interpolation process. A discrete-time signal is up-sampled by inserting eros and then filtered by a low-pass filter. Note that for each sample of, three output samples y[m] are obtained. The frequency domain interpretation of the process is given in Figure 9.8 below. Chapter 9 8
/ W y 6 5 6 7 images f kh T = T/ = y = y y =/ H y 5 6 7 y f kh y y 0 6 cut-off freq = /L = / f s fs y f kh y 5 6 Figure 9.8: Spectral interpretation of interpolation of a signal from kh to 6 kh. Chapter 9 8
Note: Obviously the same reasoning that led us to believe that FIR filters are preferable in the decimation holds here also. Example: Down sampling, ={, 6,,, 6, 8,,,, } M= h[n] M= y[m] gain=, c =/ p[n] h[0]=/, h[]=/ h[n]= {/, /} x p y n* hn,,5,,,7,6,,,, n,5,,,7,6,,,, n,,7,, Due to filter delay 9.. Linear Interpolation filter p[m] y[m] Gain =, c = / = {,,5,,7} p[n] = {,0,,0,5,0,,0,7,0} insert eros hn,, p[n] * h[n] = {0.5,,,,,5,,,5,7,.5} y[n] = {,,,,5,,,5,7,.5} Due to filter delay Chapter 9 85
9.. Sampling rate conversion by Non-integer factors In some applications, the need often arises to change the sampling rate by a non-integer factor. An example is in digital audio applications where it may be necessary to transfer data from one storage system to another, where both systems employ different rates. An example is transferring data from the compact disk system at a rate of. kh to a digital audio Tape DAT at 8 kh. This can be achieved by increasing the data rate of the CD by a factor 8 of, a non-integer.. In practice, such a non-integer factor is represented by a rational number that is a ratio of two integers, say L and M. The sampling frequency change is then achieved by first interpolating the data by L and then decimating by M. Note: It is necessary that the interpolation process precede decimation otherwise the decimation process would remove some of the desired frequency components. CD DAT. kh 8 kh 8 000 = 7 5 00 = 5 7 To change the sampling rate we require: L M 7 5 5 7 60 7 Therefore if we up-sample by L = 60 and then down-sample by M = 7, we achieve the desired sampling rate conversion. Chapter 9 86
Figure 9.9 shows that the sampling frequency change is achieved by first interpolating the data by L and then decimating by M. Interpolator Decimator L w[m] L LPF h [m] p[m] L LPF h [m] q[m] L M y[k] L M f s Figure 9.9: A discrete-time signal is interpolated and then decimated in order to achieve a non-integer conversion oampling rate. The two LPFs, m h m h & can be combined into a single filter since they are in cascade and have a common sampling frequency. If M > L, the resulting operation is a decimation process by a non-integer. If M < L, it is interpolation L w[m] L h[k] LPF q[m] L M y[k] Figure 9.0: A block diagram representation oampling rate conversion with combined low-pass filter. L M f s The lowpass filter that we require is the one that has a cut-off frequency, min c, L M Chapter 9 87
9.. Illustration of Interpolation by a factor / n w[m] 5 6 L= m q[m] filtered output m y[k] M= k The sample rate is first increased by, by inserting two erovalue samples for each sample of and low-pass filtered to yield q[m]. The filtered data is then reduced by a factor of by retaining only one sample for every two samples of q[m]. The Figure below illustrates the process of interpolation by / in the frequency domain. The input signal at a rate of kh is first increased by a factor of to 6 kh, filtered to remove the image frequencies which would otherwise cause aliasing, and then reduced by a factor of to kh. Chapter 9 88
Frequency domain process of interpolation by / / Images L M = kh 6 5 6 7 f kh W y L= kh = 6kH Q y / y filtered signal, = 6kH y Y x / M= = kh 0 / x 5 6 7 f kh Chapter 9 89
Chapter 9 90 9. Decimation by Y e e e e Y Y j j j j Stretch by a factor to obtain / Note: The spectrum is stretched by down sampling. y[n]= Aliasing term Aliasing term - - Case / / - {/}- Extreme Aliasing
9. Interpolation by y[m] Y j ; Y e - - 0 Y The upsampled spectrum has compressed images of - - / Note: The spectrum is compressed by upsampling. Example: An input signal with the spectrum is applied to the system shown below. Sketch, one above another,, V, W, Y against. - Chapter 9 9
V H -/5 /5 W 5 Y - - V -/ / H -/5 /5 W -/ -/5 /5 Y / 5 - /5 Chapter 9 9
Chapter 9 9 Example: Express the output y[n] of the figure below as function of the input. By simplifying the expression derived show that y[n] = x[n-]. P n x n p P P ] [ P P W n p n w ] [ W ] [ V n x n v ; Q U v Q v n q n - - + u[n] p[n] w[n] r[n] y[n] v[n] q[n]
Chapter 9 9 Similarly W R [ ] [ V V Q ] [ W W R ] [ ] [ R U Y Q U Y n x n y The original signal is reconstructed. The above structure is a perfect reconstruction system. - - + u[n] p[n] w[n] r[n] y[n] v[n] q[n]
Example: An input signal with spectrum is shown below. The input signal is applied to the system shown below. Sketch, W, V, Y against. w[m] v[n] H y[n] H 0 0 Solution 0 / W / V 0 H 0 Chapter 9 95
Y 0 Modulation x u[n] U cos 0 n U in the frequency domain, /[U 0 ] / /[U 0 ] 0 0 Time Domain x ncos θ x nsin θ x n e jnθ 0 0 n n 0 θ θ Frequency Domain θ θ0 θ θ0 θ θ0 θ θ0 j 0 Chapter 9 96
Example: xt is the input signal for the system shown below. The analogue signal xt has the spectrum f given by: 0.9kH f.kh f.kh f 0.9kH 0 elsewhere xt A/D p[n] 0 H v[n] 0 y[n] Sampling Period T=0. ms cosn 0 0 = 0 5 H H is an ideal lowpass filter gain=0 with cut-off frequency f c =5 H. Sketch, one above another,, P, V, Y against. Solution: Note: P [ 0 0 ] fs 0 c.5kh; T 0 0.0 5 /.50 0.8 ; 0. Chapter 9 97
f f kh - -.5 /T 0.9.. 5-0.8 /- 0 /T P 0.7 / 0 0.8 0.9-0. 0/T 0. V 0. Lowpass filter -0. 0. 0/T/0 = /T Y 0 Chapter 9 98
Example a. A signal has been sampled at kh and for a particular application this signal is required to be used at a reduced sampling rate of 8 kh. i Draw a block diagram to show how you would achieve this. ii Indicate the type of digital filter which you would choose for part i above give reasons. b. The sampling period T of the input signal shown in the figure below is 5 µs. The relative frequency is θ = ωt. The first oscillator generates a carrier with a relative frequency T, where..0 rad / sec. The second oscillator generates a carrier with a relative frequency c T, where c.0 rad/sec. The low-pass filter has the following characteristics: G 0 0 i If the input spectrum is cos, Write appropriate equations for Bc, Dc, and Rc ii Sketch θ, Bc, Dc, and Rc against θ, xn b c n B c G d c n D c r c n R c cosn cosn Oscillator Oscillator Chapter 9 99
Solution a i L M 8000 000 ii Using IIR filter, we cannot take advantage of the fact that we have to compute only every N th output, since previous outputs are needed to compute the N th output. On the other hand, using FIR filter we can do our computation at the rate of fs /N a significantly lower computational rate. Chapter 9 00
Chapter 9 0 b 0 8 0 0 8 0 T CT cos cos cos B C 0, G B D C C elsewhere 0 C C C C C C R D D D D R Then from the above calculation, sketch C C C R D B and,,,. D, B c c D - D R c c c = D - D c C
Chapter 9 0 = elsewhere 0 - - - = elsewhere 0 - -
B c - D c - -/ / R c / - -/ / -/ / Carrier Freq Chapter 9 0
9.5 Summary At the end of this chapter, it is expected that you should know: Decimation, interpolation and sample rate conversion by a rational factor. How to draw the frequency responses of upsampled and downsampled signals relative to the original spectrum. How to calculate the cut-off frequencies required for decimation and interpolation. Modulation using sinusoidal carriers and the associated spectra. The difference between multi-rate systems. Analysing a simple multi-rate system using spectra. Chapter 9 0