-1

I run

spectrogram(data, 64, 60, 256, 2,  'yaxis');

I get

enter image description here

I want to get range from 0 to 180 Hz, instead of normalised range from 0 to 1. I can change axis by

axis([0 450 0 180])

but it does not change the values.

I run unsuccessfully

spectrogram(180 .* data, 64, 60, 256, 2,  'yaxis');

How can you scale the range from normalised to real range?

lennon310
  • 12,503
  • 11
  • 43
  • 61
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
  • [`spectrogram`](http://www.mathworks.es/es/help/signal/ref/spectrogram.html) actually has the time as y-axis and the frequency as x-axis. So are you sure you haven't just labeled your axes wrong? – Robert Seifert Dec 23 '13 at 17:28
  • @thewaywewalk You are right. I am plotting the fourier transform of the data, instead of time and frequency. – Léo Léopold Hertz 준영 Dec 23 '13 at 17:38

1 Answers1

1

The x-axis should be frequency. You need to know the sampling rate fs (is it 2 ?) of data. Then the frequency range will be (0:63)/64*fs

Actually you can get the frequency output in the spectrogram function:

[B,F,T]=spectrogram(data,64,60,256,2);  % if fs = 2 in your case

F is the frequency range.

lennon310
  • 12,503
  • 11
  • 43
  • 61