close all, clear all, clc load c3k2 A = 1; N = 8192; Fs = 2048; Fs2 = Fs/2; soundsc(y, Fs) Y = fft(y, N); N2 = N/2; m = 1:N2; f = linspace(0, Fs2, N2); magY = abs(Y(m)); figure(1) subplot(2,1,1), plot(f, magY) F = [340 345 355 360]; Am = [1 0 1]; DEV = [1 1 1]*0.01; [Nf,Wn,BTA,FILTYPE] = kaiserord(F,Am,DEV,Fs); B = fir1(Nf, Wn, FILTYPE, kaiser(Nf + 1, BTA)); yf = filter(B, A, y); YF = fft(yf, N); magYF = abs(YF(m)); subplot(2,1,2), plot(f, magYF) soundsc(yf, Fs) figure(2) [H, w] = freqz(B, A); figure(2) plot(w/pi*Fs2, abs(H))