Signal Processing HELP wavread, wavwrite, fft!!
3 views (last 30 days)
Show older comments
I want to cut portions out of my .wav file and save them as separate .wav files, but I have no idea how to do so, and I have about an hour of data so I need to make a loop that will cut proportionally, but the sounds happen at different instances so I might have to do 1 by 1.
Here is my code so far:
------------------------
N1=1; N2=4410;
[wave,fs]=wavread('insectuno.wav', [N1 N2]);
siz=wavread('insectuno.wav','size');
sound(wave,fs);
t=0:1/fs:(length(wave)-1)/fs;
plot(t,wave);
figure(1);
plot(t,wave);
title('Wave File');
ylabel('Amplitude');
xlabel('Length (in secs)');
n=length(wave)-1;
f=0:fs/n:fs;
wavefft=abs(fft(wave));
figure(2);
plot(f,wavefft);
xlabel('Frequency in Hz');
ylabel('Magnitude');
title('The Wave FFT');
--------------------------------
4 Comments
Walter Roberson
on 28 May 2012
Does a perio diagram show anything interesting when an insect flies through the sensor? Or is the input just low level noise when there is no insect, such that even a signal amplitude test might be useful?
Answers (0)
See Also
Categories
Find more on Spectral Estimation 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!