Get frequency value from the Continuous Wavelet Transform

9 views (last 30 days)
Hi There,
I'm using the CWT (1D) to analyze the frequency of small acoustic impulses. Based on the scalogram generated, I'm interested in extracting the frequency value from the higest magnitude component (In this case it's about 2KHz. Wavelet_0.jpg

Accepted Answer

Robert U
Robert U on 25 Sep 2019
Hi Angus Joyce:
You did not provide any data, thus I could not work on your example. The mathworks example files for wavelet transforms are sufficient to show you a way to retrieve the requested data.
% matlab example
load mtlb % load example file
cwt(mtlb,'bump',Fs) % produce plot
[wt,f] = cwt(mtlb,'bump',Fs); % get matrix and frequency vector from cwt()
% get index of maximum value of returned matrix
[~,tmp] = max(wt);
[~,tmp2] = max(max(wt));
ind = [tmp(tmp2),tmp2];
% get frequency of maximum
f(ind(1))
% get time of maximum
(ind(2)-1) * 1/Fs
Kind regards,
Robert

More Answers (0)

Community Treasure Hunt

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

Start Hunting!