genIntegratedharmonic {miscFuncs} | R Documentation |
genIntegratedharmonic function
Description
A function to generate basis vectors for integrated Fourier series.
Usage
genIntegratedharmonic(
df,
t1name,
t2name,
base,
num,
sname = "bcoef",
cname = "acoef",
power = FALSE
)
Arguments
df |
a data frame containing a numeric time variable of interest |
t1name |
a character string, the name of the variable in df containing the start time of the intervals |
t2name |
a character string, the name of the variable in df containing the end time of the intervals |
base |
the fundamental period of the signal, e.g. if it repeats over 24 hours and time is measured in hours, then put 'base = 24'; if the period is 24 hours but time is measured in days, then use 'base = 1/7' |
num |
number of sin and cosine terms to compute |
sname |
character string, name for cosine terms in Fourier series (not integrated) |
cname |
character string, name for sine terms in Fourier series (not integrated) |
power |
legacy functionality, not used here |
Details
If the non-integrated Fourier series is:
f(t) = sum_k a_k sin(2 pi k t / P) + b_k cos(2 pi k t / P)
then
int_t1^t2 f(s) ds = sum_k a_k (base/(2 pi k))*(cos(2 pi k t1 / P) - cos(2 pi k t2 / P)) +
b_k (base/(2 pi k))*(sin(2 pi k t2 / P)-sin(2 pi k t1 / P))
where P is the funcamental period, or 'base', as referred to in the function arguments
Value
a data frame containing the start and end time vectors, together with the sin and cosine terms