How this code using the wavread function works in matlab? -


i have problems understanding code question (i can't comment on answer because i'm new , don't have enough reputation).

the code this:

[song, fs] = wavread('c:\path of file\song.wav'); song = song(1:fs*10); spectrogram(song, windowsize, windowoverlap, freqrange, fs, 'yaxis'); 

i don't know second line of code does. can explain it? affect output of spectrogram?

my code is:

[song, fs] = wavread('c:\users\iván\downloads\kawai-k3-strings-c5.wav'); song = song(1:fs*5); //(first line ...(1:fs*10) didnt work. why? know. spectrogram(song, 256, [], [], fs, 'xaxis'); 

the second line of code extracting sample of song's time series of length 10 times sampling frequency in hertz.

you should first check there enough samples in song checking length of song using

songlength = numel(song)/fs

if there not enough samples cover 10 times sample frequency, use shorter multiplier.

the spectrogram being computed on sample, rather whole song.

you'll need consult matlab documentation on spectrogram select call options accomplish useful signal processing goals, depending on want do.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -