complex_demod function

Complex Demodulation

Complex Demodulation

complex_demod(x, f0, smooth = "butterworth", order = 5, passfreq = 0.1, match_swdft = FALSE, window_size = NULL)

Arguments

  • x: numeric vector
  • f0: numeric scalar. Frequency to demodulate
  • smooth: character. Type of smoothing to use, accepts either 'ma', 'double_ma', or 'butterworth' (the default)
  • order: moving average parameter if 'smooth' argument equals 'ma' or 'double_ma'. Defaults to 5
  • passfreq: numeric scalar. Pass frequency used in butterworth low-pass filter. Defaults to .1 which corresponds to a pass frequency of 2 * f0.
  • match_swdft: logical. Only used to demonstrate equivalence w/ SWDFT when a moving average filter is used. Otherwise, never used.
  • window_size: defaults to NULL, only used when match_swdft=TRUE, so can ignore.

Returns

An S3 'swdft_demod' object. See ?new_swdft_matching_demod for details.

References

Chapter 7 of 'Fourier Analysis of Time-Series' by Peter Bloomfield and this blog post: https://dankelley.github.io/r/2014/02/17/demodulation.html for the idea of using a butterworth filter.

  • Maintainer: Lee F. Richardson
  • License: MIT + file LICENSE
  • Last published: 2019-04-17

Useful links