Dtsp Assignment
Dtsp Assignment
Sakshi Mhaske
3022167
a)Butterworth using IIV
Code:-
clc;
close
all;
clear
all;
% Sampling frequency
fsamp = 20000;
[n, wn] = buttord(wp/pi, ws/pi, Rp, Rs); % Get filter order and cutoff
(normalized)
% Filter the
signal y =
filter(b, a, x);
Y = fft(y, L);
OUTPUT:-
B)Chebyshev using BLT
clc;
close
all;
clear
all;
% Sampling frequency
fsamp = 20000;
[n, wn] = cheb1ord(wp, ws, Rp, Rs); % Get filter order and cutoff
(normalized) [b, a] = cheby1(n, Rp, wn, 'high'); % Highpass
Chebyshev Type I filter (digital)
% Filter the
signal y =
filter(b, a, x);
Y = fft(y, L);
% Plot the magnitude and phase response of
H(w) figure;