Portability | portable |
---|---|
Stability | experimental |
Safe Haskell | Safe-Inferred |
Window for time series analysis.
Later these shall relate to memory and FPGA internal registers in hardware...
- newtype Window = Window (UArray Word64 Double)
- type Size = Word64
- data RandomVector = RandomVector {}
- fromList :: [Double] -> Window
- toList :: Window -> [Double]
- empty :: Size -> Window
- push :: Double -> Window -> Window
- singleton :: Double -> Window
- norm :: Window -> Window -> Double
- append :: Window -> Window -> Window
- sumWindow :: Window -> Double
- sumSqWindow :: Window -> Double
- dotp :: Window -> Window -> Double
- dotps :: [Window] -> Window -> Window
- copyContents :: Window -> Window -> Window
- randomVector :: Integer -> Size -> Size -> RandomVector
- wholeRandomVector :: RandomVector -> Window
- pretty :: Window -> String
- average :: Window -> Double
- variance :: Window -> Double
- length :: Window -> Int
Documentation
Newtype for windowd data.
Shall relate to memory contents in hardware.
Considering to restrict window size to power of 2, at least for initial phase.
push :: Double -> Window -> WindowSource
Put given Double
as first element, shifts all the other
element except for the last one, which being removed.
norm :: Window -> Window -> DoubleSource
Norm, by viewing window as vector.
>>>
let x = fromList [0,3,4]
>>>
let y = fromList [0,0,0]
>>>
distance x y
5.0
append :: Window -> Window -> WindowSource
Append two windows, with shifting the contents of second window. Last n elements of second window is removed, where n is number of elements in first window.
sumSqWindow :: Window -> DoubleSource
Sums up square of window elements.
Copy contents of window to another.
:: Integer | Random seed. |
-> Size | bw, size of basic window. |
-> Size | nb, size of control vector. |
-> RandomVector |
Create window for random vectors.
:: RandomVector | Random vector used to convolve the contents. |
-> Window | Random vector with size bw * nb. |
Create whole random vector from RandomVector
.
Unit random vector and control vector in given RandomVector
is
convolved.