我必须使用matlab从wav音乐文件中删除噪音。
我知道我必须使用ellipord
和ellip
函数。首先,我阅读了wav文件:[x,Fs]=wavread('file.wav');
然后我做了一个谱图:
spectrogram(x,512,400,512,Fs,'yaxis');
现在,我无法理解一些事情:
答案 0 :(得分:1)
你的噪音看起来像15000赫兹的高频嘶嘶声。我认为消除这种噪音的最佳方法是带阻滤波器,虽然很难说不听,也许低通滤波器可以更好地满足您的要求。我也尝试其他过滤器类型
Fs = 44100;
%what frequencies do you want to pass
wp = [12000 18000] / (Fs/2);
%what frequencies you don't want to pass
ws = [14000 16000] / (Fs/2);
%ellipsoid filter characteristics must be smooth
%so you have to select how many decibels
%you allow to lose at passband (i.e. 12000 and 18000 hz)
rp = 3;
%stopband (minus decibels at 14000 and 16000 hz)
rs = 60;
[n,Wp] = ellipord(wp,ws,rp,rs)
[b,a] = ellip(n,rp,rs,wp,'stop');
freqz(b,a,Fs,Fs);