3rd or 4th order Polynomial Fitting
古いコメントを表示
How can I solve Polynomial Fitting problem? [Input>polynomial Fitting>LMS(noise cancellation)>DCT]
x=zeros (N , 1);
d=zeros (N , 1);
for n = 1 : N
x(n) = (iTaidou_wave(n+1) .* (qTaidou_wave(n+1)-qTaidou_wave(n))- (iTaidou_wave(n+1)-iTaidou_wave(n)).* qTaidou_wave(n+1)) ./ (iTaidou_wave(n+1) + qTaidou_wave(n+1));
d0 = 1.5;
c = 3 * 10^8;
fc = 24 * 10^9;
lambda = c/fc;
% Entire movement
d(n) = ((x(n) .* lambda) ./ 4*pi) - d0;
end
% Polynomial Fitting
%Time vector
for x1 =1:0.5:5
y = d(n) * x1 ;
p = polyfit(x1,y,3);
y_fit = polyval(p,x1);
plot(x1,y,'ro',x1,y_fit)
grid on
%LMS
mu = 0.2;
lms = dsp.LMSFilter('StepSize',mu);
[y,err,wts] = lms(x1,y_fit);
1 件のコメント
Walter Roberson
2021 年 3 月 12 日
What difficulty are you having?
You overwrite y_fit for each x
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!