The result of Spectrogram()
3 次查看(过去 30 天)
显示 更早的评论
Hey all, I've a sound and a spectrogram of it.
But I honestly do not know what it means, shows and do.
Here's what I've got
load handel; % 'handel' is a MAT-file which is shipped with MATLAB as an example
x = y/10; % Decrease volume
player = audioplayer(x, Fs);
play(player,[1 (get(player, 'SampleRate')*10)]);
spectrogram(x);
Spectrogram(x) prints this:

Is there anyone that can tell me what the spectrogram function does and shows? What does the yellow and green color mean?
0 个评论
回答(1 个)
Cris LaPierre
2020-12-5
You might find this previous Answers post helpful as well: How to understand spectrogram function
2 个评论
Cris LaPierre
2020-12-5
Note that the limits of your colorbar have changed, so be careful about making broad statements based solely on color. Amplitude of a sound is related to volume, so while the density of the lines does not impact volume, the more a frequency tends towards yellow, the louder it will be.
Each "row" of your spectrogram represents a snapshot in time of your signal. The x-axis shows the range of frequencies contained in the entire signal, and each row of colors indicates the amplitude of the corresponding frequency at that time instance. As you move from the bottom to the top of the spectrogram, you are moving from the start to the end of the song.
You may be able to see this better if you take advantage of some of the other inputs. Note the 3 bands.
load handel; % 'handel' is a MAT-file which is shipped with MATLAB as an example
y(25000:end)=y(25000:end)./10; % y/10
y(50000:end)=y(50000:end)./10; % y/100
spectrogram(y,128,120,128,Fs)
% to listen to it
handelObj = audioplayer(y,Fs);
play(handelObj)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!