hsignal-0.1.2.5: Signal processing and EEG data analysis

Portability uses FFI provisional haskell.vivian.mcphail gmail com

Numeric.Signal

Description

Signal processing functions

Synopsis

# Filtering

Arguments

 :: Int length -> Vector Double the Hamming coeffficents

coefficients of a Hamming window

Arguments

 :: Int sampling rate -> Int window size -> Vector Double input signal -> (Vector Double, Vector Double) (frequency index,power density)

Welch (1967) power spectrum density using periodogram/FFT method

Arguments

 :: Int order (one less than the length of the filter) -> [(Double, Double)] band edge frequency, nondecreasing, [0, f1, ..., f(n-1), 1] ^ band edge magnitude -> Int grid spacing -> Int transition width -> Vector Double smoothing window (size is order + 1) -> Vector Double the filter coefficients

produce an FIR filter

standard_fir :: Int -> [(Double, Double)] -> Vector DoubleSource

standard FIR filter | FIR filter with grid a power of 2 greater than the order, ramp = grid/16, hamming window

Arguments

 :: Int sampling rate -> (Int, Int) (lower,upper) frequency cutoff -> Vector Double filter coefficients

Arguments

 :: Vector Double zero coefficients -> Vector Double pole coefficients -> Int sampling rate -> Vector Double frequencies -> Vector Double frequency response

determine the frequency response of a filter, given a vector of frequencies

Arguments

 :: Vector Double zero coefficients -> Vector Double pole coefficients -> Int sampling rate -> Int number of points -> (Vector Double, Vector Double) (frequencies,response)

determine the frequency response of a filter, given a number of points and sampling rate

Arguments

 :: Vector Double zero coefficients -> Vector Double pole coefficients -> Int sampling rate -> Vector Double input signal -> Vector Double output signal

filters the signal

Arguments

 :: Int sampling rate -> (Int, Int) (lower,upper) frequency cutoff -> Vector Double input signal -> Vector Double output signal

# Analytic Signal

an analytic signal is the original signal with Hilbert-transformed signal as imaginary component

the power (amplitude^2 = v * (conj c)) of an analytic signal

the phase of an analytic signal

unwrap the phase of signal (input expected to be within (-pi,pi)

# Preprocessing

Arguments

 :: Int window size -> Vector Double data to be detrended -> Vector Double detrended data

remove a linear trend from data

take one sample from every n samples in the original

resize the vector to length n by resampling

# Utility functions

the difference between consecutive elements of a vector