Вопрос

Is there Matlab code that shows a series of numbers representing a waveform as a spectrogram?

The time interval each sample represents is the same, idearly this could also be given to use for the axis scale.

http://www.davegrossman.net/gould/media/spectrum-devocalized.jpg

For example:

spec({1 2 3 2 1 2 3 2}, 0.1 seconds)

or

spec(my_data.txt, 10 Hz)

etc...

Это было полезно?

Решение

If you have the Signal Processing Toolbox, then you can use the spectrogram() function. e.g.:

T = 0:0.001:2;
X = chirp(T,100,1,200,'q');
spectrogram(X,128,120,128,1E3); 

(Example taken from that documentation page.)

The numeric params are window length, overlap length, FFT length and sampling frequency, respectively.

Другие советы

if you look on tftb toolbox, the tfrspwv is a very complex and precise spectrogram code and there is an running script example in the tfrspwv.m code online for making a spectrogram in Matlab.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top