frequency obtained by cftool is 10 times less than what I should get
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I am using fourier series for one of my application. I was getting wrong result, so I decided to check the fit(t,variable,'fourier1') for small application. I used the following code to generate a cos wave
%%Angular Frequency
omega=0.65;
%%Time specifications:
Fs = 10; % samples per second
dt = 1/Fs; % seconds per sample
StopTime =200*omega/pi; % seconds
t = (0:dt:StopTime-dt)'; % seconds
%%Sine wave:
x = cos(omega*t);
% Plot the signal versus time:
figure;
plot(t,x);
I used this cos wave in cftool and fit function. both gave me results as in figure.
as you can see, in result I got w=omega=0.065 whereas The original signal was having angular frequency as 0.65;
I have tried this for other frequency too and result is always 10 times less. What am i doing wrong ?
2 个评论
David Goodmanson
2017-5-15
Hi Kunal, I don't have access to cftool but this gives the impression that some part of the calculation is not getting the message that your time array has spacing of 1e-1. If it were assumed instead that the spacing is 1, then the calculated omega is down by a factor of 10. If you change Fs to 20, does the answer change by that same factor?
回答(1 个)
John D'Errico
2017-5-14
Decent starting values are critical to finding a good estimate. If you provide no starting values at all, then you get an arbitrary result, often something that will not make you happy.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!