FREQ = centfrq(wname,ITER)
uses ITER many iterations to generate the wavelet.
[FREQ,XVAL,RECFREQ] = centfrq(wname,ITER,'plot')
returns the associated center frequency-based approximation
RECFREQ evaluated on the grid XVAL and
plots the wavelet function and RECFREQ.
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);
plot(xval,psi,'linewidth',2);
hold on;
plot(xval,y,'r');
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.
Wavelet center frequency in hertz, returned as a scalar.
XVAL — Grid real-valued vector
Grid where the center frequency-based approximation to the wavelet is
evaluated, returned as a real-valued vector.
RECFREQ — Center frequency-based approximation vector
Center frequency-based approximation to the wavelet, returned as a vector.
Depending on the wavelet, RECFREQ is either a real- or
complex-valued vector.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.