How can I make a spectrogram from a wav file

Well, I want to make a spectrogram of a song. The first 10 seconds are my interests. Should I just do this, or is it wrong, if I'm wrong, trust me.

Teams

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
source share
1 answer

First of all, where did the lovers come from, and what is the meaning of number 44100? The easiest way to create a spectrogram is to use the Matlab spectrogram function. The following code generates a spectrogram for a given wave file - you can experiment with window parameters and window overlap parameters to find a graph that best suits your needs.

 [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 
+4
source

Source: https://habr.com/ru/post/1497666/


All Articles