好吧,我想制作一首歌的频谱图。前 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
首先,恋人从何而来,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
我是一名优秀的程序员,十分优秀!