Signal Processing HELP wavread, wavwrite, fft!!

3 views (last 30 days)
Dante
Dante on 28 May 2012
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
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?
Dante
Dante on 28 May 2012
Do you mean the plot? It shows a lot of peaks, and that's where most of the insects are. But I don't know how to cut them at the right point.
And yeah there is very low level noise when there is no insect.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!