frequency equation for curve fitting

6 次查看(过去 30 天)
Hello All,
Is there any equation frequency based for exponential decaying cosine signals to fit on measure data for optimization or curve fitting method?
Thank you

采纳的回答

Star Strider
Star Strider 2019-9-9
To do a nonlinear fit in the frequency domain, you will need to calculate a function that is the Fourier transform of the time-domain function you want to fit.
Try this:
syms k1 k2 t Tmax w w0
y(t,w0,k1,k2) = exp(k1*t) * cos(k2*w0*t)
Y = int(y*exp(1j*w*t), t, 0, Tmax)
Y = simplify(Y, 'Steps',250)
Yf = matlabFunction(Y) % Individual Parameters
Yf = matlabFunction(Y, 'Vars',{[w0,k,Tmax],w}) % Parameter Vector ‘in1’
producing:
Yf = @(in1,w) -(in1(:,2)+w.*1i)./((in1(:,2)+w.*1i).^2+in1(:,1).^2)+(exp(in1(:,3).*in1(:,2)+in1(:,3).*w.*1i).*(in1(:,1).*sin(in1(:,3).*in1(:,1))+cos(in1(:,3).*in1(:,1)).*(in1(:,2)+w.*1i)))./((in1(:,2)+w.*1i).^2+in1(:,1).^2);
where ‘k’ (‘in(:,2)’) is the exponential decay constant, ‘w0’ (‘in(:,1)’) is the frequency of the cosine function, and ‘Tmax’ (‘in(:,3)’)is the maximum (end) time of the vector, and ‘w’ is the independent variable and radian frequency. Note that this produces a complex result, so it might be easiest to take the abs() of it and use it with the abs() of the Fourier transform. Also, as written here, ‘in’ is defined as a row vector, and will throw an error if you use a column vector as your initial parmeter estimates.
I have never done any nonlinear parameter estimation in the frequency domain, so I have no experience with it. I also did not test this function with the Fourier transform of a decaying cosine function, so I have no idea if it will succeed.
Have fun!
  53 个评论
Star Strider
Star Strider 2019-12-19
I have long since lost track of what we were doing.
I have no idea why the amplitude should be 84 when it otherwise appears to be as small as it is in other analyses, such as the Fourier transform.
Ill ch
Ill ch 2021-3-16
Hello Star Strider,
Almost, after one year again on matlab query :). I wish you are fine and very well in this COVID 19 time.
I have uploaded one more question on my current isssues. I hope you can help me there.
as i had forgotten this id so created new and uploaded there.
Thank you very much in advance
Best regards,
Ic

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surrogate Optimization 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by