synthesizer-0.2.0.1: Audio signal processing coded in HaskellSource codeContentsIndex
Synthesizer.SampleRateContext.Noise
Portabilityrequires multi-parameter type classes
Stabilityprovisional
Maintainersynthesizer@henning-thielemann.de
Description
Synopsis
white :: (C yv, Random yv, C q') => q' -> q' -> T t q' -> T y q' yv
whiteBandEnergy :: (C yv, Random yv, C q') => q' -> T t q' -> T y q' yv
randomPeeks :: (C q, Random q, Ord q, C q', C q q') => T q q' -> T q q' q -> [Bool]
whiteGen :: (C yv, Random yv, RandomGen g, C q') => g -> q' -> q' -> T t q' -> T y q' yv
whiteBandEnergyGen :: (C yv, Random yv, RandomGen g, C q') => g -> q' -> T t q' -> T y q' yv
randomPeeksGen :: (C q, Random q, Ord q, C q', C q q', RandomGen g) => g -> T q q' -> T q q' q -> [Bool]
Documentation
whiteSource
:: (C yv, Random yv, C q')
=> q'width of the frequency band
-> q'volume caused by the given frequency band
-> T t q'
-> T y q' yvnoise

Uniformly distributed white noise. The volume is given by two values: The width of a frequency band and the volume caused by it. The width of a frequency band must be given in order to achieve independence from sample rate.

See whiteBandEnergy.

whiteBandEnergySource
:: (C yv, Random yv, C q')
=> q'energy per frequency band
-> T t q'
-> T y q' yvnoise

Uniformly distributed white noise. Instead of an amplitude you must specify a value that is like an energy per frequency band. It makes no sense to specify an amplitude because if you keep the same signal amplitude while increasing the sample rate by a factor of four the amplitude of the frequency spectrum halves. Thus deep frequencies would be damped when higher frequencies enter.

Example: If your signal is a function from time to voltage, the amplitude must have the unit volt^2*second, which can be also viewed as volt^2/hertz.

Note that the energy is proportional to the square of the signal amplitude. In order to double the noise amplitude, you must increase the energy by a factor of four.

Using this notion of amplitude the behaviour amongst several frequency filters is quite consistent but a problem remains: When the noise is quantised then noise at low sample rates and noise at high sample rates behave considerably different. This indicates that quantisation should not just pick values, but it should average over the hold periods.

randomPeeksSource
:: (C q, Random q, Ord q, C q', C q q')
=> T q q'
-> T q q' qmomentary densities (frequency), p means that there is about one peak in the time range of 1/p.
-> [Bool]Every occurence of True represents a peak.
whiteGenSource
:: (C yv, Random yv, RandomGen g, C q')
=> grandom generator, can be used to choose a seed
-> q'width of the frequency band
-> q'volume caused by the given frequency band
-> T t q'
-> T y q' yvnoise
whiteBandEnergyGenSource
:: (C yv, Random yv, RandomGen g, C q')
=> grandom generator, can be used to choose a seed
-> q'energy per frequency band
-> T t q'
-> T y q' yvnoise
randomPeeksGenSource
:: (C q, Random q, Ord q, C q', C q q', RandomGen g)
=> grandom generator, can be used to choose a seed
-> T q q'
-> T q q' qmomentary densities (frequency), p means that there is about one peak in the time range of 1/p.
-> [Bool]Every occurence of True represents a peak.
Produced by Haddock version 2.4.2