Multirate Signal Processing

0 downloads 0 Views 60KB Size Report
In this exercise we will study multirate digital signal processing and filter banks using MAT-. LAB. You can ... Parts I and II of the course material for the course SGN-2106 Multirate Signal Processing. There is also .... Note, that you can increase ...
SGN-1650 Signaalink¨asittelyn tyokurssi ¨ SGN-1656 Signal processing laboratory

Multirate Signal Processing In this exercise we will study multirate digital signal processing and filter banks using M ATLAB. You can find some material about these topics in the folder on the top of the shelves on the fourth floor, at beginning of the Tietotalo C-corridor. This material basically contains Parts I and II of the course material for the course SGN-2106 Multirate Signal Processing. There is also a chapter about multirate DSP in the book “Digital Signal Processing, a Practical Approach” [1]. The student should have some background in multirate signal processing. Working experience with M ATLAB is highly recommended. Return your report to Raija Lehto room TE421 or raija [email protected] (pdf-document or postscript-file). The report must contain (at least) the following items: • • • •

Brief explanation of the methods you have used Answers to the questions Commented M ATLAB m-files you wrote in this work Pictures asked below

Include also your group number and e-mail address(es) in the report.

1 Design of Multirate FIR Filter Narrow-band linear-phase finite-impulse-response (FIR) filters can be efficiently implemented using multirate technique. In this technique, the sampling frequency is first decreased and the actual FIR filter is implemented at the lower sampling frequency. This considerably reduces the complexity of the filter. After filtering the sampling frequency is increased back to the desired level. Next we compare two FIR filter designs which have the same specifications. The first one is a normal FIR filter and the second one is a multirate FIR filter.

1

fs

H1 (z)

H2 (z)

M

N

f s /(M N ) H(z)

fs

M H1 (z)

M

N H2 (z)

N

Figure 1: FIR filter implementation using multirate technique.

1.1 FIR filter design Design a linear-phase FIR filter using minimax approximation (equiripple in the passband and stopband). This can be done using remez-function in M ATLAB (or firpm in M ATLAB 7) and the filter order can be achieved by using remezord-function (firpmord in M ATLAB 7). The filter specifications are as follows: • passband edge ω p = 0.01 f s /2 • stopband edge ωs = 0.0105 f s/2 • passband ripple δ p ≤ 0.02 (0.35-dB passband ripple) • stopband ripple δs ≤ 0.00316 (50-dB stopband attenuation). What is the minimum order of a linear-phase FIR filter to meet the above specifications? How many multiplications one output sample requires if the coefficient symmetry is utilized? (It is not necessary to calculate the filter coefficients.)

1.2 FIR filter design using multirate technique Design a FIR filter using multirate technique (see Figure 1). The overall structure in Figure 1 should meet the same specifications which are given above. You should decrease the overall sampling rate as much as possible because the complexity of the filter H(z) depends on the sampling rate f s /(MN). When you have chosen the overall sampling rate reduction, implement the sampling rate conversion using two decimation/interpolation stages (M and N). It is not necessary to go through all the possible combinations of the decimation factors M and N but chose some reasonable partition. Filters H1 (z) and H2 (z) have to be designed so that there is no aliasing in the band [0, 0.0105 f s/2]. Questions: 1. What is the maximum sampling rate reduction (MN)? Why it can not be bigger? 2. The values of M and N? 3. Filter specifications (the passband and stopband edges, as well as the passband and stopband ripples) and the filter orders for H1 (z), H2 (z), and H(z)? 4. How many multiplications one output sample requires if the coefficient symmetry is utilized (compare with the previous filter)? 2

x(n)

H0 (z)

2

2

F0 (z)

H1 (z)

2

2

F1 (z) ´ x(n)

Analysis bank

Synthesis bank

