fourier {jmuOutlier}R Documentation

Determining and Graphing Fourier Approximation

Description

The Fourier approximation is determined for any function on domain (0, 2\pi) and then graphed.

Usage

fourier(f, order = 3, ...)

Arguments

f

The function to be approximated by Fourier analysis.

order

Integer; the order of the Fourier transformation.

...

Optional arguments to be passed to the plot function (see par).

Details

The numerical output consists of a_0/2, a_1, ..., a_n, b_1, ..., b_2. The equation is (constant) + a_1 cos(x) + ... + a_n cos(n x) + b_1 sin(x) + ... + b_n sin(n x).

Value

constant

The constant term.

cosine.coefficients

The coefficients for the cosine terms.

sine.coefficients

The coefficients for the sine terms.

Note

The formulas computed within fourier are based on the textbook by Larson (2013).

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

References

Larson, R. (2013) Elementary Linear Algebra, 7th edition.

Examples

par( mfrow=c(2,2) )
fourier( function(x){ exp(-x)*(x-pi) }, 4 )
fourier( function(x){ exp(-x) }, 7 )
fourier( function(x){ (x-pi) }, 5 )
fourier( function(x){ (x-pi)^2 } )
par( mfrow=c(1,1) )

[Package jmuOutlier version 2.2 Index]