reagrding fft when ode45 is involved
4 次查看(过去 30 天)
显示 更早的评论
is there any special procedure to find frequency using fft if the input to fft function is the set of values which is the result of ode45.
that is.. i find x from ode45("func",tspan,x0)
fft(x(:,1),nfft).
0 个评论
回答(1 个)
Star Strider
2015-1-14
I am not certain I understand what you mean by ‘find frequency’. To use the fft function, your ‘tspan’ variable must be supplied as a vector of equally-spaced times from beginning to end (rather than a range of beginning and end times only), with the interval equal to a sampling interval Ts, that you would define.
For example:
Ts = 0.1;
Tstart = 0;
Tend = 10;
tspan = [Tstart:Ts:Tend];
The time returned by the ODE solver will be the same as the ‘tspan’ you specify. You can then take the fft of the other ‘x’ output of the ODE solver. See the documentation for fft to understand how to determine the frequencies of the results of the fft function.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!