How can I use STFT with Wavelet?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, I am applying the example in the link. But additionally I add Wavelet to it. I applied 5 level wavelet. I am trying to implement the block diagram below.
Normally I was writing audio in STFT. But now I have to write c after applying wavelet? How can I use STFT with Wavelet?
len=length(audio);
[c,l]=wavedec(audio,5,'bior3.1');
approx = appcoef(c,l,'bior3.1',5);
[cd1,cd2,cd3,cd4,cd5] = detcoef(c,l,[1 2 3 4 5]);
%% STFT
windowLength = 256;
win = hamming(windowLength,"periodic");
overlap = round(0.75 * windowLength);
ffTLength = windowLength;
fs = 16e3;
numFeatures = ffTLength/2 + 1;
numSegments = 8;
inputFs = 16e3;
cleanSTFT = stft(c,'Window',win,'OverlapLength',overlap,'FFTLength',ffTLength); %normally it was written audio instead of c. But do I have to write c after the wavelet?
cleanSTFT = abs(cleanSTFT(numFeatures-1:end,:));
0 件のコメント
回答 (1 件)
Ayush Modi
2024 年 1 月 1 日
Hi,
As per my understanding, you want to calculate the Short-time Fourier Transform (stft) of a discrete wavelet transform of an audio file. You can achieve this by using the detail coefficients of the 5th level wavelet coefficients. Here is an example to demonstrate how you can accomplish this:
cleanSTFT = stft(cd5,'Window',win,'OverlapLength',overlap,'FFTLength',ffTLength);
cleanSTFT2 = abs(cleanSTFT(numFeatures-1:end,:));
I hope this resolves the issue you were facing.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!