Safe Haskell | None |
---|
- quantize :: ArrowInit a => Int -> Int -> a b (SEvent [b])
- presentFFT :: Double -> [Double] -> Map Double Double
- fftA :: ArrowInit a => Int -> Int -> a Double (SEvent [Double])
Documentation
quantize :: ArrowInit a => Int -> Int -> a b (SEvent [b])Source
Alternative for working with Math.FFT instead of Numeric.FFT import qualified Math.FFT as FFT import Data.Array.IArray import Data.Array.CArray myFFT n lst = elems $ (FFT.dft) (listArray (0, n-1) lst)
Returns n samples of type b from the input stream at a time, updating after k samples. This function is good for chunking data and is a critical component to fftA
presentFFT :: Double -> [Double] -> Map Double DoubleSource
Converts the vector result of a dft into a map from frequency to magnitude. One common use is: fftA >>> arr (fmap $ presentFFT clockRate)
fftA :: ArrowInit a => Int -> Int -> a Double (SEvent [Double])Source
Given a quantization frequency (the number of samples between each successive FFT calculation) and a fundamental period, this will decompose the input signal into its constituent frequencies. NOTE: The fundamental period must be a power of two!