马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
如下程序是参照matlab官网给的代码改编的,我想用rls滤波器对声音文件进行处理,可是提示
Error using ==> plus
Matrix dimensions must agree.
我正在做毕业设计,希望各位高手指教
[x,Fs1]=wavread('signal.wav'); % Input to the filter
b = fir1(31,0.5); % FIR system to be identified
[n,Fs2]=wavread('noise.wav'); % Observation noise signal
d = filter(b,1,x)+n; % Desired signal
P0 = 10*eye(32); % Initial sqrt correlation matrix inverse
lam = 0.99; % RLS forgetting factor
h = adaptfilt.rls(32,lam,P0);
[y,e] = filter(h,x,d);
subplot(2,1,1); plot(1:500,[d;y;e]);
title('System Identification of an FIR filter');
legend('Desired','Output','Error');
xlabel('time index'); ylabel('signal value');
subplot(2,1,2); stem([b.',h.Coefficients.']);
legend('Actual','Estimated');
xlabel('coefficient #'); ylabel('coefficient value'); grid on; |