This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Wavelet center frequency


FREQ = centfrq('wname')
FREQ = centfrq('wname',ITER)
[FREQ,XVAL,RECFREQ] = centfrq('wname',ITER,'plot')


FREQ = centfrq('wname') returns the center frequency in hertz of the wavelet function, 'wname' (see wavefun for more information).

For FREQ = centfrq('wname',ITER), ITER is the number of iterations performed by the function wavefun, which is used to compute the wavelet.

[FREQ,XVAL,RECFREQ] = centfrq('wname',ITER,'plot') returns, in addition, the associated center frequency based approximation RECFREQ on the 2ITER points grid XVAL and plots the wavelet function and RECFREQ.


collapse all

This example shows how to determine the center frequency in hertz for Daubechies' least-asymmetric wavelet with 4 vanishing moments.

cfreq = centfrq('sym4');

Obtain the wavelet and create a sine wave with a frequency equal to the center frequency, cfreq, of the wavelet. Use a starting phase of -π for the sine wave to visualize how the oscillation in the sine wave matches the oscillation in the wavelet.

[~,psi,xval] = wavefun('sym4');
y = cos(2*pi*cfreq*xval-pi);
hold on;

This example shows to convert scales to frequencies for the Morlet wavelet. There is an approximate inverse relationship between scale and frequency. Specifically, scale is inversely proportional to frequency with the constant of proportionality being the center frequency of the wavelet.

Construct a vector of scales with 32 voices per octave over 5 octaves for data sampled at 1 kHz.

Fs = 1000;
numvoices = 32;
a0 = 2^(1/numvoices);
numoctaves = 5; 
scales = a0.^(numvoices:numvoices*numoctaves).*1/Fs;

Convert the scales to approximate frequencies in hertz for the Morlet wavelet.

Frq = centfrq('morl')./scales;

You can also use scal2frq to convert scales to approximate frequencies in hertz.

See Also


Introduced before R2006a