Skip to contents

Multiplies x by exp(-j 2 pi fc t), low-passes via Butterworth (requires signal), and returns envelope and unwrapped phase.

Usage

morie_dsp_complex_demodulation(x, fc, fs = 1)

Arguments

x

Numeric vector.

fc

Carrier frequency (Hz).

fs

Sampling frequency (Hz). Default 1.

Value

List with envelope and phase, both length(x).

References

Rangayyan & Krishnan (2015), Ch. 5, sec. 5.8.

Examples

set.seed(1)
t <- seq(0, 2, by = 1 / 200)
x <- sin(2 * pi * 10 * t) * (1 + 0.5 * sin(2 * pi * 0.5 * t))
str(morie_dsp_complex_demodulation(x, fc = 10, fs = 200), max.level = 1)
#> List of 2
#>  $ envelope: num [1:401] 0.0135 0.0685 0.1253 0.1832 0.2415 ...
#>  $ phase   : num [1:401] 0 -0.314 -0.628 -0.942 -1.257 ...