Learn R Programming

gsignal (version 0.3-1)

cceps: Complex cepstral analysis

Description

Return the complex cepstrum of the input vector.

Usage

cceps(x)

Arguments

x

input data, specified as a real vector.

Value

Complex cepstrum, returned as a vector.

Details

Cepstral analysis is a nonlinear signal processing technique that is applied most commonly in speech and image processing, or as a tool to investigate periodic structures within frequency spectra, for instance resulting from echos/reflections in the signal or to the occurrence of harmonic frequencies (partials, overtones).

The cepstrum is used in many variants. Most important are the power cepstrum, the complex cepstrum, and real cepstrum. The function cceps implements the complex cepstrum by computing the inverse of the log-transformed FFT, i.e.,

$$cceps(x) <- ifft(log(fft(x)))$$

However, because taking the logarithm of a complex number can lead to unexpected results, the phase of fft(x) needs to be unwrapped before taking the log.

References

https://en.wikipedia.org/wiki/Cepstrum

See Also

rceps

Examples

Run this code
# NOT RUN {
## Generate a sine of frequency 45 Hz, sampled at 100 Hz.
fs <- 100
t <- seq(0, 1.27, 1/fs)
s1 <- sin(2 * pi * 45 * t)
## Add an echo with half the amplitude and 0.2 s later.
s2 <- s1 + 0.5 * c(rep(0L, 20), s1[1:108])
## Compute the complex cepstrum of the signal. Notice the echo at 0.2 s.
cep <- cceps(s2)
plot(t, cep, type="l")

# }

Run the code above in your browser using DataLab