matlabfrequencywaveletwavelet-transformtime-frequency

Wavelets: how to determine scales from frequencies?


In the following code sample, I would expect the rows of the printed output to match each other, at least approximately. But they don't.

% input data
y  = rand(10000,1); 
dt = 1/500; % 500Hz is the sampling rate


% wavelet transform
f  = 1:50;                    % frequencies at which to perform WT
s  = scal2frq(f,'morl',dt);   % corresponding scales estimates
wt = cwtft( y, 'wavelet', 'morl', 'scales', s );

[ f; wt.frequencies/dt ]

I am trying to use the continuous wavelet transform in Matlab, and I want to perform the transform at different frequencies in my input signal, but I am struggling to find a reliable way for estimating the corresponding scales.

In that code sample, I am using scal2freq to estimate those scales (knowing that it is involutory, ie that scal2frq(scal2frq(x,'morl',dt),'morl',dt) == x up to numerical precision for all x, dt), but then I would expect that the frequency estimates returned by cwtft would be similar. As you can see, they are not.

Does anyone know how cwtft estimates these frequencies, and whether I can use the reverse estimate to predict the required scales?


Solution

  • The correspondence between frequency and scales for the Morlet wavelet is scale = 6 / (2*pi * frequency*dt) (where frequency*dt is in cycles/unit).