声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1077|回复: 3

[综合讨论] 请教高手, 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;
回复
分享到:

使用道具 举报

发表于 2009-5-14 21:08 | 显示全部楼层
Ref 5F
常见的程序出错问题整理 (eight)
http://forum.vibunion.com/forum/thread-46001-1-1.html

评分

1

查看全部评分

 楼主| 发表于 2009-5-15 12:23 | 显示全部楼层

回复 沙发 ChaChing 的帖子

那个已经研究过了,还是解决不了问题,寻求高手解答问题啊,我想要的就是这个算法,解决除噪实例
发表于 2009-5-15 16:02 | 显示全部楼层

回复 板凳 LSYJY 的帖子

Error using ==> plus
Matrix dimensions must agree.

显然是两个长度不一样,不能加

评分

1

查看全部评分

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

本版积分规则

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

GMT+8, 2024-5-26 19:37 , Processed in 0.077336 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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