CepstrumArray[data]
computes the power cepstrum of data.
CepstrumArray[data,type]
computes the specified type of cepstrum of data.
CepstrumArray
CepstrumArray[data]
computes the power cepstrum of data.
CepstrumArray[data,type]
computes the specified type of cepstrum of data.
Details and Options
- Cepstral analysis has been used for characterization of echoes, separation of convolved signals and pitch detection application in signal processing.
- Real cepstrum is computed as the inverse Fourier transform of the log-magnitude Fourier spectrum.
- The data can be any of the following:
-
list arbitrary rank numerical or Quantity array audio an Audio or Sound object image arbitrary Image or Image3D object video a Video object - The type specification can be either of the following:
-
"Power" ![|F^(-1)log(TemplateBox[{{F, (, data, )}}, Abs]^2)|^2 |F^(-1)log(TemplateBox[{{F, (, data, )}}, Abs]^2)|^2](Files/CepstrumArray.en/1.png)
"Real"
- For multichannel images and audio signals, CepstrumArray is returned separately on each channel.
- CepstrumArray accepts the FourierParameters option. The default setting is FourierParameters->{1,-1}.
Examples
open all close allBasic Examples (2)
CepstrumArray[{1, 1, 2, 2, 1, 1, 0, 0}]Cepstrum of an Audio object:
a = Import["ExampleData/rule30.wav"];CepstrumArray[a]ListLinePlot[Take[%, {20, 500}]]Scope (7)
CepstrumArray[{1, 1, 2, 2, 1, 1, 0, 0}, "Real"]a = RandomComplex[1 + I, {3, 3}];
a//MatrixFormCepstrumArray[a]//MatrixFormCompute the cepstrum of a Sound:
a = ExampleData[{"Sound", "Apollo11ReturnSafely"}]CepstrumArray[a]ListLinePlot[Take[%, {20, 500}], PlotRange -> All]Cepstrum of a multichannel Audio object:
a = ExampleData[{"Audio", "Bee"}];CepstrumArray[a, "Real"]The cepstrum is computed separately on each channel:
ListLinePlot[Take[%, All, {20, 500}], PlotRange -> All]Compute the cepstrum of the audio track of a video object:
CepstrumArray[\!\(\*VideoBox[""]\)]ListLinePlot[Take[%[[1]], {20, 500}], PlotRange -> All]Cepstrum of an Image object:
a = [image];CepstrumArray[a]MatrixPlot[RotateLeft[Log@%, {150, 150}], PlotTheme -> "Minimal"]Cepstrum of a multichannel image:
a = [image];c = CepstrumArray[a];The cepstrum is computed separately on each channel:
Dimensions@cTable[MatrixPlot[RotateLeft[Log[cc], Round[Dimensions[cc] / 2]], PlotTheme -> "Minimal"], {cc, c}]Applications (3)
Detect the effect of a comb filer on a signal:
data = Table[2 Sin[0.05π n ] + Sin[0.154 π n] + RandomReal[{-1, 1}] / 10., {n, 0, 1023}];The signal only has two sinusoidal components:
dtf = TransferFunctionModel[(1/1 - 0.8 z^-31), z, SamplingPeriod -> 1]A comb filter with delay of 31 samples is applied:
y = RecurrenceFilter[dtf, data];It is not easy to identify the periodicity of the comb filter by using conventional spectral analysis:
Periodogram[{data, y}]Since the cepstrum of a convolution is the sum of the cepstra of the two components, it is easier to identify the peak caused by the comb filter:
ListLinePlot[{CepstrumArray[data][[ ;; 100]], CepstrumArray[y][[ ;; 100]]}, PlotRange -> .2]Measure the time constant of an echo:
a = AudioDelay[Import["ExampleData/rule30.wav"], Quantity[0.6, "Seconds"], .6, PaddingSize -> 4]Compute the logarithm of the cepstrum, and discard the second half (the real cepstrum is symmetric):
cepstrum = CepstrumArray[a];
cepstrum = Log[cepstrum[[ ;; Length[cepstrum] / 2]]];peaks = FindPeaks[cepstrum, 1, 2, -2]ListLinePlot[cepstrum, PlotRange -> All, Epilog -> {Red, Point[peaks]}]Select the position of the biggest peak:
quefrency = MaximalBy[peaks, Last][[1, 1]] - 1Compute the period by dividing the quefrency by the sample rate:
UnitConvert[N@quefrency / AudioSampleRate[a], "s"]Detect the pitch of a recording:
a = ExampleData[{"Sound", "Oboe"}, "Audio"]In harmonic sounds, the pitch does not correspond to the biggest peak in the spectrum:
Periodogram[a, 4000]Compute the cepstrum and discard the symmetric part:
cepstrum = CepstrumArray[a];
cepstrum = cepstrum[[ ;; Length[cepstrum] / 2]];Find the peaks and display the result:
peaks = FindPeaks[cepstrum, 1, .1]ListLinePlot[cepstrum[[ ;; 1000]], PlotRange -> {0, 1}, Epilog -> {Red, Point[peaks]}]The peak corresponding to zero quefrency is discarded, and the biggest peak is selected:
quefrency = MaximalBy[Select[peaks, #[[1]] > 1&], Last][[1, 1]] - 1Compute the fundamental frequency by dividing the sample rate by the quefrency:
ff = AudioSampleRate[a] / quefrencyAudioGenerator[{"Sin", ff}]Related Guides
Text
Wolfram Research (2017), CepstrumArray, Wolfram Language function, https://reference.wolfram.com/language/ref/CepstrumArray.html (updated 2024).
CMS
Wolfram Language. 2017. "CepstrumArray." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/CepstrumArray.html.
APA
Wolfram Language. (2017). CepstrumArray. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CepstrumArray.html
BibTeX
@misc{reference.wolfram_2026_cepstrumarray, author="Wolfram Research", title="{CepstrumArray}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/CepstrumArray.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_cepstrumarray, organization={Wolfram Research}, title={CepstrumArray}, year={2024}, url={https://reference.wolfram.com/language/ref/CepstrumArray.html}, note=[Accessed: 12-June-2026]}