フィルターのクリア

Fitting one line to another

2 ビュー (過去 30 日間)
Glenn
Glenn 2012 年 8 月 23 日
I am attempting to do some basic noise cancelation by using a reference signal. I know there are more elegant solutions but this should work:
t = linspace(-2*pi,2*pi,200);
signal = sin(t)'; %original signal
sigma = 0.07; %noise standard deviation
noise = sigma*randn(size(signal)); %noise
rover = signal + noise;
base = noise;
hold off;
figure(1)
plot(rover,'color','red');
hold on;
plot(base,'color','blue');
E = [ones(size(base)) base ];
ls_solution = lsqr(E,rover ,1e-6,20)
fit = E*ls_solution;
solution = rover -fit;
plot(fit,'color','green');
plot(solution,'color','cyan');
Here is the output: lsqr converged at iteration 2 to a solution with relative residual 0.99.
ls_solution =
-0.0030
1.5903
While it seems to work conceptually the convergence is so bad that it doens't remove much of the noise. Why does this only go to iteration 2? The tolerance is set to 1-e6 and the max iterations are 20.

回答 (0 件)

カテゴリ

Help Center および File ExchangePhysics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by