new_swdft_matching_demod function

Constructor function for class 'swdft_matching_demod'

Constructor function for class 'swdft_matching_demod'

new_swdft_matching_demod(x, n, fitted, thresh, max_cycles, smooth, order, passfreqs, maxvals, freqs, khats, amps, phases, demods, cycle, resids, fits, return_rows)

Arguments

  • x: numeric. Signal to demodulate
  • n: integer. Window size for SWDFT
  • fitted: fitted values
  • thresh: numeric. Threshold to determine whether to continue demodulating
  • max_cycles: maximum number of demodulation cycles
  • 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
  • passfreqs: pass frequency used in each iteration
  • maxvals: Maximum SWDFT coefficient for each iteration
  • freqs: Frequencies used in each iteration
  • khats: Integer version of frequency.
  • amps: Instantaneous amplitude for each iteration
  • phases: Instantaneous phase for each iteration
  • demods: List of demodulated signal and smoothed demodulated signal for each iteration
  • cycle: Number of cycles used
  • resids: Residuals for each iteration
  • fits: Fitted values for each iteration
  • return_rows: Logical vector indicating which iterations occurred. Used for subsetting.

Returns

list with the following elements

  • coefficients. coefficients from the R local signals with time-varying amplitude and phase model.
  • fitted. fitted values of cosine regression model
  • residuals. residuals of cosine regression model
  • data. original signal used to fit cosine regression
  • smooth. list with the filter used ('smooth') and parameters ('order' for 'ma' or 'double_ma', 'passfreq' for butterworth)
  • demod. list w/ the demodulated signal, and smoothed demodulated signal
  • thresh. Threshold used.
  • iterations. List of fits, residuals, and maximum values for each iteration
  • Maintainer: Lee F. Richardson
  • License: MIT + file LICENSE
  • Last published: 2019-04-17

Useful links