フィルターのクリア

how can i get a wave file of a particular duration

1 回表示 (過去 30 日間)
Sony
Sony 2013 年 6 月 13 日
Actually i got a .wave file of some duration but i need a particular portion of that .wave file.i used wavsurfer software but its not working.i need a .wav file ranging from 2.9sec to 3.4sec can anybody pls help me with matlab code??

回答 (1 件)

Jan
Jan 2013 年 6 月 13 日
編集済み: Jan 2013 年 6 月 16 日
When you know the frequency of the signal, you can specify the wanted part in the inputs:
[y, Fs] = wavread(filename, [N1, N2])
Or the modern version in new Matlab versions:
[y,Fs] = audioread(filename, [N1, N2])
Without knowing the frequency, you can either import the whole signal and cut it afterwards, or obtain the frequency:
info = audioinfo(filename);
Fs = info.SampleRate;
Signal = audioread(filename, round([2.9, 3.4] * Fs)); % [EDITED, typo]
  4 件のコメント
Sony
Sony 2013 年 6 月 14 日
how to get number of samples per second?
Walter Roberson
Walter Roberson 2013 年 6 月 14 日
Do you see above where Jan did the wavread() ? The second output, Fs, is the sampling frequency. You can also get it without reading the file by using wavinfo() (older) or audioinfo() (newer)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by