关于Maltab仿真 有源噪声控制的编程 求大神指导!!!!!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于Maltab仿真 有源噪声控制的编程 求大神指导!!!!!相关的知识,希望对你有一定的参考价值。

% +-----------+ +
% x(k) ---+--->| P(z) |--yp(k)----------------> sum --+---> e(k)
% | +-----------+ ^- |
% | | |
% | \ ys(k) |
% | +-----------+ +-----------+ | |
% +--->| C(z) w |--yw(k)-->| S(z) h |---+ |
% | +-----------+ +-----------+ |
% | \ |
% | \-------------------------\ |
% | \ |
% | +-----------+ +-----------+ |
% +--->| Sh(z) c |--xs(k)-->| LMS |<-------------------+
% +-----------+ +-----------+

clear
T=1000;
Pw=[0.01 0.25 0.5 1 0.5 0.25 0.01];
Sw=Pw*0.25;
x_iden=randn(1,T);
y_iden=filter(Sw, 1, x_iden);
Shx=zeros(1,16);
Shw=zeros(1,16);
e_iden=zeros(1,T);
mu=0.1;
for k=1:T,
Shx=[x_iden(k) Shx(1:15)];
Shy=sum(Shx.*Shw);
e_iden(k)=y_iden(k)-Shy;
Shw=Shw+mu*e_iden(k)*Shx;
end
% Lets check the result
subplot(2,1,1)
plot([1:T], e_iden)
ylabel('Amplitude');
xlabel('Discrete time k');
legend('Identification error');
subplot(2,1,2)
stem(Sw)
hold on
stem(Shw, 'r*')
ylabel('Amplitude');
xlabel('Numbering of filter tap');
legend('Coefficients of S(z)', 'Coefficients of Sh(z)')
X=randn(1,T);

Yd=filter(Pw, 1, X);

% Initiate the system,
Cx=zeros(1,16);
Cw=zeros(1,16);
Sx=zeros(size(Sw));
e_cont=zeros(1,T);
Xhx=zeros(1,16);
mu=0.1;
for k=1:T,
Cx=[X(k) Cx(1:15)];
Cy=sum(Cx.*Cw);
Sx=[Cy Sx(1:length(Sx)-1)];
e_cont(k)=Yd(k)-sum(Sx.*Sw);
Shx=[X(k) Shx(1:15)];
Xhx=[sum(Shx.*Shw) Xhx(1:15)];
Cw=Cw+mu*e_cont(k)*Xhx;
end
figure
subplot(2,1,1)
plot([1:T], e_cont)
ylabel('Amplitude');
xlabel('Discrete time k');
legend('Noise residue')
subplot(2,1,2)
plot([1:T], Yd)
hold on
plot([1:T], Yd-e_cont, 'r:')
ylabel('Amplitude');
xlabel('Discrete time k');
legend('Noise signal', 'Control signal')

求把代码中的声源白噪声改成正弦波,如有高手愿意解答 可以加q:270709864 各种虚心求教!!!!!!

参考技术A %x_iden=randn(1,T);
len=T*0.01-0.01;
i=0:0.01:len;
x_iden=sin(i);
...
%X=randn(1,T);
X=sin(i);

T值改的大一点,大概20000左右追问

能问点其他关于Matlab的问题么。。方便留个qq么?

急!!!求大神指教 为啥我的VC6停在这个页面不会动了 打不开了 我刚才只是下载了一个西红柿插件。。。

估计是组件或类库的版本或语言问题影响了程序,你可以尝试重新安装一次VC6 参考技术A 实在不行重装一下吧!

以上是关于关于Maltab仿真 有源噪声控制的编程 求大神指导!!!!!的主要内容,如果未能解决你的问题,请参考以下文章

求各路大神指点关于chrome浏览器控制台的问题

求大神帮我答题,期末考试ing,关于php的

Multisim仿真二阶有源高通滤波电路仿真

java编程,关于身份证验证问题。求大神指点

Multisim仿真有源低通滤波电路仿真

51单片机 驱动有源/无源蜂鸣器+Proteus仿真