Calculate the FIR LPF with a cutoff frequency of 1 kHz using MATLAB (sampling frequency 20 kHz, filter order 10) and output the frequency response curve
Calculate the FIR band pass filter passing only 1kHz-9kHz using MATLAB (sampling frequency 20kHz, filter degree 20) and output the frequency response curve.
clc
clear all
close all
fs=20e3;
N=20;
Fl=1e3;
Fh=9e3;
%------------Band Pass Filter
Design--------------------------
[A,B,C,D]=butter(N,[Fl Fh]/(fs/2),'bandpass');
sos=ss2sos(A,B,C,D);
fvtool(sos)
title('Magnitude Response of Bandpass filter')
%---------------Low Pass Filter
Design-----------------------
N1=10;
F1=1e3;
fs=20e3;
[K,L ,M, N2]=butter(N1,Fl/(fs/2),'low');
sos=ss2sos(K,L,M,N2);
fvtool(sos)
title('Magnitude Response of LowPass Filter')
Get Answers For Free
Most questions answered within 1 hours.