【实验要求是在音乐中添加白噪声然后用FIR滤波……这里没有问题问题出在plot(f,abs(y,(1:512)));的画图……[x,fs,bits]=wavread('C:UserszhengkDesktopEVA.wav');snr=20;x2=awgn(x,snr,'measured');wavwrite(x2,32000,16,'C:】
实验要求是在音乐中添加白噪声然后用FIR滤波……这里没有问题问题出在plot(f,abs(y,(1:512)));的画图……
[x,fs,bits]=wavread('C:UserszhengkDesktopEVA.wav');
snr=20;
x2=awgn(x,snr,'measured');
wavwrite(x2,32000,16,'C:UserszhengkDesktopEVA2.wav');
t=0:1/fs:(size(x2)-1)/fs;
wp=8000*pi/32000;
ws=9000*pi/32000;
wdelta=ws-wp;
N=ceil(11*pi/wdelta);
wn=(wp+ws)/2;
a=fir1(N,wn/pi,blackman(N+1));
figure(1)
freqz(a,1,512)
f2=filter(a,1,x2);
figure(2)
subplot(2,1,1)
plot(t,x2)
title('滤波前(时域)');
subplot(2,1,2)
plot(t,f2)
title('滤波后(时域)');
y=fft(x2,1024);
f0=fft(f2,1024);
f=fs*(0:511)/1024;
figure(3)
subplot(2,1,1)
plot(f,abs(y,(1:512)));
title('滤波前(频域)')
subplot(2,1,2)
plot(f,abs(f0,512));
title('滤波后(频域)')
总报错显示“toomanyinputarguments”是为何?