synthesizer-core-0.8.1: Audio signal processing coded in Haskell: Low level part

Copyright (c) Henning Thielemann 2006-2009 GPL synthesizer@henning-thielemann.de provisional requires multi-parameter type classes None Haskell2010

Synthesizer.Plain.Filter.NonRecursive

Description

Synopsis

# Documentation

amplify :: C a => a -> T a -> T a Source #

amplifyVector :: C a v => a -> T v -> T v Source #

binomial :: (C a, C a, C a v) => a -> a -> T v -> T v Source #

binomial1 :: C v => T v -> T v Source #

delay :: C y => Int -> T y -> T y Source #

delayPad :: y -> Int -> T y -> T y Source #

differentiate :: C v => T v -> T v Source #

Forward difference quotient. Shortens the signal by one. Inverts run in the sense that differentiate (zero : integrate x) == x. The signal is shifted by a half time unit.

differentiate2 :: C v => T v -> T v Source #

Second derivative. It is differentiate2 == differentiate . differentiate but differentiate2 should be faster.

differentiateCenter :: C v => T v -> T v Source #

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

downsample2 :: T a -> T a Source #

Arguments

 :: C a => T a the envelope -> T a the signal to be enveloped -> T a

Arguments

 :: C a v => T a the envelope -> T v the signal to be enveloped -> T v

fadeInOut :: C a => Int -> Int -> Int -> T a -> T a Source #

fadeInOutAlt :: C a => Int -> Int -> Int -> T a -> T a Source #

gaussian :: (C a, C a, C a v) => a -> a -> a -> T v -> T v Source #

eps is the threshold relatively to the maximum. That is, if the gaussian falls below eps * gaussian 0, then the function truncated.

generic :: C a v => T a -> T v -> T v Source #

Unmodulated non-recursive filter

genericAlt :: C a v => T a -> T v -> T v Source #

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

It is elegant but leaks memory.

minRange :: Ord v => T v -> (Int, Int) -> v Source #

movingAverageModulatedPyramid :: (C a, C a v) => a -> Int -> Int -> T Int -> T v -> T v Source #

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.

A control value n corresponds to filter window size 2*n+1.

sumRange :: C v => T v -> (Int, Int) -> v Source #

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.

sumRangeFromPyramid :: C v => [T v] -> (Int, Int) -> v Source #

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.

sums :: C v => Int -> T v -> T v Source #

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 v Source #

sumsPosModulated :: C v => T (Int, Int) -> T v -> T v Source #

sumsPosModulatedPyramid :: C v => Int -> T (Int, Int) -> T v -> T v Source #

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

The laziness granularity is 2^height.

sumsPyramid :: C v => Int -> T v -> T v Source #

propGeneric :: (C a v, Eq v) => T a -> T v -> Bool Source #

sumRangeFromPyramidFoldr :: C v => [T v] -> (Int, Int) -> v Source #

sumRangeFromPyramidRec :: C v => [T v] -> (Int, Int) -> v Source #

getRangeFromPyramid :: [T v] -> (Int, Int) -> [v] Source #

pyramid :: C v => T v -> [T v] Source #