0% found this document useful (0 votes)
42 views

DSP Assignment

This document contains analysis of different types of digital filters including Butterworth, Chebyshev I, Chebyshev II, Elliptic and FIR filters. It provides plots of magnitude, phase and group delay responses of these filters. It also includes MATLAB code to design and analyze these filters. Key details reported include filter orders, passband and stopband cut-off frequencies for different filter types.

Uploaded by

Shreyash Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

DSP Assignment

This document contains analysis of different types of digital filters including Butterworth, Chebyshev I, Chebyshev II, Elliptic and FIR filters. It provides plots of magnitude, phase and group delay responses of these filters. It also includes MATLAB code to design and analyze these filters. Key details reported include filter orders, passband and stopband cut-off frequencies for different filter types.

Uploaded by

Shreyash Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

DSP ASSIGNMENT

MAYANK NARAIN
13EC10038

BUTTERWORTH

Magnitude (dB)

200
0
-200
-400
-600

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

-5000
0

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Phase (degrees)

10000

5000

60
50

Group delay (samples)

40
30
20
10
0
-10
-20
-30
-40

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

FIR 1

Magnitude (dB)

-50

-100

-150

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Phase (degrees)

1000
500
0
-500
-1000

FIR 2
Magnitude Response (dB)
0
-10

Magnitude (dB)

-20
-30
-40
-50
-60
-70
-80
-90
0

0.1

0.2

0.3

0.4
0.5
0.6
Normalized Frequency ( rad/sample)

0.7

0.8

0.9

FIR LS : Least Square Linear Phase FIR


Magnitude Response (dB)
0
-10

Magnitude (dB)

-20
-30
-40
-50
-60
-70
0

0.1

0.2

0.3

0.4
0.5
0.6
Normalized Frequency ( rad/sample)

0.7

0.8

0.9

FIR PM : Parks-McClellan FIR


Magnitude Response (dB)
0
-10

Magnitude (dB)

-20
-30
-40
-50
-60
-70
0

0.1

0.2

0.3

0.4
0.5
0.6
Normalized Frequency ( rad/sample)

0.7

0.8

0.9

CHEBYCHEV I

Magnitude (dB)

200
0
-200
-400
-600

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Phase (degrees)

1000

-1000

-2000

140
120

Group delay (samples)

100
80
60
40
20
0
-20

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

CHEBYCHEV 2

Magnitude (dB)

100
0
-100
-200
-300

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Phase (degrees)

400
200
0
-200
-400

140

120

Group delay (samples)

100

80

60

40

20

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

ELLIPTIC

Magnitude (dB)

-100

-200

-300

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Phase (degrees)

400
200
0
-200
-400

70

60

Group delay (samples)

50

40

30

20

10

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

0.9

Comparing different types of filters


Type

Order

Lower Fc

Higher Fc

Chebychev 1
Chebychev 2
Butterworth
Elliptic

9
9
26
5

0.2000
0.1900
0.1988
0.2000

0.3000
0.3100
0.3016
0.3000

MATLAB CODES
Code Part 1
Wp = [0.20 0.30];
Ws = [0.19 0.31];
Rp = 1;
Rs = 30;
% DEFINING DIFFERENT TYPES OF FILTERS
[n,Wn] = cheb1ord(Wp,Ws,Rp,Rs);
[n,Wn] = cheb2ord(Wp,Ws,Rp,Rs);
[n,Wn] = buttord(Wp,Ws,Rp,Rs);
[n,Wn] = ellipord(Wp,Ws,Rp,Rs);
disp('Order');
disp(n);
disp('Cut off frequency');
disp(Wn);
% PLOTS CORRESPONDING TO DIFFERENT FILTERS
[b,a] = cheby1(n,Rp,Wp);
[b,a] = cheby2(n,Rs,Ws);
[b,a] = butter(n,Wn);
[b,a] = ellip(n,Rp,Rs,Wp);
freqz(b,a);
fvtool(b,a,'Analysis','polezero');
grpdelay(b,a,128);

Code Part 2
n = 50;
f = [0 0.20 0.30 1];
m = [1 1 0 0];
b = fir2(n,f,m);
b = firls(n,f,m);
b = firpm(n,f,m);
fvtool(b,1);
b = fir1(n,[0.20 0.30]);
freqz(b,1,512);

You might also like