Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use the filterdesign GUI to create the impulse response of an FIR LPF with the r

ID: 3856802 • Letter: U

Question

Use the filterdesign GUI to create the impulse response of an FIR LPF with the rectangular window method. Use the following specifications: filter order M = 37, cutoff frequency omega_co = 0.3 pi. The questions below deal with filtering specific input signals and determining the corresponding output signals. (a) When the input x_1 [n] is DC with a DC level of 10, determine the output level y_1 [n]. (b) When the input is the sinusoid x_2 [n] = 10 cos(0.5 pi n) with zero phase, determine the output in the standard form y_2 [n] = A_2 cos(omega n + phi_2). (c) Use MATLAB to verify the outputs in the previous parts. Generate 100 values of the signal s[n] = x_1 [n] + x_2 [n] = 10 u[n] + 10 cos(0.5 pi n) u[n] in a vector sn and filter the signal sn with MATLAB's filter command to obtain snOutput. Plot snOutput for n = 0: 99. For comparison plot y_1 [n] + y_2 [n] from parts (a) and (b) over the same range.

Explanation / Answer

fs = 10000;
t = 0:1/fs:1.5;
x1 = sawtooth(2*pi*50*t);
x2 = square(2*pi*50*t);
subplot(2,1,1)
plot(t,x1)
axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Sawtooth Periodic Wave')
subplot(2,1,2)
plot(t,x2)
axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Square Periodic Wave')

fs = 10000;
t = -1:1/fs:1;
x1 = tripuls(t,20e-3);
x2 = rectpuls(t,20e-3);
subplot(2,1,1)
plot(t,x1)
axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Triangular Aperiodic Pulse')
subplot(2,1,2)
plot(t,x2)
axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Rectangular Aperiodic Pulse')

tc = gauspuls('cutoff',50e3,0.6,[],-40);
t1 = -tc : 1e-6 : tc;
y1 = gauspuls(t1,50e3,0.6);
t2 = linspace(-5,5);
y2 = sinc(t2);
subplot(2,1,1)
plot(t1*1e3,y1)
xlabel('Time (ms)')
ylabel('Amplitude')
title('Gaussian Pulse')
subplot(2,1,2)
plot(t2,y2)
xlabel('Time (sec)')
ylabel('Amplitude')
title('Sinc Function')
t = 0:0.001:2; % 2 secs @ 1kHz sample rate
ylin = chirp(t,0,1,150); % Start @ DC, cross 150Hz at t=1sec
Generate a quadratic chirp:

t = -2:0.001:2; % +/-2 secs @ 1kHz sample rate
yq = chirp(t,100,1,200,'q'); % Start @ 100Hz, cross 200Hz at t=1sec
Compute and display the spectrograms

subplot(2,1,1)
spectrogram(ylin,256,250,256,1E3,'yaxis')
title('Linear Chirp')
subplot(2,1,2)
spectrogram(yq,128,120,128,1E3,'yaxis')
title('Quadratic Chirp')
t = -1:0.001:1; % +/-1 second @ 1kHz sample rate
fo = 100;
f1 = 400; % Start at 100Hz, go up to 400Hz
ycx = chirp(t,fo,1,f1,'q',[],'convex');
Generate a concave quadratic chirp:

t = -1:0.001:1; % +/-1 second @ 1kHz sample rate
fo = 400;
f1 = 100; % Start at 400Hz, go down to 100Hz
ycv = chirp(t,fo,1,f1,'q',[],'concave');
Compute and display the spectrograms.

subplot(2,1,1)
spectrogram(ycx,256,255,128,1000,'yaxis')
title('Convex Chirp')
subplot(2,1,2)
spectrogram(ycv,256,255,128,1000,'yaxis')
title('Concave Chirp')
subplot(2,1,1)
spectrogram(x1,kaiser(256,5),220,512,fs,'yaxis')
title('VCO Triangle')
subplot(2,1,2)
spectrogram(x2,256,255,256,fs,'yaxis')
title('VCO Rectangle')
fs = 100E9; % sample freq
D = [2.5 10 17.5]' * 1e-9; % pulse delay times
t = 0 : 1/fs : 2500/fs; % signal evaluation time
w = 1e-9; % width of each pulse
yp = pulstran(t,D,@rectpuls,w);
T = 0 : 1/50e3 : 10e-3;
D = [0 : 1/1e3 : 10e-3 ; 0.8.^(0:10)]';
Y = pulstran(T,D,@gauspuls,10E3,.5);
subplot(2,1,1)
plot(t*1e9,yp);
axis([0 25 -0.2 1.2])
xlabel('Time (ns)')
ylabel('Amplitude')
title('Rectangular Train')
subplot(2,1,2)
plot(T*1e3,Y)
xlabel('Time (ms)')
ylabel('Amplitude')
title('Gaussian Pulse Train')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote