필터 지우기
필터 지우기

How can I use STFT with Wavelet?

조회 수: 2 (최근 30일)
studentmatlaber
studentmatlaber 2022년 5월 30일
답변: Ayush Modi 2024년 1월 1일
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,:));

답변 (1개)

Ayush Modi
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.

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by