Main Content

morlet

Morlet wavelet

Description

[psi,x] = morlet(lb,ub,n) returns the Morlet wavelet psi evaluated at x, an n-point regular grid in the interval [lb, ub]. The Morlet wavelet is defined as

The Morlet wavelet has the interval [-4, 4] as effective support. Nearly 100% of the wavelet's energy is in the interval. Although [-4, 4] is the correct theoretical effective support, a wider effective support, [-8, 8], is used in the computation to provide more accurate results.

example

Examples

collapse all

This example shows how to create a Morlet wavelet. The wavelet has an effective support of [-4, 4]. Use 1000 sample points.

lb = -4;
ub = 4;
n = 1000;
[psi,xval] = morlet(lb,ub,n);
plot(xval,psi)
grid on
title('Morlet Wavelet')

Figure contains an axes object. The axes object with title Morlet Wavelet contains an object of type line.

Compute the wavelet's energy in the interval. Normalize by the difference between sample points.

e1 = sum(psi.^2)*diff(xval(1:2));
fprintf('%.15f',e1)
0.886226920745597

Create a second Morlet wavelet with support on [-8, 8] using 1000 sample points. Compute the second wavelet's energy, normalized by the difference between sample points. Return the ratio of the two energies.

[psi2,xval2] = morlet(-8,8,1000);
e2 = sum(psi2.^2)*diff(xval2(1:2));
fprintf('%.15f',e1/e2)
0.999999994674672

Input Arguments

collapse all

Lower limit of interval, specified as a real-valued scalar.

Upper limit of interval, specified as a real-valued scalar.

Number of sample points, specified as a positive integer.

Output Arguments

collapse all

Morlet wavelet, returned as a real-valued vector of length n.

Sampling instants, returned as a real-valued vector of length n.

Version History

Introduced before R2006a

See Also

Go to top of page