
Synthesizer.Plain.Filter.NonRecursive  Portability  requires multiparameter type classes  Stability  provisional  Maintainer  synthesizer@henningthielemann.de 





Description 


Synopsis 




Envelope application




amplifyVector :: C a v => a > T v > T v  Source 



:: C a   => T a  the envelope
 > T a  the signal to be enveloped
 > T a  



:: C a v   => T a  the envelope
 > T v  the signal to be enveloped
 > T v  






Shift






Smoothing



Unmodulated nonrecursive filter



Unmodulated nonrecursive filter
Output has same length as the input.
It is elegant but leaks memory.




gaussian :: (C a, C a, C a v) => a > a > a > T v > T v  Source 

eps is the threshold relatively to the maximum.
That is, if the gaussian falls below eps * gaussian 0,
then the function truncated.


binomial :: (C a, C a, C a v) => a > a > T v > T v  Source 


ratioFreqToVariance :: C a => a > a > a  Source 

Compute the variance of the Gaussian
such that its Fourier transform has value ratio at frequency freq.





Moving (uniformly weighted) average in the most trivial form.
This is very slow and needs about n * length x operations.







Given a list of numbers
and a list of sums of (2*k) of successive summands,
compute a list of the sums of (2*k+1) or (2*k+2) summands.
Eample for 2*k+1
[0+1+2+3, 2+3+4+5, 4+5+6+7, ...] >
[0+1+2+3+4, 1+2+3+4+5, 2+3+4+5+6, 3+4+5+6+7, 4+5+6+7+8, ...]
Example for 2*k+2
[0+1+2+3, 2+3+4+5, 4+5+6+7, ...] >
[0+1+2+3+4+5, 1+2+3+4+5+6, 2+3+4+5+6+7, 3+4+5+6+7+8, 4+5+6+7+8+9, ...]






Filter operators from calculus



Forward difference quotient.
Shortens the signal by one.
Inverts Synthesizer.Plain.Filter.Recursive.Integration.run in the sense that
differentiate (zero : integrate x) == x.
The signal is shifted by a half time unit.


differentiateCenter :: C v => T v > T v  Source 

Central difference quotient.
Shortens the signal by two elements,
and shifts the signal by one element.
(Which can be fixed by prepending an appropriate value.)
For linear functions this will yield
essentially the same result as differentiate.
You obtain the result of differentiateCenter
if you smooth the one of differentiate
by averaging pairs of adjacent values.
ToDo: Vector variant



Second derivative.
It is differentiate2 == differentiate . differentiate
but differentiate2 should be faster.


Produced by Haddock version 2.3.0 