Vous êtes sur la page 1sur 7

LAB # 7

TYPE I to IV FIR Filters Using FDA tool

Task 1
Given the specification of the the low pass filter below use FDA tool to
plot the Magnitude,phase ,group delay and pole zero plot

1 >> TYPE-1 FIR FILTER:-


Filter Order: 50

Fs : 48000 KHz
Fpass : 9600 KHz
Fstop : 12000 KHz

Apass : 1 dB
Astop : 80 dB

Response type : Low Pass


Design Method : FIR Equiripple

MAGNITUDE RESPONSE (dB):


PHASE RESPONSE:

GROUP DELAY:
POLE ZERO PLOT:

2 >> TYPE-2 FIR FILTER:-


Filter Order: Minimum

Fs : 48000 KHz
Fpass : 9600 KHz
Fstop : 12000 KHz

Wpass : 1
Wstop : 1

Response type : Low Pass


Design Method : FIR Equiripple

1
MAGNITUDE RESPONSE (dB):

PHASE RESPONSE:

GROUP DELAY:

POLE ZERO PLOT:

3 >> TYPE-3 FIR FILTER:-


Filter Order: 12

Fs : 48000 KHz
Fpass : 9600 KHz
Fstop : 12000 KHz

Wpass : 1
Wstop : 1

Response type : High Pass


Design Method : FIR Equiripple

MAGNITUDE RESPONSE (dB):


PHASE RESPONSE:
GROUP DELAY:
POLE ZERO PLOT:

4 >> TYPE-4 FIR FILTER:-


Filter Order: 25

2
Fs : 48000 KHz
Fpass : 9600 KHz
Fstop : 12000 KHz

Wpass : 1
Wstop : 1

Response type : High Pass


Design Method : FIR Equiripple
MAGNITUDE RESPONSE (dB):
PHASE RESPONSE:
GROUP DELAY:
POLE ZERO PLOT:

CONCLUSIONS:-

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

__________________________________________________.

3
Task 2
is related to SPECTRAL ANALYSIS topic .Run the following code and
observe the effect of the window by changing its length to 32, 64, 200
and 1024. Also determine the length of the window which will resolve
the two sinusoids given in the code below

Task 3
Change the type of the window in the above code and observe the effects
of the type of the window on the output of the code below.

N1=16;
n=[0:N1-1]';
w0=0.25*pi;
w1=0.3*pi;
x=cos(w0*n)+0.5*cos(w1*n);
subplot(5,2,1)
stem(n,x);
title('Plot of signal x(n)');
xspect=fft(x,1024);
w=[0:1024-1]'*2*pi/1024;
subplot(5,2,2)
plot(w(1:512)*1/pi,abs(xspect(1:512)));
grid on;
xlabel('frequency(*\pi),\omega')
title('Spectral Analysis , w0=0.3*\pi')

2 >> KAISER WINDOW PLOTS:-

%KAISER WINDOW%
N=163;
n=0:N-1;
beta=5.48;
w1=0.30*pi;
w0=0.25*pi;
x=cos(w0*n)+0.5*cos(w1*n);
kw=kaiser(N,beta);
figure;
stem(n,kw);
[kw_freq,w4]=freqz(kw,1,512);

4
title('Magnitude Spectrum plot');
figure;
plot(w4/pi, 20*log10(abs(kw_freq)));grid on;
title('Kaiser Window Plot');
xlabel('Values of Frequency');
ylabel('Attenuation Magnitude ');

3 >> PLOTS OF DIFFERENT WINDOWS:-


%generate different types of Windows Having same length and observe
the side lobe attenuation and
%Main lobe width%%%%%% WINDOW LENGTH=32 %

m=input('give the length of the window=');


n=0:m-1
%Rectangular window
rw=boxcar(m);
figure;
stem(n,rw);
title('Rectangular Window Plot');
xlabel('Values of n');
ylabel('Magnitude');
[rw_freq,w1]=freqz(rw,1,512);
figure;
plot(w1/pi, 20*log10(abs(rw_freq)));grid on;
title('Rectangular Window Plot');
xlabel('Values of Frequency');
ylabel('Attenuation Magnitude ');

%%%%%%%%%%%%%%Hanning window
hw=hanning(m);
figure;
stem(n,hw);
title('Hanning Window Plot');
xlabel('Values of n');
ylabel('Magnitude');
[hw_freq,w2]=freqz(hw,1,512);
figure;
plot(w2/pi, 20*log10(abs(hw_freq)));grid on;
title('Hanning Window Plot');
xlabel('Values of Frequency');
ylabel('Attenuation Magnitude ');

5
%%%%%%%%%%%%%%Hamming window
hmw=hamming(m);
figure;
stem(n,hmw);
title('Hamming Window Plot');
xlabel('Values of n');
ylabel('Magnitude');
[hmw_freq,w3]=freqz(hmw,1,512);
figure;
plot(w3/pi, 20*log10(abs(hmw_freq)));grid on;
title('Hamming Window Plot');
xlabel('Values of Frequency');
ylabel('Attenuation Magnitude ');

%%%%%%%%%%%%%%Blackman window
bmw=blackman(m);
figure;
stem(n,bmw);
title('Blackmann Window Plot');
xlabel('Values of n');
ylabel('Magnitude');
[bmw_freq,w4]=freqz(bmw,1,512);
figure;
plot(w4/pi, 20*log10(abs(bmw_freq)));grid on;
title('Blackmann Window Plot');
xlabel('Values of Frequency');
ylabel('Attenuation Magnitude ');
>> OUTPUT PLOTS:-

CONCLUSIONS:-

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

6
_____________________________________________________________

Vous aimerez peut-être aussi