Safe Haskell | None |
---|---|
Language | Haskell98 |
- saw :: (PseudoRing a, IntegerConstant a) => a -> CodeGenFunction r a
- square :: (PseudoRing a, IntegerConstant a, Fraction a) => a -> CodeGenFunction r a
- triangleSquarePower :: (PseudoRing a, RationalConstant a, Real a) => Integer -> a -> CodeGenFunction r a
- triangleSquareRatio :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a
- triangle :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a
- approxSine2 :: (PseudoRing a, IntegerConstant a, Fraction a) => a -> CodeGenFunction r a
- approxSine3 :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a
- approxSine4 :: (PseudoRing a, RationalConstant a, Real a) => a -> CodeGenFunction r a
- rationalApproxCosine1 :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a
- rationalApproxSine1 :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a
- trapezoidSkew :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a
- sine :: (Transcendental a, RationalConstant a) => a -> CodeGenFunction r a
- replicate :: (PseudoRing a, RationalConstant a, Fraction a) => a -> a -> CodeGenFunction r a
- halfEnvelope :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a
- partial :: (Fraction v, PseudoRing v, IntegerConstant v) => (v -> CodeGenFunction r v) -> Int -> v -> CodeGenFunction r v
Documentation
saw :: (PseudoRing a, IntegerConstant a) => a -> CodeGenFunction r a Source
square :: (PseudoRing a, IntegerConstant a, Fraction a) => a -> CodeGenFunction r a Source
triangleSquarePower :: (PseudoRing a, RationalConstant a, Real a) => Integer -> a -> CodeGenFunction r a Source
Discrete interpolation between triangle and square wave. For exponent 1 we get a triangle wave. The larger the exponent, the more we approach a square wave, the.more computing is necessary.
triangleSquareRatio :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a Source
Continuous interpolation between triangle and square wave. For factor 0 we get a square wave, for factor 1 we get a triangle wave.
triangle :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a Source
approxSine2 :: (PseudoRing a, IntegerConstant a, Fraction a) => a -> CodeGenFunction r a Source
approxSine3 :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a Source
approxSine4 :: (PseudoRing a, RationalConstant a, Real a) => a -> CodeGenFunction r a Source
rationalApproxCosine1 :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a Source
For the distortion factor recip pi
you get the closest approximation
to an undistorted cosine or sine.
We have chosen this scaling in order to stay with field operations.
rationalApproxSine1 :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a Source
For the distortion factor recip pi
you get the closest approximation
to an undistorted cosine or sine.
We have chosen this scaling in order to stay with field operations.
trapezoidSkew :: (Field a, RationalConstant a, Real a) => a -> a -> CodeGenFunction r a Source
sine :: (Transcendental a, RationalConstant a) => a -> CodeGenFunction r a Source
replicate :: (PseudoRing a, RationalConstant a, Fraction a) => a -> a -> CodeGenFunction r a Source
This can be used for preprocessing the phase in order to generate locally faster oscillating waves. For example
triangle <=< replicate (valueOf 2.5)
shrinks a triangle wave such that 2.5 periods fit into one.
halfEnvelope :: (PseudoRing a, RationalConstant a, Fraction a) => a -> CodeGenFunction r a Source
Preprocess the phase such that the first half of a wave is expanded to one period and shifted by 90 degree. E.g.
sine <=< halfEnvelope
generates a sequence of sine bows that starts and ends with the maximum.
Such a signal can be used to envelope an oscillation
generated using replicate
.
partial :: (Fraction v, PseudoRing v, IntegerConstant v) => (v -> CodeGenFunction r v) -> Int -> v -> CodeGenFunction r v Source