Spectrogram function cutting off beginning and end of signal
Ältere Kommentare anzeigen
Hi,
I have a 10 second audio clip (called originalsound) with a sampling frequency of 2,000 Hz (called downsampledrate) that I want to plot using spectrogram. When I do so with the following code:
figure; spectrogram(originalsound,N,[],[],downsampledrate,'yaxis')
title('Original Sound')
set(gca,'FontSize',16)
yt = get(gca, 'YTick');
set(gca, 'YTick',yt, 'YTickLabel',yt*1E+3) %change y-axis to Hz from kHz
ylabel('Frequency (Hz)') %change y-axis label
the plot generates without 0 or 10 labeled for time on the x-axis.

I tried fixing this by changing the xlim from 0-10, but then I get white bars on either side of the spectrogram.

If I am plotting a 10 second sound, why are there not 10 seconds shown in the spectrogram? Is there some sort of windowing effect going on?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Time-Frequency Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
