Learn R Programming

Momocs (version 0.1-03)

Outline: rfourier: Fourier Radius variation core functions.

Description

Provide facilities for radius angle Fourier analysis. rfourier computes Fourier coefficients from a set of coordinates; rfourier.i calculates a shape given a set of Fourier coefficients computed with rfourier; rfourier.shape calculates a "Fourier radius variation shape" given Fourier coefficients (see Details).

Usage

rfourier(coo, nb.h = 32, smooth.it = 0)
rfourier.i(rf, nb.pts=300, nb.h=length(rf$an))
rfourier.shape(an, bn, nb.h, nb.pts=80, alpha=2, plot=TRUE)

Arguments

coo
A list or matrix of coordinates.
nb.h
integer. The number of harmonics to calculate/use.
smooth.it
integer. The number of smoothing iterations to perform.
rf
A list with ao, an and bn components, typically as returned by rfourier.
an
numeric. A vector of harmonic coefficient(s).
bn
numeric. A vector of harmonic coefficient(s).
nb.pts
integer. The number of points to calculate.
alpha
numeric. The power coefficient associated with the (usually decreasing) amplitude of the Fourier coefficients (see the Details section in efourier).
plot
logical. Whether to plot the shape or only return the list of coordinates.

Value

  • Returns a list of coordinates.

Details

Given a closed outline, the radius $r$, taken as the distance from the outline barycentre and a given point of the outline, can be expressed as a periodic function of the angle $\theta$. Harmonics from $0$ to $k$ approximate the function $r(\theta)$: $$r(\theta)= \frac{1}{2}a_0 + \sum\limits_{n=1}^{k}a_k\cos(w_k\theta + b_k\sin(w_k\theta)$$ with: $$a_n = \frac{2}{p}\sum\limits_{n=1}^{p}r_i\cos(n\theta_i)$$ $$b_n = \frac{2}{p}\sum\limits_{n=1}^{p}r_i\sin(n\theta_i)$$ with $$a_0 = \sqrt{\frac{2}{p}}\sum\limits_{n=1}^{p}r_i$$ The $a_n$ and $b_n$ harmonic coefficients, extracted for every individual shape, are then used for multivariate analyses.

References

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

See Also

efourier, tfourier.

Examples

Run this code
rfourier.shape()

Run the code above in your browser using DataLab