periodic-polynomials-0.1.0.0: A library for working with periodic polynomials (very basic functionality)

Safe HaskellNone
LanguageHaskell2010

Data.Periodic

Contents

Synopsis

The simplest finite periodic polynomials

polyG1 :: Floating a => (a -> a) -> (a -> a) -> Vector a -> a -> a Source #

The first function f :: a -> a is applied to the vector to produce weighted coefficients for the sum and the second one g :: a -> a is used as a basis function. Among possible variants there are finite trigonometric polynomials. See, as examples trigPolySin and trigPolyCos functions.

trigPolyCos :: Floating a => (a -> a) -> Vector a -> a -> a Source #

A finite trigonometric polynomial of cosinuses. The Vector argument is used to produce its coefficients (weights) by applying to each of the element the function f:: a -> a given as the first argument.

trigPolySin :: Floating a => (a -> a) -> Vector a -> a -> a Source #

A finite trigonometric polynomial of sinuses. The Vector argument is used to produce its coefficients (weights) by applying to each of the element the function f:: a -> a given as the first argument.

trigPoly :: Floating a => (a -> a) -> Vector a -> (a -> a) -> Vector a -> a -> a Source #

Sum of the sine and cosine finite trigonometric polynomials. Can represent a Fourier series (without the first coefficient), but no numerical high accuracy is guaranteed.

Periodizer functions

periodizer :: RealFrac a => (a -> b) -> a -> a -> a -> b Source #

Makes a function a periodic one with the period given by the third argument and the starting point given by the second argument.

concatPeriodizer :: (RealFrac a, Num b) => (a -> b) -> a -> a -> a -> b Source #

Modified periodizer that tries to concat the pieces of the function so that it can be in general continuous. Needs more mathematical studies.

Periodizer applications

polyG2 :: RealFrac a => (a -> a) -> (a -> a) -> a -> a -> Vector a -> a -> a Source #

Instead of simply use the second function in polyG1 it applies to it a periodizer with the given arguments.

polyG3 :: RealFrac a => (a -> a) -> (a -> a) -> a -> a -> Vector a -> a -> a Source #

Instead of simply use the second function in polyG1 it applies to it a concatPeriodizer with the given arguments.