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

Keywords: MATLAB, DSP, Z-Domain I know this is a low pass filter. If someone cou

ID: 2083720 • Letter: K

Question

Keywords: MATLAB, DSP, Z-Domain

I know this is a low pass filter. If someone could just post the code that would be awesome. Thank you in advance.

I did the code for 1c and 1b already below:

q=0.125;b=[q q q q q q q q]; a=[1 0 0 0 0 0 0 0];figure;zplane(b,a);%1b

[H,w] = freqz(b,a,3000); plot(w/pi,abs(H)); grid on; %1c

1. A discrete-time system has seven poles at z 0 and seven zeros at t j 0 t j t j a) Find the transfer function H(z) and find the constant term bo such that the gain of the filter at zero angle (0 0) is 1, that is, Notice that H H de and H 001e 1 is equivalent to b) Plot the pole-zero diagram. c) Plot the magnitude response IH(e)l. d) Plot the phase response LH(e). e) Find y(n) as a function of x(n), x(n-1), x(n-2), x(n-3), x(n-4), x(n-5), x(n-6), x(n-7). f) Draw the network structure in direct form. g) Plot y(n) for x(n) cos(n21t/20). Use MATLAB. h) Plot y(n) for x(n) cos(n21/10). Use MATLAB. i) Plot y(n) for x(n) cos(n21/5). Use MATLAB. j) What type of filter (LPF, HPF, BPF, BSF) is this system?

Explanation / Answer

q=0.125;b=[q q q q q q q q];
a=[1 0 0 0 0 0 0 0];
zplane(b,a);%1b
[H,w] = freqz(b,a,3000);
%figure;
%plot(w/pi,abs(H));plot(w/pi,angle(H)); grid on; %1c % alternative for phase plot
figure;
freqz(b,a,3000); % c & d % plots mag and phase plot

n=0:100; % input number of samples
x1=cos(n*2*pi/20); % input
y1=filter(b,a,x1); % filter output of H is in b,a

x2=cos(n*2*pi/10);
y2=filter(b,a,x2);

x3=cos(n*2*pi/5);
y3=filter(b,a,x3);

figure;
subplot(311)
plot(n,y1);
subplot(312)
plot(n,y2);
subplot(313)
plot(n,y3);