Advanced Digital Processing Methods 5th Exercise

Decimated filter banks

Z – transform

Useful link: http://fourier.eng.hmc.edu/e161/lectures/filterbank/node1.html

Downsampling and upsampling by integer factor M

Useful link: http://ocw.mit.edu/courses/mathematics/18-327-wavelets-filter-banks-and-applications-spring- 2003/lecture-notes/Slides2.pdf

x[n] v[n] Downsampling is the process of decreasing the signal size. Symbol is (M) or M In the time domain: v[k] = x[Mk].

In MATLAB: xd = x(1:M:length(x)).

In the frequency domain:

  2   2 M 1    j  j    j   j 1   V e  X e M   X e  M    X e  M  . (1) M              x[n] u[n] Upsampling is the process of increasing the signal size. Symbol M or M

In the time domain: u[Mk] = x[k], otherwise 0.

In MATLAB:

xi = zeros(1, M*length(x)); xi(1:M:M*length(x)) = x;

In the frequency domain:

Ue j   X e jM . (2)

Frequency response of downsampled and upsampled signal by factor M is:

1

Advanced Digital Methods 5th Exercise

 2   2    j    j M 1   j 1 j U e  X e  X e  M    X e  M  . (3) M         

We get the resulting spectrum by summing up the shifted copies of the original spectrum (shifted by multiples of 2/M)

We get (1) from (3) by stretching it by the factor of M.

Decimated two-channel

Useful links: https://www.youtube.com/watch?v=oluUlr0Uxz8 https://www.youtube.com/watch?v=wcVY654ZCd8 http://fourier.eng.hmc.edu/e161/lectures/filterbank/node2.html http://ocw.mit.edu/courses/mathematics/18-327-wavelets-filter-banks-and-applications-spring- 2003/lecture-notes/Slides3.pdf

Filter bank:

X(z) U (z) V0(z) 0 Xr(z) H0(z) F0(z)

U1(z) V1(z) H1(z) F1(z)

Intermediate :

1 U (z)  H (z)X z  H (z)X  z . 0 2 0 0 (4) 1 U (z)  H (z)X z  H (z)X  z . 1 2 1 1

For a perfect reconstruction we need:

1 F z  H (z)X z  H (z)X  z  0 2 0 0 (5) 1 F z  H (z)X z  H (z)X  z  z L X (z) 1 2 1 1

2

Advanced Digital Signal Processing Methods 5th Exercise

Aliasing cancelation ( terms contains -z: it corresponds to -shifted spectral components):

F0 zH 0 (z)X  z F1zH1(z)X  z  0 X (z) , (6)

F0 z H0 (z)  F1z H1(z)  0 . (7)

Perfect reconstruction (including possible delay):

xr n  xn  L, (8)

Perfect reconstruction:

L F0 z H 0 (z)  F1z H1 (z)  2z . (9)

Problem 1

Define signal (variable signal1) with frequency response (variable SIG1) given in Figure 1. Plot it in the time domain.

1

     

Plot the original frequency response together with two shifted frequency responses, where the shifts are and ( , , …, , and in MATLAB). hold on plot plot hold off circshift

Sum up the three frequency responses (SIG2) and plot the result. Calculate the signal in the time domain (signal2). Check if signal2 is upsampled signal1.

Enlarge the added frequency responses (SIG2) 3 times. Transform it back to the time domain (signal3). Compare it to signal1. Do you get downsampling? How’s about aliasing?

Downsample the original signal (signal1) by the factor of 3 in the time domain (signal3). Do you get the same signal as before (signal2)?

Upsample signal3 by inserting two zeros between every sample of the signal3 in the time domain (signal4). Compare it with signal2.

Problem 2 Realize filter bank with two filters, with downsampling and upsampling by the factor of 2.

Define a signal of 600 sample length and the frequency response shown in Figure 2. Calculate and plot the associated signal in the time domain.

3

Advanced Digital Signal Processing Methods 5th Exercise

1

 

Define filters with impulse responses: h0(n) = [1, 1], h1(n) = [1, -1], f0(n) = ½ [1, 1], f1(n) = ½ [-1, 1].

Plot the frequency responses of the filters in the frequency range 휔∈ [−휋,휋].

Calculate and plot outputs of the filters H0 i H1 in the frequency range 휔∈ [−휋,휋] (use wkeep if needed).

Calculate and plot the frequency responses of terms: F0(z)H0(z)X(z), F1(z)H1(z)X(z), F0(z)H0(-z)X(-z) and

F1(z)H1(-z)X(-z) in the frequency range 휔∈ [−휋,휋].

Which pair of four frequency responses does refer to the aliasing and should be be canceled?

Calculate the reconstructed signal. Plot its frequency response. Compare it to the original signal. Did you achieve perfect reconstruction?

4