Designing a High Pass Elliptic Filter for Desklib
VerifiedAdded on 2023/06/14
|16
|1796
|386
AI Summary
This article provides step-by-step instructions and code examples for designing a high pass elliptic filter for Desklib's online library of study material. It includes information on converting analogue frequencies to normalized radian frequencies, placing pass and stop frequencies, and testing the filter. The article also covers topics such as the differences between DTFT and DFT, and plotting signal spectra for various N.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Surname 1
Name:
University:
Course:
Tutor:
Date:
SOLUTION:
Question 1:
a. My last two digits for my Z number are 20 therefore I am going to design high pass (3) elliptic
filter (0). The analogue frequencies in equation 1 below can be converted to normalized radian
frequencies as follows:
normalized radian frequencies= 2∗π∗f
sampling frequency
Therefore:
1000 HZ will be: 0.2π rad/sample
2000 HZ will be: 0.4π rad/sample
3000 HZ will be: 0.6π rad/sample
4000 HZ will be: 0.8π rad/sample
I have decided to place the pass and stop frequencies at 2500 Hz and 2200 Hz respectively.
b. I have used the following code to solve instruction 2 the results are as shown below:
clear all;%clearing and closing all files
clc;
close all
Name:
University:
Course:
Tutor:
Date:
SOLUTION:
Question 1:
a. My last two digits for my Z number are 20 therefore I am going to design high pass (3) elliptic
filter (0). The analogue frequencies in equation 1 below can be converted to normalized radian
frequencies as follows:
normalized radian frequencies= 2∗π∗f
sampling frequency
Therefore:
1000 HZ will be: 0.2π rad/sample
2000 HZ will be: 0.4π rad/sample
3000 HZ will be: 0.6π rad/sample
4000 HZ will be: 0.8π rad/sample
I have decided to place the pass and stop frequencies at 2500 Hz and 2200 Hz respectively.
b. I have used the following code to solve instruction 2 the results are as shown below:
clear all;%clearing and closing all files
clc;
close all
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Surname 2
Ws=2500/10000;Wp=2200/10000;Rp=0.5;Rs=60;%filter specifications
[N wp]=ellipord (Wp,Ws,Rp,Rs);
N %filter order
% filter coefficients and poles and zeros
[b a]=ellip (N, Rp, Rs, wp,'high');
[z p k]=ellip (N,Rp,Rs,wp);
Fvtool (b,a)
%testing the filter
fs =10000;
t=0:1/fs: 0.2;
w=2*pi*t;
x_t=cosd (w*1000) +cosd (w*2000-60) +cosd(w*3000+30)+cosd(w*4000-90);
figure
plot (t,x_t)
title('original signal')
xlabel ('time in seconds')
ylabel ('magnitude')
y_t=filter (b,a,x_t);
figure
plo t(t,y_t)
title ('filtered signal')
xlabel ('time in seconds')
ylabel ('magnitude')
[H, T]=impz (b,a);
N=8 order of the filter
Poles: p =
0.7872 + 0.1726i
0.7872 - 0.1726i
0.7716 + 0.4403i
0.7716 - 0.4403i
Ws=2500/10000;Wp=2200/10000;Rp=0.5;Rs=60;%filter specifications
[N wp]=ellipord (Wp,Ws,Rp,Rs);
N %filter order
% filter coefficients and poles and zeros
[b a]=ellip (N, Rp, Rs, wp,'high');
[z p k]=ellip (N,Rp,Rs,wp);
Fvtool (b,a)
%testing the filter
fs =10000;
t=0:1/fs: 0.2;
w=2*pi*t;
x_t=cosd (w*1000) +cosd (w*2000-60) +cosd(w*3000+30)+cosd(w*4000-90);
figure
plot (t,x_t)
title('original signal')
xlabel ('time in seconds')
ylabel ('magnitude')
y_t=filter (b,a,x_t);
figure
plo t(t,y_t)
title ('filtered signal')
xlabel ('time in seconds')
ylabel ('magnitude')
[H, T]=impz (b,a);
N=8 order of the filter
Poles: p =
0.7872 + 0.1726i
0.7872 - 0.1726i
0.7716 + 0.4403i
0.7716 - 0.4403i
Surname 3
0.7600 + 0.5773i
0.7600 - 0.5773i
0.7604 + 0.6315i
0.7604 - 0.6315i
Zeros: z =
-0.3736 + 0.9276i
-0.3736 - 0.9276i
0.4965 + 0.8680i
0.4965 - 0.8680i
0.6718 + 0.7407i
0.6718 - 0.7407i
0.7144 + 0.6997i
0.7144 - 0.6997i
-
Figure 1: Filter coefficients
0.7600 + 0.5773i
0.7600 - 0.5773i
0.7604 + 0.6315i
0.7604 - 0.6315i
Zeros: z =
-0.3736 + 0.9276i
-0.3736 - 0.9276i
0.4965 + 0.8680i
0.4965 - 0.8680i
0.6718 + 0.7407i
0.6718 - 0.7407i
0.7144 + 0.6997i
0.7144 - 0.6997i
-
Figure 1: Filter coefficients
Surname 4
Figure 2: magnitude response
Figure 3: Phase response
Figure 2: magnitude response
Figure 3: Phase response
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Surname 5
Figure 4: Pole/zero plot
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
time in seconds
-3
-2
-1
0
1
2
3
magnitude
original signal
Figure 5: Original signal
Figure 4: Pole/zero plot
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
time in seconds
-3
-2
-1
0
1
2
3
magnitude
original signal
Figure 5: Original signal
Surname 6
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
time in seconds
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
magnitude
filtered signal
Figure 6: Filtered signal
Question 2:
a. H ( z )= 1− z−2
1+ 0.9025 z−2
( 1+0.9025 z−2 ) Y ( z ) = ( 1−z−2 ) X ( z )
Taking the inverse lapse we have:
Y[n] =-0.9025y [n-2]+x[n]-x[n-2]
The order of the filter is 2 because the highest feedforward and feedback filter order is 2.
b. From the long division we have transfer function as:
H(z)=1-1.9025Z-2+1.717Z-4-1.5496Z-6+1.399Z-8-1.262Z-10
close all;
clear all;
clc;
b= [1 -1];
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
time in seconds
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
magnitude
filtered signal
Figure 6: Filtered signal
Question 2:
a. H ( z )= 1− z−2
1+ 0.9025 z−2
( 1+0.9025 z−2 ) Y ( z ) = ( 1−z−2 ) X ( z )
Taking the inverse lapse we have:
Y[n] =-0.9025y [n-2]+x[n]-x[n-2]
The order of the filter is 2 because the highest feedforward and feedback filter order is 2.
b. From the long division we have transfer function as:
H(z)=1-1.9025Z-2+1.717Z-4-1.5496Z-6+1.399Z-8-1.262Z-10
close all;
clear all;
clc;
b= [1 -1];
Surname 7
a= [1 0.9025];
[H W]=impz (b,a);
From the code the coefficients are:
H =
1.0000
-1.9025
1.7170
-1.5496
1.3985
-1.2622
c. The poles can be obtained as follows:
H ( z )= 1− z−2
1+ 0.9025 z−2 = z2+1
0.9025+ z2
Poles at: Z2 +0.9025=0 Z =± j0.95
Zeroes at: Z2 −1=0 Z=±1
The frequency response can be sketched as:
Figure 7: Sketch of the magnitude response
a= [1 0.9025];
[H W]=impz (b,a);
From the code the coefficients are:
H =
1.0000
-1.9025
1.7170
-1.5496
1.3985
-1.2622
c. The poles can be obtained as follows:
H ( z )= 1− z−2
1+ 0.9025 z−2 = z2+1
0.9025+ z2
Poles at: Z2 +0.9025=0 Z =± j0.95
Zeroes at: Z2 −1=0 Z=±1
The frequency response can be sketched as:
Figure 7: Sketch of the magnitude response
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Surname 8
Matlab code and the plot
close all;
clear all;
clc;
b= [1 0 -1];
a= [1 0 0.9025];
[H W]=impz (b,a);
Freqz (b,a)
Figure 8: Frequency response
d. The block diagram of the filter can be represented as:
Matlab code and the plot
close all;
clear all;
clc;
b= [1 0 -1];
a= [1 0 0.9025];
[H W]=impz (b,a);
Freqz (b,a)
Figure 8: Frequency response
d. The block diagram of the filter can be represented as:
Surname 9
Figure 9: Block diagram represention of the filter
Question 3
Pole-zero plots 1 has magnitude frequency response plot A.
Pole-zero plots 2 has magnitude frequency response plot C.
Pole-zero plots 3 has magnitude frequency response plot E.
Pole-zero plots 4 has magnitude frequency response plot B.
Pole-zero plots 5 has magnitude frequency response plot A.
Pole-zero plots 6 has magnitude frequency response plot D.
The transfer function for the first three plots will be given by:
H ( Z )= Z
Z2+1.2 Z +0.85
H ( Z )= Z +1
Z−0.981
H ( Z ) = Z
Z2+1
Figure 9: Block diagram represention of the filter
Question 3
Pole-zero plots 1 has magnitude frequency response plot A.
Pole-zero plots 2 has magnitude frequency response plot C.
Pole-zero plots 3 has magnitude frequency response plot E.
Pole-zero plots 4 has magnitude frequency response plot B.
Pole-zero plots 5 has magnitude frequency response plot A.
Pole-zero plots 6 has magnitude frequency response plot D.
The transfer function for the first three plots will be given by:
H ( Z )= Z
Z2+1.2 Z +0.85
H ( Z )= Z +1
Z−0.981
H ( Z ) = Z
Z2+1
Surname 10
The frequency response for the above will be given respectively by:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-10
0
10
20
Magnitude (dB)
Figure 10: plot 1
The frequency response for the above will be given respectively by:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-10
0
10
20
Magnitude (dB)
Figure 10: plot 1
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Surname 11
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
Magnitude (dB)
Figure 11: plot 2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-20
0
20
40
Magnitude (dB)
Figure 12: plot 3
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
Magnitude (dB)
Figure 11: plot 2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-20
0
20
40
Magnitude (dB)
Figure 12: plot 3
Surname 12
Question 4
The general representation of a DTFT is given by:
Therefore finite signal can be represented as:
X ( Ω ) =x ( 2 ) e− j 2 Ω +x ( 0 ) e− j 0 Ω + x ( 1 ) e− j Ω +x ( 0 ) e− j 0 Ω + x (−3 ) e j3 Ω+ x (−1 ) e j Ω +x ( 1 ) e− j Ω
Its z transform will be:
X ( Z )=x ( 2 ) Z−2+ x ( 0 ) Z−0 + x ( 1 ) Z−1 + x ( 0 ) Z0+ x (−3 ) Z3 + x (−1 ) Z1+x ( 1 ) Z−1
clear all;%clearing and closing all files
clc;
close all
n= [32 64 128];
X= [2 0 1 0 -3 -1 1];
H=fft(X);
H';
Stem (H,'filled')
grid
ylabel('signal spectrum')
Question 4
The general representation of a DTFT is given by:
Therefore finite signal can be represented as:
X ( Ω ) =x ( 2 ) e− j 2 Ω +x ( 0 ) e− j 0 Ω + x ( 1 ) e− j Ω +x ( 0 ) e− j 0 Ω + x (−3 ) e j3 Ω+ x (−1 ) e j Ω +x ( 1 ) e− j Ω
Its z transform will be:
X ( Z )=x ( 2 ) Z−2+ x ( 0 ) Z−0 + x ( 1 ) Z−1 + x ( 0 ) Z0+ x (−3 ) Z3 + x (−1 ) Z1+x ( 1 ) Z−1
clear all;%clearing and closing all files
clc;
close all
n= [32 64 128];
X= [2 0 1 0 -3 -1 1];
H=fft(X);
H';
Stem (H,'filled')
grid
ylabel('signal spectrum')
Surname 13
1 2 3 4 5 6 7
-1
0
1
2
3
4
5
6
signal spectrum
Figure 13: DTFT DTF plot
Differences between DTFT and DFT
DFT is the tool used for the computation of DTFT
There are few differences in properties between DTFT and DFT concerning the indexing of
chronological sequences that are processed modulo N
DFT is a sampled version of DTFT that is DFT is derived by sampling DTFT. But DTFT is
obtained by using the sampled form of input signal x (t). So, we find that DFT is obtained
by the double sampling of x (t)
DFT gives lesser number of frequency components than DTFT
1 2 3 4 5 6 7
-1
0
1
2
3
4
5
6
signal spectrum
Figure 13: DTFT DTF plot
Differences between DTFT and DFT
DFT is the tool used for the computation of DTFT
There are few differences in properties between DTFT and DFT concerning the indexing of
chronological sequences that are processed modulo N
DFT is a sampled version of DTFT that is DFT is derived by sampling DTFT. But DTFT is
obtained by using the sampled form of input signal x (t). So, we find that DFT is obtained
by the double sampling of x (t)
DFT gives lesser number of frequency components than DTFT
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Surname 14
DFT gives only positive frequency values, whereas DTFT can give both positive and
negative frequency values
DTFT and DFT co-incide at intervals of 2πkN where k = 0,1,......,N-1
To get more accurate values of DFT, number of samples N must be very high, when N is
very high, the required computation time is very high
The DFT transforms one finite sequence to another finite sequence whereas the DTFT
transforms an essentially infinite sequence to a continuous function
In case of DFT the spectrum is discrete in that only a finite quantity of frequencies were
needed whereas in DTFT only time is discrete, the frequencies take values in a continuous
interval
The input and output of DFT are finite whereas in DTFT the input and output are infinite
Question 5
The following code has been used to plot the signal spectrum of
for various N
clear all;%clearing and closing all files
clc;
close all
n=0:20;
X=cosd (n*500)+cosd(n*1500);
H=fft(X);
H';
Stem (n,H,'filled')
grid
ylabel('signal spectrum')
DFT gives only positive frequency values, whereas DTFT can give both positive and
negative frequency values
DTFT and DFT co-incide at intervals of 2πkN where k = 0,1,......,N-1
To get more accurate values of DFT, number of samples N must be very high, when N is
very high, the required computation time is very high
The DFT transforms one finite sequence to another finite sequence whereas the DTFT
transforms an essentially infinite sequence to a continuous function
In case of DFT the spectrum is discrete in that only a finite quantity of frequencies were
needed whereas in DTFT only time is discrete, the frequencies take values in a continuous
interval
The input and output of DFT are finite whereas in DTFT the input and output are infinite
Question 5
The following code has been used to plot the signal spectrum of
for various N
clear all;%clearing and closing all files
clc;
close all
n=0:20;
X=cosd (n*500)+cosd(n*1500);
H=fft(X);
H';
Stem (n,H,'filled')
grid
ylabel('signal spectrum')
Surname 15
0 2 4 6 8 10 12 14 16 18 20
-2
0
2
4
6
8
10
signal spectrum
Figure 14: signal spectral
Works Cited
Blanchet, Gerard, and Maurice Charbit. Digital Signal and Image Processing Using Matlab,
Volume 2: Advances and Applications. Hoboken, NJ: Wiley-ISTE, 2015. Internet resource.
Derbel, Faouzi, Nabil Derbel, and Olfa Kanoun. Communication, Signal Processing &
Information Technology. , 2017. Internet resource.
Möller, Konrad. Run-time Reconfigurable Constant Multiplication on Field Programmable Gate
Arrays. , 2017. Print.
0 2 4 6 8 10 12 14 16 18 20
-2
0
2
4
6
8
10
signal spectrum
Figure 14: signal spectral
Works Cited
Blanchet, Gerard, and Maurice Charbit. Digital Signal and Image Processing Using Matlab,
Volume 2: Advances and Applications. Hoboken, NJ: Wiley-ISTE, 2015. Internet resource.
Derbel, Faouzi, Nabil Derbel, and Olfa Kanoun. Communication, Signal Processing &
Information Technology. , 2017. Internet resource.
Möller, Konrad. Run-time Reconfigurable Constant Multiplication on Field Programmable Gate
Arrays. , 2017. Print.
Surname 16
Theodoridis, Sergios, and Rama Chellappa. Academic Press Library in Signal Processing: Array
and Statistical Signal Processing. Waltham: Elsevier Science, 2014. Internet resource.
Swanson, Ryan P. Design and Simulation of Fixed and Adative Digital Quadrature Filters: A
Thesis. , 2011. Print.
Allen, Ronald L, and Duncan W. Mills. Signal Analysis: Time, Frequency, Scale and Structure.
New York: Wiley, 2004. Print.
Kani, A N. Digital Signal Processing. New Dehi: Tata McGraw Hill Education, 2012. Print.
Yaroslavsky, Leonid. Digital Signal Processing in Experimental Research Volume 1: Fast
Transform Methods in Digital Signal Processing. Sharjah: Bentham Science Publishers,
2011. Internet resource.
Theodoridis, Sergios, and Rama Chellappa. Academic Press Library in Signal Processing: Array
and Statistical Signal Processing. Waltham: Elsevier Science, 2014. Internet resource.
Swanson, Ryan P. Design and Simulation of Fixed and Adative Digital Quadrature Filters: A
Thesis. , 2011. Print.
Allen, Ronald L, and Duncan W. Mills. Signal Analysis: Time, Frequency, Scale and Structure.
New York: Wiley, 2004. Print.
Kani, A N. Digital Signal Processing. New Dehi: Tata McGraw Hill Education, 2012. Print.
Yaroslavsky, Leonid. Digital Signal Processing in Experimental Research Volume 1: Fast
Transform Methods in Digital Signal Processing. Sharjah: Bentham Science Publishers,
2011. Internet resource.
1 out of 16
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.