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

Copyright(c) Henning Thielemann 2009
LicenseGPL
Maintainersynthesizer@henning-thielemann.de
Stabilityprovisional
Portabilityrequires multi-parameter type classes
Safe HaskellNone
LanguageHaskell2010

Synthesizer.Plain.Filter.Recursive.Hilbert

Description

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.

Synopsis

Documentation

data Parameter a

Constructors

Parameter 

Instances

Show a => Show (Parameter a) 

polesCosine :: C a => [a]

polesSine :: C a => [a]

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

Convert sample rate to allpass parameters.

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

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

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

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

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)

scaleWithParamType :: C a v => Parameter a -> a -> v -> v

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

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

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

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

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

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

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.