Frame by frame freqeuncy analysis of voice.

4 views (last 30 days)
below code for frame by frame analysis of wav file , Seniors Go through it and answer my question please , question is written in the last.
[data,fs]= audioread('filename.wav);
fd=0.025 % duration selected from 5 sec
f_size= round(fd*fs);% how many samples in a frame
n_f=floor(length(data)/f_size) %how many frames are there
temp=0; %temporary value
for i= 1: n_f
frames(i,:) =data (temp+1: temp+f_size);
plot (frame(1,:))%plot first frame or any you want give there numbe . question is that how can I read frequency of that particular frame or that duration of 0.025 ms? please help me for it .

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 15 Feb 2019
Have a look at the documentation for the spectrogram function, that should do what you want. 0.025 is a rather short time so perhaps you can get something from calculating the instantaneous frequency - so have a look at that (and first the Hilbert transform too), this is likely a rough suggestion since we expect frequencies way higher than 20 Hz.
Yasir Ali
Yasir Ali on 16 Feb 2019
dear it shows error while I run this line of code
the error is "" Erroe using spectrogram>chkinput X must be a vectoe (either row or column ).
Error in Spectrogram Chkinput (x); ""
what to do to solve that error , may I have your email Id as I can get in touch with you through email please ?

Sign in to comment.

More Answers (0)


Find more on Time-Frequency Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!