Question

In: Electrical Engineering

Design a linear phase, minimum-length, band-pass FIR digital filter in MATLAB to meet the specifications listed...

Design a linear phase, minimum-length, band-pass FIR digital filter in MATLAB to meet the specifications listed below. Use Rectangular Windowing (MATLAB function: fir1)

pass-band frequencies: f_p1 = 0.35, f_p2 = 0.65

stop-band frequencies: f_s1 = 0.10, f_s2 = 0.80

pass-band tolerance: d_p <= 0.1

stop-band tolerance: d_s <= 0.1

I am attempting to learn more about MATLAB and I am having trouble with specific filter design and it would be helpful to have an example.

Solutions

Expert Solution

Script:

clc;close all;clear all;

%Pass band and stop band edge frequencies

ws1=0.1;wp1=0.35;wp2=0.65;ws2=0.8;

tranwidth = min((wp1-ws1),(ws2-wp2));

%Cut off frequencies

wc1=(wp1+ws1)/2;

wc2=(wp2+ws2)/2;

wc=[wc1 wc2];

%For rectangular window , main lobe width is 4pi/N

N=round(4*pi/tranwidth);

M=N+1;n=0:1:M-1;

%Impulse response

hd=fir1(M-1,wc,'bandpass');

wR=rectwin(M)';

h=hd.*wR;

%Frequency response

w=0:0.01*pi:pi;

[H,w]=freqz(h,[1],w);

figure;

subplot(221)

stem(n,h)

title('Impulse response h(n)')

xlabel('n');grid;

ylabel('h(n)')

subplot(222)

plot(w/pi,abs(H),'b')

title('Magnitude response |H(w)|')

xlabel('w/pi');grid;

ylabel('|H(exp(jw)|')

subplot(223)

plot(w/pi,20*log10(abs(H)),'r')

title('Magnitude response in db ')

xlabel('w/pi');grid;

ylabel('|H(exp(jw)| in db')

subplot(224)

plot(w/pi,angle(H),'b')

title('Phase response ')

xlabel('w/pi');grid;

ylabel('<H(exp(jw)>')


Related Solutions

Design a LP FIR filter to meet the following specifications using the window method. Use a...
Design a LP FIR filter to meet the following specifications using the window method. Use a Blackman window. Fs = 25 kHz Fc = 5.0 kHz (3 dB down) Attenuation = 80 dB at 7 kHz Give all the relevant plots (impulse, frequency responses) and the performance of the final filter. Compare this filter to one designed using the optimal method .
Design a LP FIR filter to meet the following specifications using the window method. Use a...
Design a LP FIR filter to meet the following specifications using the window method. Use a Blackman window. Fs = 25 kHz Fc = 5.0 kHz (3 dB down) Attenuation = 80 dB at 7 kHz Give all the relevant plots (impulse, frequency responses) and the performance of the final filter. Compare this filter to one designed using the optimal method. (Please use MATLAB to give all the answers)
Write a report 3-4 pages in DSP Digital FIR filter design Analysis {Low Pass Filter(LPF) ,High...
Write a report 3-4 pages in DSP Digital FIR filter design Analysis {Low Pass Filter(LPF) ,High Pass Filter(HPF), Band Pass Filter (BPF), Band Stop Filter (BSF)} Design 1-way of design and system pools evaluation
2. Design a digital lowpass filter to meet the following specifications: passband edge = 0:45π stopband...
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 butteworth and butter commands to implement. b. Design Chebyshev Type 1 filter ( use the equivalent commands to above ) c. Design an Elliptic filter ( use the equivalent commands to part a ). d. List the order of each filter and find the...
Matlab Design a FIR filter directly using fir1 function in matlab with parameter M = 50....
Matlab Design a FIR filter directly using fir1 function in matlab with parameter M = 50. Design FIR filters with different M = 5, 10, 50, 100, 500 and plot their frequency responses H(e j?) on the same figure.
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only...
How to design FIR lowpass filter using matlab. Note : Do not write matlab code. Only explain the steps of designing filter
Design a wide band pass filter with fL = 500 Hz, fH = 2kHz and a...
Design a wide band pass filter with fL = 500 Hz, fH = 2kHz and a pass band gain of 10.
Design a comb filter in MATLAB that meets the following specifications: it eliminates 5 harmonics of...
Design a comb filter in MATLAB that meets the following specifications: it eliminates 5 harmonics of 100Hz it eliminates dc (zero frequency) |h(t)| <= 0.001 for t> 0.5
Obtain the transfer function of a low pass digital filter meeting the following specifications: Passband 0...
Obtain the transfer function of a low pass digital filter meeting the following specifications: Passband 0 − 60 Hz; Stopband > 85 Hz; Stopband attenuation > 15 dB Assume sampling frequency of 256 Hz and having 3rd order Butterworth Characteristics.
Part 5 The frequency response of RLC circuits : Design a passive filter: Band Pass, ISM...
Part 5 The frequency response of RLC circuits : Design a passive filter: Band Pass, ISM Band 433.050 MHz to 434.790 MHz . Prepare a report to describe your design. Your results should include the following : i. Simulation of the designed filters by using any simulation software. ii. Attach a 1 kΩ resistor as a load to the initial design of your filter. Explain how the transfer function change. Does the type of filter change? Does the cut-off frequency...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT