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!