taking fft of .wav file

I am trying to get the fft of a specific part of the signal coming from a .wav file.
the wav file is a repetition of the signal every 0.6 seconds. I am trying to figure out how to get the repetition 10 times and compare to show that the results should be similar.
this is the code i have for now
Fs = 44100;
cj = sqrt(-1);
[test,fs]= wavread('3b healthy2.wav'); % File data name
dt = 1/Fs;
time = 45.6;
N = time/dt;
left=test(:,1);
right=test(:,2);
I = left;
Q = right;
t = 0:dt:(time-dt);
n = length(t);
f = -Fs/2:Fs/n:Fs/2-Fs/n;
s = I+cj.*Q;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Smooth the signal
ss = smooth(s,201);
sf = fftshift(fft(ss(1:N))); % taking fft
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(2)
plot(f,(abs(sf))./max(abs(sf)))
so once i separate program i can find out the time domain and from there i found that one repetition is at 45.2 to 45.8.
after i run this program i get a graph but form what i can see is not including one repetition but all repetition combined up to 45.2
any help will be much appreciated :) Thanks

7 Comments

Can you include the wav file as an attachment to your question? Or is it too large?
the file is 30mb approx. this is what it looks like at 45 sec. and that signal is repeating. i am uploading the file on dropbox for you to have if you want?
You can upload it here rather than at dropbox. Click on the ‘paperclip’ or ‘staple’ icon next to ‘Help’ at the top of the window. Choose the file, then Attach the file and it will be available here.
the file exceeds 5mb. is around 30 so i am not able to do it here i tried
this is how the signal looks like at 45 seconds. the wav file is up to 3minutes long repeating same pattern. now i need to be able to find the fft over that period that is 45.17:45.806
Can you upload an illustrative subset of it? A 30 MB file is probably more than most people will want to work with.
Fragkos Maragkou
Fragkos Maragkou on 24 Jul 2014
Edited: Star Strider on 24 Jul 2014
this is the file cut to 3.7mb therefore now 21 seconds instead of 3 mins. so the question becomes how to take the fft of a single reputation that is 0.6s at example 13.2-13.8? https://www.dropbox.com/s/haldu2k9j0f58ao/3b%20healthy2222.wav

Sign in to comment.

Answers (0)

Tags

Asked:

on 24 Jul 2014

Edited:

on 24 Jul 2014

Community Treasure Hunt

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

Start Hunting!