CP_11_11_2016_Solved

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Name: Signal Theory

November 11th, 2016

1.- Compute the z-transform and ROC for the following discrete-time signal: (2p)
𝒏
𝒙(𝒏) = 𝟐 𝒏 > 𝟎 𝒂𝒏𝒅 𝒆𝒗𝒆𝒏 𝒏

x(n) = 0 n ≤ 0 or odd n

𝑟
∑ 𝑘𝑟 𝑘 =
(1 − 𝑟)2
0

𝑥(𝑛) = [0, 0,1,0,2,0,3,0,4, … ]

𝑋(𝑧) = 𝑧 −2 + 2𝑧 −4 + 3𝑧 −6 + 4𝑧 −8 + ⋯

𝑧 −2
𝑋(𝑧) = ∑ 𝑘(𝑧 −2 )𝑘 =
(1 − 𝑧 −2 )2
0

𝑅𝑂𝐶: |𝑧 −2 | < 1, 𝑖. 𝑒. , |𝑧| > 1

2.-In matlab pseudocode, design the best filter that meets the following conditions using the
window method: (2p)

- High-pass filter with cut-off frequency 200 kHz.

- Sampling frequency 1 MHz.

- Maximum transition band 100 kHz.

- Maximum number of coefficients: 40.

2.a.- Design the filter (1.5 p.)

The filter that achieves the best ripple and attenuation fulfilling the transition band is Hamming
(with 33 coefficients). Once Hamming window is selected, incrementing the number of
coefficients will not improve ripple and attenuation. Steps:

1.- Generate ideal high-pass filter coefficients with n=[-16:16].

2.- Generate Hamming window with n=[0:32].

3.- Multiply both vectors.

4.- Check desired frequency response fulfils requirements.

2.b.- Which are the stopband attenuation and ripple of the filter? (0.5 p.)
Ripple: 0.0149 dB. Attenuation: 53 dB.

3.- Explain the main advantages and disadvantages of FIR and IIR filters (2p.)

MOST IMPORTANT FIVE DIFFERENCES:

1.- FIR filters can have (usually have) linear phase, whereas IIR cannot.

2.- FIR filters are always stable (no poles). IIR filters can be unstable.

3.- Quantization issues are more sever for IIR than for FIR, due to the feedback.

4.- FIR filters require more coefficients for same performance.

5.- Analog filters can be used to design IIR filters.

4.- In Matlab pseudocode, write the implementation for a IIR filter of order N (2p.)

FILTER COEFFICIENT VECTORS: b (Nx1), a(Nx1)

INPUT: x, OUTPUT: y

NUMBER OF SAMPLES L

x_last=zeros(1,N);
y_last=zeros(1,N);

for l=0:L-1

x_last=[x(l), x_last(1:N-1)];

for n=0:N-1

y_now=y_now+b(n+1)x_last(n+1);

if (n<N-1) y_now=y_now+a(n+2)y_last(n+1);

end;

y(l)=y_now;

end;

y_last=[y, y_last(1:N-1)];

end
5.- Design a high-pass IIR filter parting from the following analog filter with digital
normalized cut-off frequency of 0.2 (Q and H0 are just constants): (2p.)

Desired w0=ktan(2*pi*0.2/2)=0.72

Replace wo with 0.72 and s with k(z-1)/(z+1)

Useful material:

Window functions:

Ideal low-pass filter coefficients:


Bilinear transform:

You might also like