how to apply stft to audio signal?
13 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone. This is my first time processing audio, so I'm a beginner at this. I want to apply stft to my audio signal. It needs to have a 256-point Hamming window length, 128-point overlap, and 256-point transform values. I repeat a study, it says there is a 256-point sample that corresponds to 16ms.
Is this code I wrote correct? I would be glad if you help.
[data,fs]=audioread('SA1.wav')
% data = 46797x1 double
% fs = 16000
d = seconds(16*10e-3);
stft(data,d,'Window',hamming(256),'OverlapLength',128,'FFTLength',256);
0 件のコメント
回答 (1 件)
Bjorn Gustavsson
2022 年 1 月 12 日
You might do this, but the call to seconds looks spooky. From audioread you get the sampling-frequency fs, that is the sampling-frequency you should send in to stft. If that matches the sampling-frequency from the study you're good. If that sampling-frequency doesn't match you will have to work - but making up a sampling-frequency or sampling-time array like you do cannot be anyting but an unnecessary risk, if you're right you might just as well have used fs if you're wrong you only set yourself up for more future pain and toil...
HTH
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Pulsed Waveforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!