Figure 2: Quadrature filter bank. 5. What disadvantages you can find for this filter structure? Plot the frequency responses of all three filters so that H2 (z) and H(z) are transferred to the input sampling frequency [H2 (z) 7→ H2 (z M ) and H(z) 7→ H(z MN )]. On the other words, before you take FFT (you may also use freqz) add M − 1 zeros between every sample of H2 (z) and MN − 1 zeros between every sample of H(z) (you can use a M ATLAB function upsample which adds zeros between input samples). Test the overall structure by implementing it in M ATLAB. Use resample function for the decimation and interpolation. This function takes also the decimation/interpolation filter as an input parameter. Use a unit impulse (e.g. x = [1 zeros(1,4000)]) as an input signal, then you will get the overall filter frequency response by taking the fast Fourier transform (FFT) from the output (return this figure also). It may also be beneficial to use zero-padding when computing the FFT [e.g. z = fft(y, 2ˆ14)]. If the frequency response of the overall filter is not what you expected, you can (or you should) find the reason for that by studying the responses of H1 (z), H2 (z M ), and H(z MN ). The overall frequency response is the sum of responses of H1 (z), H2 (z M ), and H(z MN ) in the logarithmic scale.

2 Design of Quadrature Filter Bank Next we will study filter banks where the interpolation and decimation is utilized. Figure 2 shows a simple quadrature filter bank. Analysis bank [H0 (z) and H1 (z)] divides the input signal x(n) in two frequency bands ([0, f s /4] and [ f s /4, f s /2]). The output of the filter bank is given by   1 1 ´ X(z) = H0 (z)F0 (z) + H1 (z)F1 (z) X(z) + H0 (−z)F0 (z) + H1 (−z)F1 (z) X(−z), 2 2 where the right-hand term corresponds to the aliased term. Your job is to design an analysis bank, that is, the filters H0 (z) and H1 (z), using a half-band filter E(z) which has the double zeros on the unit circle. Because of these double zeros, it can be divided into a minimum-phase term H0 (z) and a maximum-phase term H1 (−z). ´ You can design a half-band filter E(z) (which has not double zeros on the unit circle) using remez function, if you properly choose the filter order and the passband and stopband edges (do not use weighting in remez function). 3

´ Then you should obtain E(z) from E(z) in some way (see material). Because of the inaccuracy in calculations, the double zero pairs of E(z) are not exactly at the same points. However, they can be combined by taking average of the double zero pairs. Note, that you can increase the accuracy of the remez algorithm by calling it with four arguments as follows: remez(N, F, A, {256}). The filter specifications for H0 (z) are as follows: • stopband edge ωs = 0.65 f s /2 • passband ripple δ p ≤ 0.001 • stopband ripple δs ≤ 0.001 Return: 1. The frequency response, impulse response, and z-plane zero diagram for the half-band ´ filter E(z) which has not double zeros on the unit circle. 2. The z-plane zero diagram for the half-band filter E(z) which has the double zeros on the unit circle. 3. The frequency response, impulse response, and z-plane zero diagram for the filters H0 (z) and H1 (z). Questions: ´ 1. What are the orders for E(z), H0 (z), and H1 (z)? 2. What applications you can find for the filter banks? Useful M ATLAB functions: roots, poly, real, zplane, and zerophase If you have any questions concerning this work, don’t hesitate to send e-mail to me. Raija Lehto, e-mail: [email protected]

Additional Literature [1] E. C. Ifeachor and B. W. Jervis, Digital Signal Processing, A Practical Approach, AddisonWesley, 1993. [2] T. Saram¨aki, “Finite impulse response filter design,” in Handbook for Digital Signal Processing, S. K. Mitra and J. F. Kaiser, Eds., chapter 4, pp. 155–277. New York: John Wiley and Sons, 1993. [3] T. Saram¨aki and R. Bregovi´c, “Multirate systems and filter banks,” in Multirate Systems: Design & Applications, G. Jovanovic-Dolecek, Ed., chapter II, pp. 27–85. Hershey: Idea Group Publishing, 2002, [Online]. Available HTTP: http://alpha.cc.tut.fi/˜tap/book01_cor.pdf. [4] R. Ansari and B. Liu, “Multirate signal processing,” in Handbook for Digital Signal Processing, S. K. Mitra and J. F. Kaiser, Eds., chapter 14, pp. 981–1084. New York: John Wiley and Sons, 1993.

4