Question

PLEASE ANSWER QUESTION #2 Design an FIR band-pass filter with cutoff frequencies of π/ 4 and...

Design an FIR band-pass filter with cutoff frequencies of π/ 4 and π/ 6 . The filter’s impulse response should have 81 samples (i.e. N = 81). Use a Blackman filter window.

(a) Plot the filter’s impulse response

(b) Plot the magnitude of the filter’s frequency response, in dB. (i.e. 20 log(|H(e jω)|))

(c) Print out the MATLAB code used in the filter design

2. Use the filter designed in #1 to filter a random input signal of 128 samples. (i.e. use x = randn([1 128]) to generate the random signal)

(a) Plot the input and output signals, x[n], and y[n].

(b) Plot the magnitude of the FFT’s of x[n] and y[n], in dB. (i.e. 20 log(|X(e jω)|)).

(c) Print out the MATLAB code used to generate these items.

NOTE: Assuming filter designing part is done and we have filter coefficients [num,den] saved in the Matlab Workspace.

Code:

L=128;
Fs=1;
Ts=1/Fs;
t=Ts:Ts:L*Ts;
x=randn(1,L);
subplot(2,1,1)
plot(t,x)
title('Input')
xlim([0 Ts*L])

y=filter(num,den,x);
subplot(2,1,2)
plot(t,y)
title('Output')
xlim([0 Ts*L])

%% Frequency response:

dF = Fs/L;
f = -Fs/2:dF:Fs/2-dF;

X=fftshift(fft(x));
Y=fftshift(fft(y));

figure();
subplot(2,1,1)
plot(f,20*log10(abs(X)/L));
title('Magnitude Response of Input')
subplot(2,1,2)
plot(f,20*log10(abs(Y)/L));
title('Magnitude Response of Output')

Output:

Earn Coins

Coins can be redeemed for fabulous gifts.

Need Online Homework Help?

Most questions answered within 1 hours.

Active Questions
• Are your finances, buying habits, medical records, and phone calls really private? A real concern for...
• In triangle ABC, angle A measures 33 degrees. If angle C measures 38 degrees and BC...
• Psychoactive medications (drugs that impact our thoughts, emotions, and behavior) usually work as either agonists or...
• TATA-Pribnow box: Motifs TATAAA or TATAAT of six nucleotides, known as TATA boxes, are an essential...
• Bond valuation​) You own a 10​-year, ​\$1000 par value bond paying 8 percent interest annually. The...
• what does an RNA Induced Silencing Complex do: - dephosphorylate the G protein - Bind to...