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

Copyright(c) Henning Thielemann 2009
Portabilityrequires multi-parameter type classes
Safe HaskellNone



Two allpasses that approach a relative phase difference of 90 degree over a large range of frequencies.

ToDo: More parameters for controling the affected frequency range.



data Parameter a Source #




polesCosine :: C a => [a] Source #

polesSine :: C a => [a] Source #

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

Convert sample rate to allpass parameters.

step2 :: (C a, C a v) => Parameter a -> v -> State [T v] (T v) Source #

modifierInit2 :: (C a, C a v) => Initialized [T v] [T v] (Parameter a) v (T v) Source #

runInit2 :: (C a, C a v) => [T v] -> Parameter a -> T v -> T (T v) Source #

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

cascade :: (C a, C a v) => [Parameter a] -> T v v Source #

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

Although we get (almost) only the right-rotating part of the real input signal, the amplitude is as large as the input amplitude. That is, the amplitude actually doubled.

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

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

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

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

Approximation to perfect lowpass. However in the low frequencies the above filter is far away from being a perfect Hilbert filter, thus the cut is not straight as expected. This implementation is lazy, but shifts phases.

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

If we could achieve lowpass filtering while maintaining phases, we could do approximate Whittaker interpolation. Here we try to do this by filtering forward and backward. However, this does not work since we move the spectrum between two Hilbert transforms and thus the phase distortions do not match. It does not even yield a fine lowpass, since reversing the signal does not reverse the spectrum.