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

Consider analog signal x(t) = (-2cos(5t) + cos(10/) + 4 sin(20 t))u(t) The magni

ID: 2083714 • Letter: C

Question

Consider analog signal x(t) = (-2cos(5t) + cos(10/) + 4 sin(20 t))u(t) The magnitude specifications for the low-pass Butterworth filter are alpha_max = 0.1 dB, Ohm_p = 5 rad/s alpha_min = 15dB, Ohm_ = 10 rad/s and a dc loss of 0 dB. Once this filter is designed, we would like the Chebyshev filter to have the same halt-power frequency. In order to obtain this, we need to change the Ohm_p specification for the Chebyshev filter. To do that we use the formulas for the half-power frequency of this type of filter to find the new value for Ohm_p Plot pole-zero and |H(j Ohm)| of Butterworth and Chebyshev low-pass filters Plot x(t) and output signal y(t) after Butterworth and Chebyshev low-pass filters

Explanation / Answer

MATLAB CODE FOR FREQUENCY RESPONSE OF BUTTERWORTH FILTER

clc;

clear all;

close all;

Ap=0.1;% passband ripple in db

As=15;% stopband attenuation in db

Wp=5;% pass band edge frequency in rad

Ws=10;% stop band edge frequency in rad

Fs=(20/pi);% sampling frequency in Hz

Wp=2*Fs*tan(Wp/2);

Ws=2*Fs*tan(Ws/2);

[N,W]=buttord(Wp,Ws,Ap,As,'s');

[num,den]=butter(N,Ap,W,'low','s');

[B,A]=bilinear(num,den,Fs);

w=0:0.01:pi;

[h,ph]=freqz(B,A,w);

m=20*log(abs(h));

an=angle(h);

subplot(211);

plot(ph/pi,m);

grid;

xlabel('Frequency in Hz');

ylabel('Gain in db');

title('Frequency response of the butterworth filter');

subplot(212);

plot(ph/pi,an);

grid;

ylabel('Phase in rad');

xlabel('Frequency in Hz');

MATLAB CODE FOR FREQUENCY RESPONSE OF CHEBYCHEV LOW PASS FILTER

clc;
clear all;
close all;

Ap=input('Enter the passband ripple in db: ');
As=input('Enter the stopband attenuation in db: ');

Wp=input('Enter the pass band edge frequency in rad: ');
Ws=input('Enter the stop band edge frequency in rad: ');
Fs=input('Enter sampling frequency in Hz: ');

Wp=Wp*Fs;
Ws=Ws*Fs;
[N,W]=cheb1ord(Wp,Ws,Ap,As,'s');
[num,den]=cheby1(N,Ap,W,'low','s');
[B,A]=impinvar(num,den,Fs);

w=0:0.01:pi;
[h,ph]=freqz(B,A,w);
m=20*log(abs(h));
an=angle(h);
subplot(211);
plot(ph/pi,m);
grid;
xlabel('Frequency in Hz');
ylabel('Gain in db');
title('Frequency response of the Chebyshev filter');
subplot(212);
plot(ph/pi,an);
grid;
ylabel('Phase in rad');
xlabel('Frequency in Hz');