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

This follows by applying the sinusoidal response of (8) to the individual terms

ID: 2291848 • Letter: T

Question

This follows by applying the sinusoidal response of (8) to the individual terms of (10). Thus, the fol lowing computational steps allow one to determine the samples of the output period: compute FFT of one input period: S- fft(s, N) evaluate filter at DFT frequencies: H- [H(e), H(e H(e-) element-wise multiplication: Sout-H. S compute inverse FFT: Sout ifft (Sout, N) (13) where we assumed that all vectors are rows. Problem 4.1 (10 points). Write a MATLAB function that implements the steps in (13), with syntax sout - periodic output (b,a,s) where b, a are the numerator and denominator coefficient vectors of the filter, and s,s_out represent one period of the input and output signals. All the operations inside this function must be vectorized. To help you debug your program, the following answer is given: -3.6.3, He)- 11-053 0.53 b 2, 1, a -, 0, 0, 0.5t 6,10,8 1 +

Explanation / Answer

clc
clear all
close all
s=[3 6 3];
a=[1 0 0 0.5];
b=[2 1];
s_out=periodic_output(b,a,s);
fprintf('The output is: [')
fprintf('%f ',s_out)
fprintf('] ')

function s_out=periodic_output(b,a,s)
N=length(s);
k=0:N-1;
S=fft(s,N);
Fs=1;
f=(k*Fs)./N; %freqeuncy formula for DFT
z=exp(1j*2*pi*f);
H=(b(1)+b(2)*z.^-1)./(a(1)+a(2)+a(3)+a(4)*z.^-3); %Filter
Sout=H.*S;
s_out=ifft(Sout,N);

Output:

The output is:
[6.000000 10.000000 8.000000 ]

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