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

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

Synthesizer.Plain.Filter.Recursive.Allpass

Description

 

Synopsis

Documentation

newtype Parameter a Source #

Constructors

Parameter

Feedback factor.

Fields

Instances

Functor Parameter Source # 

Methods

fmap :: (a -> b) -> Parameter a -> Parameter b #

(<$) :: a -> Parameter b -> Parameter a #

Applicative Parameter Source # 

Methods

pure :: a -> Parameter a #

(<*>) :: Parameter (a -> b) -> Parameter a -> Parameter b #

(*>) :: Parameter a -> Parameter b -> Parameter b #

(<*) :: Parameter a -> Parameter b -> Parameter a #

Foldable Parameter Source # 

Methods

fold :: Monoid m => Parameter m -> m #

foldMap :: Monoid m => (a -> m) -> Parameter a -> m #

foldr :: (a -> b -> b) -> b -> Parameter a -> b #

foldr' :: (a -> b -> b) -> b -> Parameter a -> b #

foldl :: (b -> a -> b) -> b -> Parameter a -> b #

foldl' :: (b -> a -> b) -> b -> Parameter a -> b #

foldr1 :: (a -> a -> a) -> Parameter a -> a #

foldl1 :: (a -> a -> a) -> Parameter a -> a #

toList :: Parameter a -> [a] #

null :: Parameter a -> Bool #

length :: Parameter a -> Int #

elem :: Eq a => a -> Parameter a -> Bool #

maximum :: Ord a => Parameter a -> a #

minimum :: Ord a => Parameter a -> a #

sum :: Num a => Parameter a -> a #

product :: Num a => Parameter a -> a #

Traversable Parameter Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Parameter a -> f (Parameter b) #

sequenceA :: Applicative f => Parameter (f a) -> f (Parameter a) #

mapM :: Monad m => (a -> m b) -> Parameter a -> m (Parameter b) #

sequence :: Monad m => Parameter (m a) -> m (Parameter a) #

C a v => C a (Parameter v) Source # 
Show a => Show (Parameter a) Source # 
Storable a => Storable (Parameter a) Source # 

Methods

sizeOf :: Parameter a -> Int #

alignment :: Parameter a -> Int #

peekElemOff :: Ptr (Parameter a) -> Int -> IO (Parameter a) #

pokeElemOff :: Ptr (Parameter a) -> Int -> Parameter a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Parameter a) #

pokeByteOff :: Ptr b -> Int -> Parameter a -> IO () #

peek :: Ptr (Parameter a) -> IO (Parameter a) #

poke :: Ptr (Parameter a) -> Parameter a -> IO () #

type State v = (v, v) Source #

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

Choose one of the implementations below

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

cascadeModifier :: (C a, C a v) => Int -> Simple [v] (Parameter a) v v Source #

cascadeParameter Source #

Arguments

:: C a 
=> Int

The number of equally designed 1st order allpasses.

-> a

The phase shift to be achieved for the given frequency.

-> a

The frequency we specified the phase shift for.

-> Parameter a 

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

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

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

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

firstOrderModifier :: (C a, C a v) => Simple (State v) (Parameter a) v v Source #

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

makePhase :: (C a, C a) => Parameter a -> a -> a Source #

Compute phase shift of an allpass at a given frequency.

parameter Source #

Arguments

:: C a 
=> a

The phase shift to be achieved for the given frequency.

-> a

The frequency we specified the phase shift for.

-> Parameter a 

Compute the filter parameter such that a given phase shift is achieved at a certain frequency.

Both frequency and phase are with respect to unit 1. This is conform to Phase definition and allows to avoid Transcendental constraint in some cases since we need no factor 2*pi. See for instance parameterApprox. However, it is intended that the phase parameter is not of type Phase, because for the cascadeParameter we divide by the cascade order and then there is a difference between phase pi and 3*pi.

parameterApprox Source #

Arguments

:: C a 
=> a

The phase shift to be achieved for the given frequency.

-> a

The frequency we specified the phase shift for.

-> Parameter a 

An approximation to parameter for small phase and frequency values. It needs only field operations due to our choice of the unit 1 for the phase parameter.

parameterAlt Source #

Arguments

:: C a 
=> a

The phase shift to be achieved for the given frequency.

-> a

The frequency we specified the phase shift for.

-> Parameter a 

This is the same as parameter, but for phase = frequency it has a division of a zero by a zero of multiplicity 2, whereas parameter has a division of a non-zero number by zero. Thus parameter suffers less from cancellation if phase is close to frequency.

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

Simulate the Allpass cascade by a list of states of the partial allpasses

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

Directly implement the allpass cascade as multiple application of allpasses of 1st order

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

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

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

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

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