I need a Matlab code for stop band filter with explanations step by step please
ID: 2291632 • Letter: I
Question
I need a Matlab code for stop band filter with explanations step by step please
DSP assignment Task 1 In the student public directory P:VintonDSP you will find a file called "assignment task1" This file contains a recording of a spoken dialogue which has been corrupted with a tone Download the file Use Matlab to determine the frequency of the corrupting tone . Create a filter to remove the tone Present your results as:- 1) A copy of all matlab files used, 2) A copy of the filtered wav file 3) Suitable plots showing the performance of your filter 4) A description of the design activity including any calculations or design decisions made.Explanation / Answer
Butterworth Digital Band Stop Filter Using Function
clc;
clear all;
rp = input('Enter the passband ripple = ');
rs = input('Enter the stopband ripple = ');
wp = input('Enter the passband frequency = ');
ws = input('Enter the stopband frequency = ');
fs = input('Enter the sampling frequency = ');
w1 = 2*wp/fs;
w2 = 2*ws/fs;
[n] = buttord(w1,w2,rp,rs);
wn = [w1 w2];
[b,a] = butter(n,wn,'stop');
w = 0:0.01:pi;
[h,om] = freqz(b,a,w);
m = 20*log10(abs(h));
an = angle(h);
subplot(2,1,1);
plot(om/pi,m);
subplot(2,1,1);
plot(om/pi,m);
title('Magnitude Response');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
subplot(2,1,2);
plot(om/pi,an);
title('Phase Response');
xlabel('Normalised Frequency ---->');
ylabel('Phase in radians ---->');
grid on;
Chebyshev Type 2 Digital Band Stop Filter Using Function
clc;
clear all;
rp = input('Enter the passband ripple = ');
rs = input('Enter the stopband ripple = ');
wp = input('Enter the passband frequency = ');
ws = input('Enter the stopband frequency = ');
fs = input('Enter the sampling frequency = ');
w1 = 2*wp/fs;
w2 = 2*ws/fs;
[n] = cheb2ord(w1,w2,rp,rs);
wn = [w1 w2];
[b,a] = cheby2(n,rs,wn,'stop');
w = 0:0.1/pi:pi;
[h,om] = freqz(b,a,w);
m = 20*log10(abs(h));
an = angle(h);
subplot(2,1,1);
plot(om/pi,m);
subplot(2,1,1);
plot(om/pi,m);
title('Magnitude Response');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
subplot(2,1,2);
plot(om/pi,an);
title('Phase Response');
xlabel('Normalised Frequency ---->');
ylabel('Phase in radians ---->');
grid on;
EXPLANATION WAS ITSELF IN THE CODE.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.