synthesizer-core-0.2.1: Audio signal processing coded in Haskell: Low level partSource codeContentsIndex
Synthesizer.Plain.Filter.NonRecursive
Portabilityrequires multi-parameter type classes
Stabilityprovisional
Maintainersynthesizer@henning-thielemann.de
Contents
Envelope application
Shift
Smoothing
Filter operators from calculus
Description
Synopsis
amplify :: C a => a -> T a -> T a
amplifyVector :: C a v => a -> T v -> T v
envelope :: C a => T a -> T a -> T a
envelopeVector :: C a v => T a -> T v -> T v
fadeInOut :: C a => Int -> Int -> Int -> T a -> T a
fadeInOutAlt :: C a => Int -> Int -> Int -> T a -> T a
delay :: C y => Int -> T y -> T y
delayPad :: y -> Int -> T y -> T y
generic :: C a v => T a -> T v -> T v
genericAlt :: C a v => T a -> T v -> T v
propGeneric :: (C a v, Eq v) => T a -> T v -> Bool
gaussian :: (C a, C a, C a v) => a -> a -> a -> T v -> T v
binomial :: (C a, C a, C a v) => a -> a -> T v -> T v
ratioFreqToVariance :: C a => a -> a -> a
binomial1 :: C v => T v -> T v
sums :: C v => Int -> T v -> T v
sumsDownsample2 :: C v => T v -> T v
downsample2 :: T a -> T a
sumsUpsampleOdd :: C v => Int -> T v -> T v -> T v
sumsUpsampleEven :: C v => Int -> T v -> T v -> T v
sumsPyramid :: C v => Int -> T v -> T v
sumRange :: C v => T v -> (Int, Int) -> v
pyramid :: C v => T v -> [T v]
sumRangePrepare :: C v => ((Int, Int) -> source -> v) -> source -> (Int, Int) -> v
sumRangeFromPyramid :: C v => [T v] -> (Int, Int) -> v
sumRangeFromPyramidRec :: C v => [T v] -> (Int, Int) -> v
sumsPosModulated :: C v => T (Int, Int) -> T v -> T v
sumsPosModulatedPyramid :: C v => Int -> T (Int, Int) -> T v -> T v
movingAverageModulatedPyramid :: (C a, C a v) => a -> Int -> Int -> T Int -> T v -> T v
differentiate :: C v => T v -> T v
differentiateCenter :: C v => T v -> T v
differentiate2 :: C v => T v -> T v
Envelope application
amplify :: C a => a -> T a -> T aSource
amplifyVector :: C a v => a -> T v -> T vSource
envelopeSource
:: C a
=> T athe envelope
-> T athe signal to be enveloped
-> T a
envelopeVectorSource
:: C a v
=> T athe envelope
-> T vthe signal to be enveloped
-> T v
fadeInOut :: C a => Int -> Int -> Int -> T a -> T aSource
fadeInOutAlt :: C a => Int -> Int -> Int -> T a -> T aSource
Shift
delay :: C y => Int -> T y -> T ySource
delayPad :: y -> Int -> T y -> T ySource
Smoothing
generic :: C a v => T a -> T v -> T vSource
Unmodulated non-recursive filter
genericAlt :: C a v => T a -> T v -> T vSource

Unmodulated non-recursive filter Output has same length as the input.

It is elegant but leaks memory.

propGeneric :: (C a v, Eq v) => T a -> T v -> BoolSource
gaussian :: (C a, C a, C a v) => a -> a -> a -> T v -> T vSource
eps is the threshold relatively to the maximum. That is, if the gaussian falls below eps * gaussian 0, then the function truncated.
binomial :: (C a, C a, C a v) => a -> a -> T v -> T vSource
ratioFreqToVariance :: C a => a -> a -> aSource
Compute the variance of the Gaussian such that its Fourier transform has value ratio at frequency freq.
binomial1 :: C v => T v -> T vSource
sums :: C v => Int -> T v -> T vSource
Moving (uniformly weighted) average in the most trivial form. This is very slow and needs about n * length x operations.
sumsDownsample2 :: C v => T v -> T vSource
downsample2 :: T a -> T aSource
sumsUpsampleOdd :: C v => Int -> T v -> T v -> T vSource

Given a list of numbers and a list of sums of (2*k) of successive summands, compute a list of the sums of (2*k+1) or (2*k+2) summands.

Example for 2*k+1

 [0+1+2+3, 2+3+4+5, 4+5+6+7, ...] ->
    [0+1+2+3+4, 1+2+3+4+5, 2+3+4+5+6, 3+4+5+6+7, 4+5+6+7+8, ...]

Example for 2*k+2

 [0+1+2+3, 2+3+4+5, 4+5+6+7, ...] ->
    [0+1+2+3+4+5, 1+2+3+4+5+6, 2+3+4+5+6+7, 3+4+5+6+7+8, 4+5+6+7+8+9, ...]
sumsUpsampleEven :: C v => Int -> T v -> T v -> T vSource
sumsPyramid :: C v => Int -> T v -> T vSource
sumRange :: C v => T v -> (Int, Int) -> vSource
Compute the sum of the values from index l to (r-1). (I.e. somehow a right open interval.) This can be used for implementation of a moving average filter. However, its counterpart sumRangeFromPyramid is much faster for large windows.
pyramid :: C v => T v -> [T v]Source
sumRangePrepare :: C v => ((Int, Int) -> source -> v) -> source -> (Int, Int) -> vSource
sumRangeFromPyramid :: C v => [T v] -> (Int, Int) -> vSource
This function should be much faster than sumRange but slower than the recursively implemented movingAverage. However in contrast to movingAverage it should not suffer from cancelation.
sumRangeFromPyramidRec :: C v => [T v] -> (Int, Int) -> vSource
sumsPosModulated :: C v => T (Int, Int) -> T v -> T vSource
sumsPosModulatedPyramid :: C v => Int -> T (Int, Int) -> T v -> T vSource

Moving average, where window bounds must be always non-negative.

The laziness granularity is 2^height.

movingAverageModulatedPyramid :: (C a, C a v) => a -> Int -> Int -> T Int -> T v -> T vSource
The first argument is the amplification. The main reason to introduce it, was to have only a Module constraint instead of Field. This way we can also filter stereo signals.
Filter operators from calculus
differentiate :: C v => T v -> T vSource
Forward difference quotient. Shortens the signal by one. Inverts Synthesizer.Plain.Filter.Recursive.Integration.run in the sense that differentiate (zero : integrate x) == x. The signal is shifted by a half time unit.
differentiateCenter :: C v => T v -> T vSource

Central difference quotient. Shortens the signal by two elements, and shifts the signal by one element. (Which can be fixed by prepending an appropriate value.) For linear functions this will yield essentially the same result as differentiate. You obtain the result of differentiateCenter if you smooth the one of differentiate by averaging pairs of adjacent values.

ToDo: Vector variant

differentiate2 :: C v => T v -> T vSource
Second derivative. It is differentiate2 == differentiate . differentiate but differentiate2 should be faster.
Produced by Haddock version 2.4.2