2. Design a digital lowpass filter to meet the following specifications: passband edge = 0.45π stopband edge = 0.5π Rp = 0.5 dB, As = 60 dB a. Design a Buttterworth filter, you may use the butterord and butter commands to implement. b. Design Chebyshev Type 1 filter ( use the equivalent commands to above ) c. Design an Elliptic fitler ( use the equivalent commands to part a ). d. List the order of each filter and find the actual Rp and As for each filter. To find the ripple and attenuation values you should use freqz to output the frequency response h and frequency w values to a vector at enough points , say 1000, then use the min or max commands to find the min or max in the passband or stopband range in the frequency response. You may need to use commands to convert to dB. e. Plot the magnitude response (in dB) for all three filters on one plot and plot the phase response for all three filters on another plot ( title the graph, label axes, and use a legend to identity the filter )
PLEASE SOLVE USING MATLAB
Part a
MATLAB Code
clc;
clear all;
close all;
Wp = 0.45;
Ws = 0.5;
Rp = 0.5;
Rs = 60;
[N, Wn] = buttord(Wp, Ws, Rp, Rs);
[b, a] = butter(N, Wn);
fprintf('The order of the Butterworth filter to meet the given specifications is %d \n', N);
w = 0:pi/1000:pi;
H = freqz(b, a, w);
H_dB = 20*log10(abs(H));
H_phase = angle(H)*180/pi;
subplot(2,1,1)
plot(w/pi, H_dB, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Magnitude in dB');
title('Magnitude Response of the Butterworth Filter');
subplot(2,1,2)
plot(w/pi, H_phase, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Phase in degrees');
title('Phase Response of the Butterworth Filter');
After Execution, we get
In the command window, the order required is displayed
The order of the Butterworth filter to meet the
given specifications is 51
>>
The frequency response plot obtained for the Butterworth Filter is as follows
Part b
MATLAB Code
clc;
clear all;
close all;
Wp = 0.45;
Ws = 0.5;
Rp = 0.5;
Rs = 60;
[N, Wn] = cheb1ord(Wp, Ws, Rp, Rs);
[b, a] = cheby1(N, Rp, Wp);
fprintf('The order of the Chebyshev Type I filter to meet the given specifications is %d \n', N);
w = 0:pi/1000:pi;
H = freqz(b, a, w);
H_dB = 20*log10(abs(H));
H_phase = angle(H)*180/pi;
subplot(2,1,1)
plot(w/pi, H_dB, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Magnitude in dB');
title('Magnitude Response of the Chebyshev Type I Filter');
subplot(2,1,2)
plot(w/pi, H_phase, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Phase in degrees');
title('Phase Response of the Chebyshev Type I Filter');
After Execution, we get
In the command window, the order required is displayed
The order of the Chebyshev Type I filter to meet the
given specifications is 16
>>
The frequency response plot obtained for the Chebyshev Type I Filter is as follows
Part c
MATLAB Code
clc;
clear all;
close all;
Wp = 0.45;
Ws = 0.5;
Rp = 0.5;
Rs = 60;
[N, Wn] = ellipord(Wp, Ws, Rp, Rs);
[b, a] = ellip(N, Rp, Rs, Wp);
fprintf('The order of the Elliptic filter to meet the given specifications is %d \n', N);
w = 0:pi/1000:pi;
H = freqz(b, a, w);
H_dB = 20*log10(abs(H));
H_phase = angle(H)*180/pi;
subplot(2,1,1)
plot(w/pi, H_dB, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Magnitude in dB');
title('Magnitude Response of the Elliptic Filter');
subplot(2,1,2)
plot(w/pi, H_phase, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Phase in degrees');
title('Phase Response of the Elliptic Filter');
After Execution, we get
In the command window, the order required is displayed
The order of the Elliptic filter to meet the given
specifications is 8
>>
The frequency response plot obtained for the Elliptic Filter is as follows
Part d
MATLAB Code
clc;
clear all;
close all;
Wp = 0.45;
Ws = 0.5;
Rp = 0.5;
Rs = 60;
w = 0:pi/1000:pi;
[Nb, Wn] = buttord(Wp, Ws, Rp, Rs);
[bb, ab] = butter(Nb, Wn);
Hb = freqz(bb, ab, w);
Nc = cheb1ord(Wp, Ws, Rp, Rs);
[bc, ac] = cheby1(Nc, Rp, Wp);
Hc = freqz(bc, ac, w);
Ne = ellipord(Wp, Ws, Rp, Rs);
[be, ae] = ellip(Ne, Rp, Rs, Wp);
He = freqz(be, ae, w);
wp_range = 0:pi/1000:0.45*pi;
ws_range = 0.5*pi:pi/1000:pi;
L1 = length(wp_range);
L2 = length(ws_range);
Hb_pb = Hb(1:L1);
Hb_pb_min = min(Hb_pb);
Rpb = 20*log10(abs(Hb_pb_min));
Hb_sb = Hb(L2:end);
Hb_sb_max = max(Hb_sb);
Rsb = 20*log10(abs(Hb_sb_max));
Hc_pb = Hc(1:L1);
Hc_pb_min = min(Hc_pb);
Rpc = 20*log10(abs(Hc_pb_min));
Hc_sb = Hc(L2:end);
Hc_sb_max = max(Hc_sb);
Rsc = 20*log10(abs(Hc_sb_max));
He_pb = He(1:L1);
He_pb_min = min(He_pb);
Rpe = 20*log10(abs(He_pb_min));
He_sb = He(L2:end);
He_sb_max = max(He_sb);
Rse = 20*log10(abs(He_sb_max));
fprintf('The order of the Butterworth filter to meet the given
specifications is %d \n', Nb);
fprintf('The order of the Chebyshev Type I filter to meet the given
specifications is %d \n', Nc);
fprintf('The order of the Elliptic filter to meet the given
specifications is %d \n \n \n', Ne);
fprintf('The pass band ripple of the Butterworth filter designed is
%f dB \n', Rpb);
fprintf('The stop band attenuation of the Butterworth filter
designed is %f dB \n', Rsb);
fprintf('The pass band ripple of the Chebyshev Type I filter
designed is %f dB \n', Rpc);
fprintf('The stop band attenuation of the Chebyshev Type I filter
designed is %f dB \n', Rsc);
fprintf('The pass band ripple of the Elliptic filter designed is %f
dB \n', Rpe);
fprintf('The stop band attenuation of the Elliptic filter designed
is %f dB \n', Rse);
After executing, we get
The order of the Butterworth filter to meet the given
specifications is 51
The order of the Chebyshev Type I filter to meet the given
specifications is 16
The order of the Elliptic filter to meet the given specifications
is 8
The pass band ripple of the Butterworth filter designed is
-0.425802 dB
The stop band attenuation of the Butterworth filter designed is
-60.000000 dB
The pass band ripple of the Chebyshev Type I filter designed is
-0.500000 dB
The stop band attenuation of the Chebyshev Type I filter designed
is -64.966806 dB
The pass band ripple of the Elliptic filter designed is -0.500000
dB
The stop band attenuation of the Elliptic filter designed is
-60.000000 dB
>>
Part (e)
clc;
clear all;
close all;
Wp = 0.45;
Ws = 0.5;
Rp = 0.5;
Rs = 60;
w = 0:pi/1000:pi;
[Nb, Wn] = buttord(Wp, Ws, Rp, Rs);
[bb, ab] = butter(Nb, Wn);
Hb = freqz(bb, ab, w);
Hb_dB = 20*log10(abs(Hb));
Hb_phase = angle(Hb)*180/pi;
Nc = cheb1ord(Wp, Ws, Rp, Rs);
[bc, ac] = cheby1(Nc, Rp, Wp);
Hc = freqz(bc, ac, w);
Hc_dB = 20*log10(abs(Hc));
Hc_phase = angle(Hc)*180/pi;
Ne = ellipord(Wp, Ws, Rp, Rs);
[be, ae] = ellip(Ne, Rp, Rs, Wp);
He = freqz(be, ae, w);
He_dB = 20*log10(abs(He));
He_phase = angle(He)*180/pi;
plot(w/pi, Hb_dB, w/pi, Hc_dB, w/pi, He_dB, 'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Magnitude in dB');
title('Magnitude Response of the Filters Designed');
legend('Magnitude Response of Butterworth Filter', 'Magnitude
Response of Chebyshve Type - I Filter', 'Magnitude Response of
Elliptic Filter', 'Location', 'SouthWest');
figure
plot(w/pi, Hb_phase, w/pi, Hc_phase, w/pi, He_phase,
'linewidth',2);
grid
xlabel('Normalized Frequency (\times \pi rad/sample)');
ylabel('Phase in degrees');
title('Phase Response of the Filters Designed');
legend('Phase Response of Butterworth Filter', 'Phase Response of
Chebyshve Type - I Filter', 'Phase Response of Elliptic Filter',
'Location', 'SouthWest');
The plots obtained after execution
2. Design a digital lowpass filter to meet the following specifications: passband edge = 0.45π stopband...
NI+N2-1. Find the output y(n) by using the DFT and the inverse DFT method. 4. (20 points) Design a lowpass Butterworth filter with the following specifications: A desired peak passband ripple Rp of 2 dB, the minimum stopband attenuation R, of 60 dB, the passband edge frequency op of 1000 rad/sec, and stopband edge frequency os of 3000 rad/sec (1) Estimate the order for this filter (2) Estimate the cut-off frequency for this filter. 5. (20 points) Consider the first-order...
Consider an FIR lowpass filter design with the following specifications: Passband Stopband Passband ripple Stopband attenuation Sampling rate Determine the following: a. window method b. length of the FIR filter c. cutoff frequency for the design equation We were unable to transcribe this imageWe were unable to transcribe this image= 1200 4000H = 0.1dB We were unable to transcribe this imageWe were unable to transcribe this image
1. Design a bandpass filter to meet the following specificatoins: lower stopband edge = 0.3π upper stopband edge = 0.6π lower passband edge = 0.4π upper passband edge = 0.5π Rp = 0.5 dB, As = 50 dB Use a sampling frequency of 1000 Hz. You may use MATLAB and the fir1 commmand to implement. It is advisable to check the MathWorks site for help on using these commands. It is advisable to check if the commands use the ripple...
1. Design a low-pass Chebyshev filter with the following specifications: (7pts) • Passband edge frequency of, Wp = 2 rads' Passband ripple of 3dB Cut-off frequency is at mid-point of the transition band • Stopband attenuation of 20dB or greater beyond ws=2.5 rads! • Find the filter transfer function H(S)
(From Mitra M7.5.) (using matlab)Design a digital Chebyshev-I lowpass filter operating at a sampling rate of 80 kHz with a passband edge frequency at 4 kHz, a passband ripple of 0.5 dB, and a minimum stopband attenuation of 45 dB at 20 kHz using the bilinear transformation method. Determine the order of the analog prototype using the command cheb1ord and then design the analog prototype using cheb1ap. Transform the analog filter into a digital one using the bilinear command. Plot...
3. (I0pts) An elliptic analog bandpass filter is to be designed with the following specifications: passband edge: 30 kHz and 50 kHz stopband edge: 25 kHz and 55 kHz peak passband ripple: 0.25dB minimum stopband attenuation: 40dB What's the bandedge of the corresponding elliptic analog low-pass filter? (Note: There are two possible solutions but you only have to provide one) (5pts) What's the filter order of the corresponding elliptic analog low-pass filter? (You can use Matlab to get your answer....
Design lowpass IIR filter with the following specifications: Filter order = 2, Butterworth type Cut-off frequency=800 Hz Sampling rate =8000 Hz Design using the bilinear z-transform design method Print the lowpass IIR filter coefficients and plot the frequency responses using MATLAB. MATLAB>>freqz(bLP,aLP,512,8000); axis([0 4000 –40 1]); Label and print your graph. What is the filter gain at the cut-off frequency 800 Hz? What are the filter gains for the stopband at 2000 Hz and the passband at 50 Hz based...
a. What kind of filter is ? b. What are the passband edges and stopband edges? c. What are the ripples? 5. A continuous time lowpass filter has been designed with a passband edge of 1000 Hz and the beginning of the stopband of 1200 Hz. It has a passband ripple of 0.1, (8, = 0.1). The stopband ripple is 0.01(82 = 0.01). Let h(t) be the impulse response of this filter. Assume that |H(jo)=0 for @l> 40007. Suppose that...
An IIR low-pass filter is to be designed to meet the following specifications: 1. Passband cutoff frequency of 0.22 π with a passband ripple less than 0.01.2. Stopband cutoff frequency of 0.24 π with a stopband attenuation greater than 40 dB.(i) Determine the filter order required to meet these specifications if a digital butterworth filter is designed using the bilinear transformation. (ii) Determine the filter order required to meet these specifications if a digital chebyshev filter is designed using the bilinear transformation.
3.2 Simple Bandpass Filter Design The L-point averaging filter is a lowpass filter. Its passband width is controlled by L, being inversely proportional to L. In fact, you can use the GUI altidemo to view the frequency response for different averagers and measure the passband widths. It is also possible to create a filter whose passband is centered around some frequency other than zero. One simple way to do this is to define the impulse response of an L-point FIR...