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