ContinuousWaveletTransform[{x1,x2,…}]
gives the continuous wavelet transform of a list of values xi.
ContinuousWaveletTransform[data,wave]
gives the continuous wavelet transform using the wavelet wave.
ContinuousWaveletTransform[data,wave,{noct,nvoc}]
gives the continuous wavelet transform using noct octaves with nvoc voices per octave.
ContinuousWaveletTransform[sound,…]
gives the continuous wavelet transform of sampled sound.
ContinuousWaveletTransform
ContinuousWaveletTransform[{x1,x2,…}]
gives the continuous wavelet transform of a list of values xi.
ContinuousWaveletTransform[data,wave]
gives the continuous wavelet transform using the wavelet wave.
ContinuousWaveletTransform[data,wave,{noct,nvoc}]
gives the continuous wavelet transform using noct octaves with nvoc voices per octave.
ContinuousWaveletTransform[sound,…]
gives the continuous wavelet transform of sampled sound.
Details and Options
- ContinuousWaveletTransform gives a ContinuousWaveletData object.
- Properties of the ContinuousWaveletData cwd can be found using cwd["prop"]. A list of available properties can found using cwd["Properties"].
- The resulting wavelet coefficients are arrays of the same dimensions as the input data.
- The possible wavelets wave include:
-
MorletWavelet[…] Morlet cosine times Gaussian GaborWavelet[…] complex Morlet wavelet DGaussianWavelet[…] derivative of Gaussian MexicanHatWavelet[…] second derivative of Gaussian PaulWavelet[…] Paul wavelet - The default wave is MexicanHatWavelet[].
- The default value for noct is given by
, where
is the length of the input. » - The default value for nvoc is 4.
- The continuous wavelet transform of a function
is given by
. - The continuous wavelet transform of a uniformly sampled sequence
is given by
. - The scaling parameter
is given by equal-tempered scale
where
is the octave number,
the voice number, and
the smallest wavelet scale. - For each scale
, the ContinuousWaveletTransform computes the wavelet coefficients
. - The following options can be given:
-
Padding None how to extend data beyond boundaries SampleRate Automatic samples per unit WaveletScale Automatic smallest resolvable scale 
WorkingPrecision MachinePrecision precision to use in internal computations - Padding pads the input data to the next higher power of 2 to reduce boundary effects. The settings for Padding are the same as for the padding argument used in ArrayPad.
- InverseContinuousWaveletTransform gives the inverse transform.
Examples
open all close allBasic Examples (2)
Compute a continuous wavelet transform using MexicanHatWavelet:
cwd = ContinuousWaveletTransform[{56, 40, 8, 24, 48, 48, 40, 16}]ListLinePlot[cwd[All, "Values"]]Perform an inverse continuous wavelet transform:
InverseContinuousWaveletTransform[cwd]Transform a sampled Sound object:
Play[Underoverscript[∑, n, 5]Sin[2000 2^t n t], {t, 2, 3}]cwd = ContinuousWaveletTransform[%]WaveletScalogram[cwd]Scope (18)
Basic Uses (6)
Compute a continuous wavelet transform:
data = Table[HeavisideLambda[x], {x, -2, 2, (4/1023)}];cwt = ContinuousWaveletTransform[data]Show all the voices for the 8
octave:
ListLinePlot[Abs[cwt[{8, _}][[All, 2]]], PlotRange -> All]Use Normal to get all wavelet coefficients explicitly:
cwt = ContinuousWaveletTransform[{0, 0, 1, 0, 0}, MexicanHatWavelet[1]]Normal[cwt]Also use All as an argument to get all coefficients:
cwt[All]Use "IndexMap" to find out what wavelet coefficients are available:
cwt = ContinuousWaveletTransform[{0, 0, 1, 0, 0}, MexicanHatWavelet[1]];cwt["IndexMap"]Extract specific coefficient arrays:
cwt[{1, 1}]cwt[{1, 4}]Extract several wavelet coefficients corresponding to the list of wavelet index specifications:
cwt[{{1, 1}, {1, 3}}]Extract all coefficients whose wavelet indexes match a pattern:
cwt[{1, _}]cwt[{{_, 1}, {_, 4}}]cwt[{_, 1 | 4}]WaveletScalogram gives a time scale representation of wavelet coefficients:
data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];ListLinePlot[data]cwt = ContinuousWaveletTransform[data];WaveletScalogram[cwt, AxesLabel -> {"time", "scale"}]More voices per octave increases the scale resolution:
data = Table[Sin[x^2], {x, 0, 10, 0.02}];{cwt1, cwt2} = Table[ContinuousWaveletTransform[data, DGaussianWavelet[5], {Automatic, voc}], {voc, {4, 16}}];{WaveletScalogram[cwt1, PlotLabel -> "4 voices/octave"], WaveletScalogram[cwt2, PlotLabel -> "16 voices/octave"]}Higher number of octaves gives a wider spectrum of scale range:
data = Function[x, x Sin[Exp[x] x]][Range[2, 5, 0.001]];{cwt1, cwt2} = Table[ContinuousWaveletTransform[data, Automatic, {oct, Automatic}], {oct, {5, 8}}];{WaveletScalogram[cwt1, PlotLabel -> "5 octaves"], WaveletScalogram[cwt2, PlotLabel -> "8 octaves"]}Time and Scale Features (4)
A single frequency shows up as a horizontal band at the equivalent scale:
data1 = Table[Cos[20 π x], {x, 0, 1, (1/1023)}];ListLinePlot[data1]cwt1 = ContinuousWaveletTransform[data1, GaborWavelet[6]];WaveletScalogram[cwt1, ColorFunction -> "SolarColors"]Multiple frequencies show up as multiple bands at the equivalent scales:
data2 = Table[Cos[20 π x] + Cos[Sqrt[2] 50 π x], {x, 0, 1, (1/1023)}];ListLinePlot[data2]cwt2 = ContinuousWaveletTransform[data2, GaborWavelet[6]];WaveletScalogram[cwt2, ColorFunction -> "SolarColors"]Sinusoid with linearly increasing frequency:
data3 = Block[{fr = 0}, Table[Sin[(fr += 0.5)x], {x, 0, 1, (1/1023)}]];ListLinePlot[data3]cwt2 = ContinuousWaveletTransform[data3, GaborWavelet[6]];WaveletScalogram[cwt2, ColorFunction -> "SolarColors"]Wavelet transform gives a good time localization of features:
data = Table[Sin[4 π t] + 2 Exp[-10^5 ((1/3) - t)^2], {t, 0, 1, (1/511)}];ListLinePlot[data]cwt = ContinuousWaveletTransform[data, PaulWavelet[5], {7, 12}, SampleRate -> 511];WaveletScalogram[cwt, ColorFunction -> "AvocadoColors"]Higher frequencies are resolved at lower octaves and lower frequencies at higher octaves:
data = Table[Piecewise[{{Sin[2 π 10 t], 0 ≤ t < (1/4)}, {Sin[2 π 25 t], (1/4) ≤ t < (1/2)}, {Sin[2 π 50 t], (1/2) ≤ t < (3/4)}, {Sin[2 π 100 t], (3/4) ≤ t ≤ 1}}], {t, 0, 1, (1/1023)}];ListLinePlot[data, AspectRatio -> 0.2]cwd = ContinuousWaveletTransform[data, DGaussianWavelet[5], {Automatic, 12}];WaveletScalogram[cwd, ColorFunction -> "RustTones"]Resolve time and frequency features of a signal:
data = Table[Cos[40 π x] Exp[-100 π (x - 0.7)^2] + Cos[140 π x] Exp[-50 π (x - 0.2)^2], {x, 0, 1, (1/1023)}];ListLinePlot[data, PlotRange -> All]Use GaborWavelet to perform a continuous wavelet transform:
cwd = ContinuousWaveletTransform[data, GaborWavelet[8], SampleRate -> 1023];There is an inverse relationship between scale values and frequency values:
freq = (#1[[1]] -> (1023/#1[[2]])&) /@ cwd["Scales"]Find pairs of {oct,voc} that resolve frequencies 20 Hz and 70 Hz:
Cases[freq, u_ /; 19 ≤ Last[u] ≤ 21]Cases[freq, u_ /; 69 ≤ Last[u] ≤ 71]Verify using a WaveletScalogram:
WaveletScalogram[cwd, ColorFunction -> "BrassTones"]Wavelet Families (6)
Compute the wavelet transform using different wavelet families:
data = Table[Sin[x^2] + Cos[x^3], {x, 0, 3 π, 0.01}];ListLinePlot[data]A narrow wavelet function will have good time and scale resolution:
cwt1 = ContinuousWaveletTransform[data, MexicanHatWavelet[1]];WaveletScalogram[cwt1]A broad wavelet function will have poor time and scale resolution:
cwt2 = ContinuousWaveletTransform[data, GaborWavelet[3]]WaveletScalogram[cwt2]Use different families of wavelets to capture different features:
data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];ListLinePlot[data]MexicanHatWavelet (default):
cwt = ContinuousWaveletTransform[data, MexicanHatWavelet[]];ListPlot3D[Re@cwt[All, "Values"], ColorFunction -> "DarkRainbow", AxesLabel -> {"time", "scale"}, Mesh -> None, PlotRange -> All]data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];cwt = ContinuousWaveletTransform[data, DGaussianWavelet[]];ListPlot3D[Re@cwt[All, "Values"], ColorFunction -> "DarkRainbow", AxesLabel -> {"time", "scale"}, Mesh -> None, PlotRange -> All]data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];cwt = ContinuousWaveletTransform[data, GaborWavelet[3]];ListPlot3D[Abs@cwt[All, "Values"], ColorFunction -> "DarkRainbow", AxesLabel -> {"time", "scale"}, Mesh -> None, PlotRange -> All]data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];cwt = ContinuousWaveletTransform[data, MorletWavelet[]];ListPlot3D[Abs@cwt[All, "Values"], ColorFunction -> "DarkRainbow", AxesLabel -> {"time", "scale"}, Mesh -> None, PlotRange -> All]data = Table[Sign[Cos[x^2]], {x, -6, 6, (12./1023)}];cwt = ContinuousWaveletTransform[data, PaulWavelet[]];ListPlot3D[Abs@cwt[All, "Values"], ColorFunction -> "DarkRainbow", AxesLabel -> {"time", "scale"}, Mesh -> None, PlotRange -> All]Sound (2)
ContinuousWaveletTransform works on Sound as input:
sdata = Play[Sin[5000 t] + Sin[1000 t] + Cos[500 t] + Cos[200 t], {t, 0, 1}]cwt = ContinuousWaveletTransform[sdata, DGaussianWavelet[5]];WaveletScalogram[cwt, ColorFunction -> "StarryNightColors"]Speech analysis using ContinuousWaveletTransform:
snd = ExampleData[{"Sound", "Apollo11ReturnSafely"}]cwd = ContinuousWaveletTransform[snd, GaborWavelet[6], {Automatic, 12}];The orange patches correspond to the words "You will return safely to Earth":
WaveletScalogram[cwd, {4 | 5 | 6 | 7, _}]cwd2 = WaveletMapIndexed[#1 0.0&, cwd, Except[{5 | 6, _}]]Sound[InverseContinuousWaveletTransform[cwd2], SoundVolume -> 2]Options (9)
Padding (3)
The settings for Padding are the same as the methods for ArrayPad, including "Periodic":
ArrayPad[{a, b, c}, 4, "Periodic"]ArrayPad[{a, b, c}, 4, "Reversed"]ArrayPad[{a, b, c}, 4, "ReversedNegation"]ArrayPad[{a, b, c}, 4, "Reflected"]ArrayPad[{a, b, c}, 3, "ReflectedDifferences"]ArrayPad[{a, b, c}, 4, "ReversedDifferences"]ArrayPad[{a, b, c}, 3, "Extrapolated"]Padding has no effect on the length of wavelet coefficients:
cwd = ContinuousWaveletTransform[Range[16]];(Length[#1]&) /@ cwd[All][[All, 2]]Padding pads the input data to the next higher power of 2 to reduce boundary effects:
data = Table[Sin[20 x], {x, 0, 1, (1/1023)}];cwt1 = ContinuousWaveletTransform[data, MexicanHatWavelet[4], Padding -> None, WaveletScale -> Automatic];
rdata1 = InverseContinuousWaveletTransform[cwt1];cwt2 = ContinuousWaveletTransform[data, MexicanHatWavelet[4], Padding -> "Reflected", WaveletScale -> Automatic];
rdata2 = InverseContinuousWaveletTransform[cwt2];cwt3 = ContinuousWaveletTransform[data, MexicanHatWavelet[4], Padding -> "Extrapolated", WaveletScale -> Automatic];
rdata3 = InverseContinuousWaveletTransform[cwt3];Boundary effects at the start:
ListLinePlot[{data[[1 ;; 50]], rdata1[[1 ;; 50]], rdata2[[1 ;; 50]], rdata3[[1 ;; 50]]}, PlotStyle -> {Red, Green, Blue, Orange}, BaseStyle -> Thick]ListLinePlot[{data[[-50 ;; -1]], rdata1[[-50 ;; -1]], rdata2[[-50 ;; -1]], rdata3[[-50 ;; -1]]}, PlotStyle -> {Red, Green, Blue, Orange}, BaseStyle -> Thick]SampleRate (3)
For lists, the Automatic value of SampleRate is set to 1:
cwt1 = ContinuousWaveletTransform[Table[Sin[x^2], {x, 0, 1, 0.001}]];cwt1["SampleRate"]Explicitly set the sample rate:
cwt2 = ContinuousWaveletTransform[Table[Sin[x^2], {x, 0, 1, 0.001}], SampleRate -> 1000];cwt2["SampleRate"]For Sound data, the Automatic value of SampleRate is extracted from the Sound data object:
sdata = Sound[{Play[Sin[1000 t (1 + t^2)], {t, 0, .2}], Play[Sin[500 t (1 + t^3)], {t, 0, .5}]}]cwt = ContinuousWaveletTransform[sdata];cwt["SampleRate"]SampleRate is used for normalizing wavelet transform coefficients:
sdata = Sound[{Play[Sin[1000 t (1 + t^2)], {t, 0, .2}], Play[Sin[500 t (1 + t^3)], {t, 0, .5}]}]cwt = ContinuousWaveletTransform[sdata, Automatic, {Automatic, 16}]WaveletScalogram[cwt, ColorFunction -> "BlueGreenYellow"]WaveletScale (1)
WaveletScale indicates the smallest resolvable scale used for the transform:
data = Table[Sin[x^2], {x, 0, 3 π, (3 π/1023)}];ListLinePlot[data]cwt = ContinuousWaveletTransform[data, GaborWavelet[6], WaveletScale -> 1];The scales used are given as
with
wavelet scale,
octave, and
voice:
{ws, oct, voc} = cwt[{"WaveletScale", "Octaves", "Voices"}];Table[ws 2^j / voc, {j, 1, oct voc}] == cwt["Scales"][[All, 2]]WorkingPrecision (2)
By default, WorkingPrecision->MachinePrecision is used:
data = RandomInteger[1, {10}];cwt1 = ContinuousWaveletTransform[data]cwt2 = ContinuousWaveletTransform[data, WorkingPrecision -> MachinePrecision]cwt1 == cwt2Use higher-precision computation:
data = RandomInteger[1, {8}];cwt = ContinuousWaveletTransform[data, MexicanHatWavelet[], WorkingPrecision -> 35]cwt[{1, 1}]{Precision[cwt], Accuracy[cwt]}Applications (4)
Identify Features (2)
Real wavelet functions can be used to isolate peaks or discontinuities:
data = Table[HeavisideTheta[x], {x, -2, 2, (4/1023)}];ListLinePlot[data]cwt = ContinuousWaveletTransform[data, DGaussianWavelet[4], {Automatic, 12}, Padding -> "Fixed"]WaveletScalogram[cwt]Complex wavelets can be used to capture oscillatory behavior:
f[t_, ϵ_] := Sqrt[t (1 - t)] Sin[(2 π (1 + ϵ)/t + ϵ)]data = Table[f[t, 0.05], {t, 0, 1, (1/1023)}];ListLinePlot[data]cwt = ContinuousWaveletTransform[data, GaborWavelet[6], {Automatic, 16}]Amplitude of wavelet coefficients:
WaveletScalogram[cwt, ColorFunction -> "BlueGreenYellow"]Phase of wavelet coefficients:
WaveletScalogram[cwt, Automatic, Arg, ColorFunction -> "BlueGreenYellow"]Filter Frequencies (2)
ContinuousWaveletTransform can be used to filter frequencies:
f[x_] := Sin[50 π x] Exp[-100 π (x - 0.5)^2] + (Sin[50 π x] + 2 Cos[140 π x]) Exp[-50 π (x - 0.2)^2] + 2 Sin[150 π x] Exp[-80 π (x - 0.8)^2]data = Table[f[x], {x, 0., 1, (1/2047)}];ListLinePlot[data, PlotRange -> All]cwt = ContinuousWaveletTransform[data, GaborWavelet[6], {10, 16}, Padding -> 0.0, SampleRate -> 2047, WaveletScale -> Automatic];WaveletScalogram[cwt, ColorFunction -> "SolarColors"]Filter the cosine with frequency
:
vec = ConstantArray[1, Length[data]];
vec[[1 ;; 1000]] := 0.0cwtThresh = WaveletMapIndexed[#1 vec&, cwt, {{4 | 5, _}, {6, u_ /; u < 8}}];WaveletScalogram[cwtThresh, ColorFunction -> "SolarColors"]Perform InverseContinuousWaveletTransform on a thresholded data object:
rdata = InverseContinuousWaveletTransform[cwtThresh];ListLinePlot[{data[[1 ;; 800]], rdata[[1 ;; 800]]}, PlotRange -> All, PlotStyle -> {Blue, {Red, Thick}}]ListLinePlot[rdata, PlotRange -> All]Identify musical notes using a scalogram:
Needs["Music`"]Generate a sequence of pitches corresponding to an equal-tempered scale at 300 Hz:
m300 = MusicScale[TemperedChromatic, 300, 1]cwd = ContinuousWaveletTransform[m300, GaborWavelet[6], {7, 8}, SampleRate -> 8192];Compute frequencies resolved corresponding to octaves and voices:
freq = (#1[[1]] -> (8192/#1[[2]])&) /@ cwd["Scales"];Find pairs of {oct,voc} that resolve frequencies 300 Hz:
Cases[freq, u_ /; 280 ≤ Last[u] ≤ 320]WaveletScalogram[cwd, {3 | 4 | 5 | 6 | 7, _}]Properties & Relations (1)
The default value for octave
is given by
:
data = RandomReal[1, {100}];oct = Floor[Log2[(Length[data]/2)]]ContinuousWaveletTransform[data] == ContinuousWaveletTransform[data, Automatic, {oct, Automatic}]ContinuousWaveletTransform[data] == ContinuousWaveletTransform[data, Automatic, {Automatic, 4}]Possible Issues (1)
Low-frequency data is resolved at higher octaves:
data = Cos[(Range[1000]/1000)];Based on the length of input data, the Automatic setting for octaves resolved 8 octaves:
cwd1 = ContinuousWaveletTransform[data, MorletWavelet[], Automatic]ListLinePlot[{InverseContinuousWaveletTransform[cwd1], data}]Increase the number of octaves to resolve the low-frequency component:
cwd2 = ContinuousWaveletTransform[data, MorletWavelet[], {12, Automatic}]ListLinePlot[{InverseContinuousWaveletTransform[cwd2], data}]Neat Examples (1)
Scalogram of a Zeta function:
d = Re[Zeta[(1/2) + I Range[0, 100, 0.01]]];ListLinePlot[d]cwd = ContinuousWaveletTransform[d, GaborWavelet[6], {4, 12}, WaveletScale -> 100];{WaveletScalogram[cwd, All, Re, ColorFunction -> "CherryTones"], WaveletScalogram[cwd, All, Abs, ColorFunction -> "CherryTones"]}Related Guides
History
Text
Wolfram Research (2010), ContinuousWaveletTransform, Wolfram Language function, https://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html.
CMS
Wolfram Language. 2010. "ContinuousWaveletTransform." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html.
APA
Wolfram Language. (2010). ContinuousWaveletTransform. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html
BibTeX
@misc{reference.wolfram_2026_continuouswavelettransform, author="Wolfram Research", title="{ContinuousWaveletTransform}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_continuouswavelettransform, organization={Wolfram Research}, title={ContinuousWaveletTransform}, year={2010}, url={https://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html}, note=[Accessed: 13-June-2026]}