FFT from a time signal with unequal time increment

1 visualizzazione (ultimi 30 giorni)
Hossein
Hossein il 27 Gen 2016
Risposto: Star Strider il 27 Gen 2016
Hi everyone, I am trying to take a FFT from a simulated time signal, which is resulted from an ODE simulation. The problem is the unequal time steps by ODE and I don't know how should I make this FFT analysis in this case. Concerning the T as the time vector and Y as a simulated time signal, can anybody tell me how should I perform the FFT analysis? Many thanks in advance!

Risposte (1)

Star Strider
Star Strider il 27 Gen 2016
I would go back and re-run the ODE with a fixed time step, then use that to calculate the FFT.
Instead of giving the ODE solver a ‘tspan’ vector of a beginning and end time, such as:
tspan = [t_start t_end];
give it a constant-step vector instead:
tspan = linspace(t_start, t_end, 50);
to create (for example) a 50-element equal-step time vector. The ODE solver will report the solutions very close to the time steps you specify.

Community Treasure Hunt

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

Start Hunting!

Translated by