【问题标题】:adaptive linear combiner with the use of steepest descent algorithm使用最速下降算法的自适应线性组合器
【发布时间】:2013-02-22 06:26:47
【问题描述】:

我已经为自适应线性组合器(最速下降)编写了以下代码,并在输入端添加了随机信号。:M=16;

M=16;
k=[1:200];
R=[0.5 0.46;0.46 0.5];
P=[0;-0.38];
wstar=[-5 30];
s=sin((2*pi*k)/M);  %input signal
d=cos((2*pi*k)/M);  %desired signal
**x=s+randn(1,M);** %input signal + noise
mu=1;
for i=1:M           %steepest descent algorithm
    w(1)=wstar;
    g(i)=2*R*w(i)-2*P;
    w(i+1)=w(i)+mu*(-g(i));
end
for i=1:M
    y(i) = sum(w(i)*x(i),w(i+1)*x(i+1)); %output signal
    e(i) = d(i)-y(i);  %error signal
end
subplot(221),plot(k,d),ylabel('Desired Signal');
subplot(222),plot(k,s),ylabel('Input Signal+Noise');
subplot(223),plot(k,e),ylabel('Error');
subplot(224),plot(k,y),ylabel('Adaptive Desired output');

由于某种原因,它说 x=s+randn(1,N) 处有错误。有人可以让我知道我哪里出错了吗?

【问题讨论】:

  • 错误信息是什么?
  • s 是一个 1x200 矩阵,而 randn(1,M) 是 1x16。你不能把它们加起来
  • randn(1,M) 你期望这个输出是什么?它产生了 16 个正常分布的随机变量,均值为 0,stddev 为 1。如果您不想要标准正态噪声,请尝试:x = s + (mean + stddev.*randn(200,1));

标签: matlab


【解决方案1】:

s 是一个长度为 200 的向量(因为 k = 1:200),而您正在向它添加 randn(1, M),它是一个长度为 M = 16 的向量。这些应该怎么加起来?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-13
    • 2013-02-07
    • 2017-02-14
    • 1970-01-01
    相关资源
    最近更新 更多