DSPRelated.com
Forums

Cutting and Resampling

Started by kingdavid3 March 19, 2007
I am reading a full length (duration of the speech) audio wave file 
sampled at 44.1KHz, 16 bit stereo. I want to cut a 15 second segment 
from the audio and resample it to 16000 Hz. So far I managed to do 
the resampling. Please help on how to cut 15 second length portion of 
the audio. Thank you 
 
[s, fs]=wavread('test.wav); 
 
%%cut to 15 seconds 
 
s=resample(s, 16000, fs); %downsample to 16000 Hz 
fs=16000; %new sampling
kingdavid3 wrote:
> I am reading a full length (duration of the speech) audio wave file > sampled at 44.1KHz, 16 bit stereo. I want to cut a 15 second segment > from the audio and resample it to 16000 Hz. So far I managed to do > the resampling. Please help on how to cut 15 second length portion of > the audio. Thank you > > [s, fs]=wavread('test.wav); > > %%cut to 15 seconds > > s=resample(s, 16000, fs); %downsample to 16000 Hz > fs=16000; %new sampling
44,100 samples/second x 15 seconds = 661500 samples. Does that help? Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Thank you very that help alot