| Copyright | (c) Alexander Vivian Hugh McPhail 2010 2014 2015 2016 |
|---|---|
| License | BSD3 |
| Maintainer | haskell.vivian.mcphail <at> gmail <dot> com |
| Stability | provisional |
| Portability | uses Concurrency |
| Safe Haskell | None |
| Language | Haskell98 |
Numeric.Signal.Multichannel
Description
Signal processing functions, multichannel datatype
link with '-threaded' and run with +RTS -Nn, where n is the number of CPUs
- data Multichannel a
- readMultichannel :: Binary (Multichannel a) => FilePath -> IO (Multichannel a)
- writeMultichannel :: Binary (Multichannel a) => FilePath -> Multichannel a -> IO ()
- createMultichannel :: Storable a => Int -> Int -> [Vector a] -> Multichannel a
- sampling_rate :: Multichannel a -> Int
- precision :: Multichannel a -> Int
- channels :: Multichannel a -> Int
- samples :: Multichannel a -> Int
- detrended :: Multichannel a -> Bool
- filtered :: Multichannel a -> Maybe (Int, Int)
- getChannel :: Int -> Multichannel a -> Vector a
- getChannels :: Multichannel a -> Array Int (Vector a)
- toMatrix :: Element a => Multichannel a -> Matrix a
- mapConcurrently :: Storable b => (Vector a -> Vector b) -> Multichannel a -> Multichannel b
- detrend :: Int -> Multichannel Double -> Multichannel Double
- filter :: (Filterable a, Double ~ DoubleOf a) => (Int, Int) -> Multichannel a -> Multichannel a
- slice :: Storable a => Int -> Int -> Multichannel a -> Multichannel a
- histograms :: (Filterable a, Double ~ DoubleOf a) => Array Int (Vector a) -> Int -> (Double, Double) -> Int -> Int -> (Double, Double) -> (Double, Double) -> (Array Int Histogram, Array (Int, Int) Histogram2D)
- entropy_delta_phase :: (Filterable a, Double ~ DoubleOf a) => Multichannel a -> Matrix Double
- mi_phase :: (Filterable a, Double ~ DoubleOf a) => Multichannel a -> Matrix Double
Documentation
data Multichannel a Source #
data type with multiple channels
readMultichannel :: Binary (Multichannel a) => FilePath -> IO (Multichannel a) Source #
writeMultichannel :: Binary (Multichannel a) => FilePath -> Multichannel a -> IO () Source #
Arguments
| :: Storable a | |
| => Int | sampling rate |
| -> Int | bits of precision |
| -> [Vector a] | data |
| -> Multichannel a | datatype |
create a multichannel data type
sampling_rate :: Multichannel a -> Int Source #
the sampling rate
precision :: Multichannel a -> Int Source #
the bits of precision
channels :: Multichannel a -> Int Source #
the number of channels
samples :: Multichannel a -> Int Source #
the length, in samples
detrended :: Multichannel a -> Bool Source #
was the data detrended?
getChannel :: Int -> Multichannel a -> Vector a Source #
extract one channel
getChannels :: Multichannel a -> Array Int (Vector a) Source #
extract all channels
toMatrix :: Element a => Multichannel a -> Matrix a Source #
convert the data to a matrix with channels as rows
Arguments
| :: Storable b | |
| => (Vector a -> Vector b) | the function to be mapped |
| -> Multichannel a | input data |
| -> Multichannel b | output data |
map a function executed concurrently
detrend :: Int -> Multichannel Double -> Multichannel Double Source #
detrend the data with a specified window size
filter :: (Filterable a, Double ~ DoubleOf a) => (Int, Int) -> Multichannel a -> Multichannel a Source #
filter the data with the given passband
Arguments
| :: Storable a | |
| => Int | starting sample number |
| -> Int | length |
| -> Multichannel a | |
| -> Multichannel a |
extract a slice of the data
Arguments
| :: (Filterable a, Double ~ DoubleOf a) | |
| => Array Int (Vector a) | |
| -> Int | |
| -> (Double, Double) | |
| -> Int | |
| -> Int | |
| -> (Double, Double) | |
| -> (Double, Double) | bins and ranges |
| -> (Array Int Histogram, Array (Int, Int) Histogram2D) |
calculate histograms
Arguments
| :: (Filterable a, Double ~ DoubleOf a) | |
| => Multichannel a | input data |
| -> Matrix Double |
calculate the entropy of the phase difference between pairs of channels (fills upper half of matrix)
Arguments
| :: (Filterable a, Double ~ DoubleOf a) | |
| => Multichannel a | input data |
| -> Matrix Double |
calculate the mutual information of the phase between pairs of channels (fills upper half of matrix)