new_swdft_demod {swdft} | R Documentation |
Constructor function for class 'swdft_demod'
Description
Constructor function for class 'swdft_demod'
Usage
new_swdft_demod(x, f0, A_t, Phi_t, fitted, y, y_smooth, smooth, order,
passfreq)
Arguments
x |
numeric vector |
f0 |
numeric scalar. Frequency to demodulate |
A_t |
extracted amplitude from y_smooth |
Phi_t |
extracted phase from y_smooth |
fitted |
fitted values |
y |
non-smoothed demodulated signal |
y_smooth |
smoothed demodulated signal |
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 frequency used as the passfreq in the low-pass filter |
Value
list with the following elements
coefficients. A matrix of parameters, the three columns are: 1. amplitude 2. phase, and 3. frequency. There is only more that one row used when multiple frequencies are fit sequentially.
fitted. fitted values of cosine regression model
residuals. residuals of cosine regression model
data. original signal used to fit cosine regression
list with the filter used ('smooth') and parameters ('order' for 'ma' or 'double_ma', 'passfreq' for butterworth)
list w/ the demodulated signal, and smoothed demodulated signal