4

好吧,我想制作一首歌的频谱图。前 10 秒是我的兴趣点。我应该这样做还是如果我错了纠正我是错的。

命令:

song = wavread('C:\Path of My FIle\song.wav')

length(song)/44100

song_seg = lovers(44100*1 : 44100*10)

plot(song_seg) % this command makes my spectogram Hz/Time
4

1 回答 1

4

首先,恋人从何而来,44100这个数字有什么意义?创建频谱图最简单的方法是使用 Matlab 的频谱图功能。以下代码将为指定的波形文件生成频谱图——您可以试验窗口大小和窗口重叠参数以找到最适合您需要的图。

[song, fs] = wavread('C:\Path of My File\song.wav');
song = song(1:fs*10);
spectrogram(song, windowSize, windowOverlap, freqRange, fs, 'yaxis');

%Larger Window Size value increases frequency resolution
%Smaller Window Size value increases time resolution
%Specify a Frequency Range to be calculated for using the Goertzel function
%Specify which axis to put frequency

%%EXAMPLE
spectrogram(song, 256, [], [], fs, 'yaxis');
%Window Size = 256, Window Overlap = Default, Frequency Range = Default
%Feel free to experiment with these values
于 2013-08-18T17:28:03.527 回答