声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1086|回复: 0

[综合] 请教高手, matlab 除噪,rls

[复制链接]
发表于 2009-5-14 12:36 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

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;
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 07:10 , Processed in 0.058138 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表