Question

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

PLEASE ANSWER QUESTION #2

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.

Homework Answers

Answer #1

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:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
MATLAB FIR filter design. The audio file, covering the frequency range of roughly 0 to 3000...
MATLAB FIR filter design. The audio file, covering the frequency range of roughly 0 to 3000 Hz, is very badly corrupted with high?level noise. Your problem is to design a digital filter that will sufficiently attenuate the noise so that the audio speech is intelligible. (sorry but chegg doesn't allow me to attach the wav file) Here is the design template: clear, clc % clear all variables %% Read in the noisy audio signal from the file 'CapnJ.wav' using audioread...
Question : Design the low and high pass filter for the signal, x(t) = 10 sin...
Question : Design the low and high pass filter for the signal, x(t) = 10 sin (10 t) + 1 sin (1000 t) by MATLAB Is below answer right? at ?High pass , 5row shouldn't this change from sin(100*t) ? sin(1000*t) x = 10*sin(10*t) + 1*sin(100*t); ?   x = 10*sin(10*t) + 1*sin(1000*t); ??? ..................................................................................................................................................... ?Low pass clc; rng default Fs=2000; t=linspace(0,1,Fs); x=10*sin(10*t)+sin(1000*t)%given signal n=0.5*randn(size(t));%noise x1=x+n; fc=150; Wn=(2/Fs)*fc; b=fir1(20,Wn,'low',kaiser(21,3)); %fvtool(b,1,’Fs’,Fs) y=filter(b,1,x1); plot(t,x1,t,y) xlim([0 0.1]) xlabel('Time (s) ') ylabel('Amplitude') legend('Original Signal','Filtered Data')...
The following question has to be implemented using matlab programming and fdatool a. Extract samples of...
The following question has to be implemented using matlab programming and fdatool a. Extract samples of a music file of a suitable format (sample.mp3, made available on the moodle) providing a duration of 2 seconds playtime, add a colored noise centered around 4.5kHz to the extracted samples so that the SNR is -15 dB. b. Realize an FIR (hamming) and IIR lowpass filter of order 10 having a cutoff frequency of 3kHz respectively. (Obtain the sampling frequency value from the...
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete...
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi = phi+2*%pi*f(n+1); end sound(x,Fs,Nbits); sleep(10000); //allows full sound to play Add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the...
Problem 3 you can use Matlab and also i give u the Problem 1 code its...
Problem 3 you can use Matlab and also i give u the Problem 1 code its on Matlab Using the same initial code fragment as in Problem 1, add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the impulse response of an IIR bandpass filter with band edge frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth prototype. Name your program p3.sce this is the Problem 1 code and the solutin clear; clc;...
Problem 1 ...... you can use Matlan i got one so all what i need is...
Problem 1 ...... you can use Matlan i got one so all what i need is 2, 3 and 4 one of them or all of them .. thanks The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi...
1. Write a MATLAB function to determine the discrete-time Fourier Transform (H(?)) of the following sequence....
1. Write a MATLAB function to determine the discrete-time Fourier Transform (H(?)) of the following sequence. Plot its magnitude and phase. You can use the dtft command and use the abs, angle and plot commands to plot the results. x(n) = {4, 3, 2, 1, 2, 3, 4}. 2. Analytically determine H(z) and plot its magnitude and phase for the following system using freqz. y(n) = 2x(n) + x(n ? 1) ? 0.25y(n ? 1) + 0.25y(n ? 2). 3....
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...