Copyright | (c) Henning Thielemann 2008-2012 |
---|---|

License | GPL |

Maintainer | synthesizer@henning-thielemann.de |

Stability | provisional |

Portability | requires multi-parameter type classes |

Safe Haskell | None |

Language | Haskell2010 |

State variable filter. One filter that generates lowpass, bandpass, highpass, bandlimit at once.

## Synopsis

- data Parameter a = Parameter {}
- data Result a = Result {}
- type State v = (v, v)
- causal :: (C a, C a v) => T (Parameter a, v) (Result v)
- modifier :: (C a, C a v) => Simple (State v) (Parameter a) v (Result v)
- modifierInit :: (C a, C a v) => Initialized (State v) (v, v) (Parameter a) v (Result v)
- parameter :: C a => Pole a -> Parameter a
- parameterToSecondOrderLowpass :: C a => Parameter a -> Parameter a
- run :: (C a, C a v) => T (Parameter a) -> T v -> T (Result v)
- runInit :: (C a, C a v) => (v, v) -> T (Parameter a) -> T v -> T (Result v)
- step :: (C a, C a v) => Parameter a -> v -> State (State v) (Result v)
- parameterAlt :: C a => Pole a -> Parameter a
- parameterOld :: C a => Pole a -> Parameter a

# Documentation

## Instances

## Instances

Functor Result Source # | |

Applicative Result Source # | |

Foldable Result Source # | |

Defined in Synthesizer.Plain.Filter.Recursive.Universal fold :: Monoid m => Result m -> m # foldMap :: Monoid m => (a -> m) -> Result a -> m # foldr :: (a -> b -> b) -> b -> Result a -> b # foldr' :: (a -> b -> b) -> b -> Result a -> b # foldl :: (b -> a -> b) -> b -> Result a -> b # foldl' :: (b -> a -> b) -> b -> Result a -> b # foldr1 :: (a -> a -> a) -> Result a -> a # foldl1 :: (a -> a -> a) -> Result a -> a # elem :: Eq a => a -> Result a -> Bool # maximum :: Ord a => Result a -> a # minimum :: Ord a => Result a -> a # | |

Traversable Result Source # | |

C a v => C a (Result v) Source # | |

Defined in Synthesizer.Plain.Filter.Recursive.Universal | |

Storable a => Storable (Result a) Source # | |

Defined in Synthesizer.Plain.Filter.Recursive.Universal | |

C v => C (Result v) Source # | |

modifierInit :: (C a, C a v) => Initialized (State v) (v, v) (Parameter a) v (Result v) Source #

parameter :: C a => Pole a -> Parameter a Source #

The computation of the internal parameters is a bit complicated, but it fulfills the following properties:

- At the resonance frequency the band pass has 180 degree phase shift. This is also approximately the frequency where the filter has maximum output. Even more important, this is the frequency where the band limit filter works.
- At the resonance frequency highpass, lowpass, and bandpass
amplify by the factor
`resonance`

. - The lowpass amplifies the frequency zero by factor 1.
- The highpass amplifies the highest representable (Nyquist) frequency by the factor 1.
- The bandlimit amplifies both frequency zero and Nyquist frequency by factor one and cancels the resonance frequency.

parameterToSecondOrderLowpass :: C a => Parameter a -> Parameter a Source #

Convert parameters of universal filter to general second order filter parameters. Filtering with these parameters does not yield exactly the same result since the initial conditions are different.

step :: (C a, C a v) => Parameter a -> v -> State (State v) (Result v) Source #

Universal filter: Computes high pass, band pass, low pass in one go

parameterAlt :: C a => Pole a -> Parameter a Source #

The computation of the internal parameters is a bit complicated, but it fulfills the following properties:

- At the resonance frequency the band pass has 180 degree phase shift. This is also approximately the frequency where the filter has maximum output. Even more important, this is the frequency where the band limit filter works.
- At the resonance frequency highpass, lowpass, and bandpass
amplify by the factor
`resonance`

. - The lowpass amplifies the frequency zero by factor 1.
- The highpass amplifies the highest representable (Nyquist) frequency by the factor 1.
- The bandlimit amplifies both frequency zero and Nyquist frequency by factor one and cancels the resonance frequency.

parameterOld :: C a => Pole a -> Parameter a Source #

The computation of the internal parameters is a bit complicated, but it fulfills the following properties:

- At the resonance frequency the band pass has 180 degree phase shift. This is also approximately the frequency where the filter has maximum output. Even more important, this is the frequency where the band limit filter works.
- At the resonance frequency highpass, lowpass, and bandpass
amplify by the factor
`resonance`

. - The lowpass amplifies the frequency zero by factor 1.
- The highpass amplifies the highest representable (Nyquist) frequency by the factor 1.
- The bandlimit amplifies both frequency zero and Nyquist frequency by factor one and cancels the resonance frequency.