I have a wav file that I an trying to remove noise from. I used fft and plotted it across frequency. I built a bandstop filter but all it does is lower the noise of the beep. Can someone help me with my filter.
clc;close all;clear;[y,Fs]= audioread('beep_removal.wav');%sound(y,Fs)
info = audioinfo('beep_removal.wav')t = 0:seconds(1/Fs):seconds(info.Duration);t = t(1:end-1);subplot(2,2,1); plot(t,y)title('Original Audio with Beep')xlabel('Time')ylabel('Audio Signal x(t)') L=length(y);NEFT = 2^nextpow2(L);Y=abs(fft(y,NEFT));freq = Fs/2*linspace(0,1,NEFT/2+1); subplot(2,2,2); plot(freq, Y(1:length(freq)))title('fft')xlabel('Hz')ylabel('Magnitude')o = 5;wn = [2100 2400]*2/Fs;[b, a] = butter(o,wn,'stop');figure; freqz(b,a,Fs);[h,w] = freqz(b,a,Fs);subplot(2,2,3); plot(w,20*log10(abs(h)));z_filt = filter(b,a,y);subplot (2,2,4); plot(t,z_filt);title('Audio with filter')xlabel('Time')ylabel('Audio Signal z(t)')%sound(z_filt,Fs)
Best Answer