MATLAB: Time versus Frequency plot

fftfft timefrequencyfrequency plotfrequency vs timetimetime ffttime plottransformation

Hello,
I am working on a data obtained from oscilloscope. I transformed time vs intensity to frequency vs intensity plot using FFT function in Matlab. But for some analysis I need to convert same data into Time vs Frequency plot.
Can anyone help me please. I am pretty new to Matlab.
A bit of more explanation is appreciated.
Thank you in advance.

Best Answer

There are different ways to do what you want, but in my opinion the simplest is also the best: The "short time FFT." (The Hilbert transform is another common method, but a little more involved). Basically you take an FFT of different sections of the signal, and use that to plot its frequency behavior over time. Here is an overview from an audio perspective, with MATLAB examples.
Like Adam said, 'spectrogram' implements this functionality if you have the SP toolbox. There is an STFT submission on the file exchange which does something similar; it also requires the SP toolbox.
Quick Googling didn't lead me to any implementations which work without the SP toolbox, so you might have to write your own if you don't have it. The algorithm itself isn't too complicated but if you're new to MATLAB that might be tough; I'd recommend you search a little longer for a base implementation if you're missing the toolbox.
Related Question