6. MATLAB problem:
A filter has the following specifications:
Pass band edge = 0.3π.
Stop band edge = 0.5π. 20log10(?????????=?????) = - 40 dB.
Design this filter using various IIR and FIR methods using MATLAB. Make a "brief" statement comparing the designs.
FIR design
clc;close all;clear all;
wp=0.3*pi
ws=0.5*pi
wc=(wp+ws)/2
%using Hanning window
N=round(8*pi/(ws-wp));
M=N+1;
n=0:1:M-1;
%For Lpf, the desired impulse response is
alpha=(M-1)/2;
hd=(sin(wc*(n-alpha)))./(pi*(n-alpha))
hd(alpha+1)=wc/pi;
wh=hanning(M)';
h=hd.*wh;
%Magnitude response
w=0:0.01*pi:pi
[H,w]=freqz(h,[1],w)
figure;
subplot(221)
plot(w/pi,20*log10(abs(H)),'r')
title('Magnitude response |H(w)| -FiR Hanning window')
xlabel('w/pi')
ylabel('|H(exp(jw)|');grid;
subplot(222)
plot(w/pi,angle(H),'g')
title('phase response |H(w)|')
xlabel('w/pi')
ylabel('|H(exp(jw)|')
%Hamming window
wh=hamming(M)'
h=hd.*wh;
[H,w]=freqz(h,[1],w)
subplot(223)
plot(w/pi,20*log10(abs(H)),'m')
title('Magnitude response |H(w)| -FiR Hamming window')
xlabel('w/pi')
ylabel('|H(exp(jw)|');grid;
subplot(224)
plot(w/pi,angle(H),'g')
title('Phase response |H(w)|')
xlabel('w/pi')
ylabel('|H(exp(jw)|')
Observation:
For the same order M=41, the hamming window provides better attenuation than hanning window.
Both provides the same amount of transition width.
_____________________________________________________________________________
IIR design:
clc;
close all;
clear all;
%Specifications
Rs=40
wp=0.3
ws=0.5
Rp=0.5%assumption
%Butterworth filter
[N,wc]=buttord(wp,ws,Rp,Rs)
[b,a]=butter(N,wc)
figure;
freqz(b,a)
%chebyshev Filter 1
[N,wp] = cheb1ord(wp,ws,Rp,Rs)
[b,a]=cheby1(N,Rp,wp)
figure;
freqz(b,a)
%Elliptic Filter
[N,wp] = ellipord(wp,ws,Rp,Rs)
[b,a] = ellip(N,Rp,Rs,wp)
figure;
freqz(b,a)
Butterworth filter:
Chebyshev 1:
elliptic:
6. MATLAB problem: A filter has the following specifications: Pass band edge = 0.3π. Stop band...
Using the windowing functions discussed in class, design a low-pass FIR filter with a cutoff frequency of 2 kHz, a minimum stop band attenuation of 40 dB, and a transition width of 200Hz. The sampling frequency is 10kHz. 1. Using the windowing functions discussed in class, design a low-pass FIR filter with a cutoff frequency of 2 kHz, a minimum stop band attenuation of 40 dB, and a transition width of 200 Hz. The sampling frequency is 10 kHz 2....
Design a high pass FIR filter to meet the following specifications. Provide all equations needed to produce the filter's impulse response. Pass band: 14.66 - 22 kHz Stop band rejection: min 40 dB Pass band ripple: max. 5% Sampling frquency: 48 kHz Use either a Hamming, Hann or Kaiser window. Derive the first three filter coefficients.
just do 4 , 3 is solved 3. Use a Bilinear Transform to design a Butterworth low-pass filter which satisfies the filter specifications: Pass band: -1Ss0 for 0sf s0.2 Stop band: (e/40 for 0.35sf s0.s Transition Band: 0.2<f<0.35 Sampling Frequency: 10 kHz a. (3) Determine the stop-band and pass-band frequencies, Fstop and Fpas, in kHz. b. (3) Calculate the fater order, n, which is necessary to obtain the desired filter specifications. (3) Calculate the corner frequency, Fe, if you want...
Using the windowing function discussed in class, design a band pass FIR filter centered at 20 MHz with bandwidth 30MHz.. 3. Using the windowing functions discussed in class, design a band-pass FIR filter centered at 20 MHz with a bandwidth 30 MHz (), a minimum stop band attenuation of 30 dB, and a transition width of 1 MHz. The sampling frequency is 80 MHz, 3. Using the windowing functions discussed in class, design a band-pass FIR filter centered at 20...
MUST BE IN MATLAB Design a low pass filter for this signal. Set the pass band frequency to 4.9 GHz and the stop band frequency to 5.6 GHz. Allow for 1 dB of attenuation in the pass band and require at least 20 dB of attenuation in the stop band. a. First design a Butterworth filter. Use the command buttord() to determine the order and the normalizing frequency for the filter. Use [Num,Den]=butter() to determine the numerator and denominator coefficients...
Design a band-stop filter to meet the following specifications: Maximally flat passband in 0 ≤f ≤10 kHz and 15 kHz sf <0 Passband gain equal to 0dB; αmax = 1 dB, and Stopband in 12 kHz ≤f≤12.4 kHz and αmin = 40 dB
Design a low-pass filter (LPF) has pass-band frequency fP = 100 kHz, maximum attenuation in passband Amax = 2 dB, stop-band frequency fS = 120 kHz, minimum attenuation in stop-band Amin = 60 dB. a/ Calculate the minimum order N for Chebyshev filter and the corresponding minimum stop-band attenuation? b/ Calculate the minimum order N of low-pass B
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.
Write down whether the following is true or false: (a) A “Band-Pass” filter passes all frequencies within it’s pass-band with equal amplitude and totally blocks all frequencies outside of the pass band?. (b)An FIR filter has an “All Zeros” transfer function in the z-domain. (c)The transient response of an IIR filter continues forever. (d) An IIR filter has both “Feed Forward” and Feedback paths in its signal flow diagram.
2. Design a low pass filter to meet the following specifications: Pass-band is from 0 to 1kHz Attenuation is -12dB (with respect to the pass-band) at 2kHz Pass-band gain is +6dB -All resistors are either 5kΩ or 10kΩ 2. Design a low pass filter to meet the following specifications: Pass-band is from 0 to 1kHz Attenuation is -12dB (with respect to the pass-band) at 2kHz Pass-band gain is +6dB -All resistors are either 5kΩ or 10kΩ