Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- volumeMaximum :: C y => T y -> y
- volumeEuclidean :: C y => T y -> y
- volumeEuclideanSqr :: C y => T y -> y
- volumeSum :: (C y, C y) => T y -> y
- volumeVectorMaximum :: (C y yv, Ord y) => T yv -> y
- volumeVectorEuclidean :: (C y, C y yv) => T yv -> y
- volumeVectorEuclideanSqr :: (C y, Sqr y yv) => T yv -> y
- volumeVectorSum :: (C y yv, C y) => T yv -> y
- bounds :: Ord y => T T y -> (y, y)
- histogramDiscreteArray :: T T Int -> (Int, T Int)
- histogramLinearArray :: C y => T T y -> (Int, T y)
- histogramDiscreteIntMap :: T T Int -> (Int, T Int)
- histogramLinearIntMap :: C y => T T y -> (Int, T y)
- histogramIntMap :: C y => y -> T T y -> (Int, T Int)
- directCurrentOffset :: C y => T y -> y
- scalarProduct :: C y => T y -> T y -> y
- centroid :: C y => T y -> y
- centroidAlt :: C y => T y -> y
- firstMoment :: C y => T y -> y
- average :: C y => T y -> y
- rectify :: C y => T y -> T y
- zeros :: (Ord y, C y) => T y -> T Bool
- data BinaryLevel
- binaryLevelFromBool :: Bool -> BinaryLevel
- binaryLevelToNumber :: C a => BinaryLevel -> a
- flipFlopHysteresis :: Ord y => (y, y) -> BinaryLevel -> T y -> T BinaryLevel
- flipFlopHysteresisStep :: Ord a => (a, a) -> BinaryLevel -> a -> BinaryLevel
- chirpTransform :: C y => y -> T y -> T y
- binarySign :: (Ord y, C y) => T y -> T BinaryLevel
- deltaSigmaModulation :: C y => T y -> T BinaryLevel
- deltaSigmaModulationPositive :: C y => y -> T y -> T y
- spread :: C y => (y, y) -> [(Int, y)]
Documentation
volumeMaximum :: C y => T y -> y Source #
Volume based on Manhattan norm.
volumeEuclidean :: C y => T y -> y Source #
Volume based on Energy norm.
volumeEuclideanSqr :: C y => T y -> y Source #
bounds :: Ord y => T T y -> (y, y) Source #
Compute minimum and maximum value of the stream the efficient way. Input list must be non-empty and finite.
histogramDiscreteArray :: T T Int -> (Int, T Int) Source #
Input list must be finite. List is scanned twice, but counting may be faster.
histogramLinearArray :: C y => T T y -> (Int, T y) Source #
Input list must be finite.
If the input signal is empty, the offset is undefined
.
List is scanned twice, but counting may be faster.
The sum of all histogram values is one less than the length of the signal.
histogramDiscreteIntMap :: T T Int -> (Int, T Int) Source #
Input list must be finite.
If the input signal is empty, the offset is undefined
.
List is scanned once, counting may be slower.
directCurrentOffset :: C y => T y -> y Source #
Requires finite length. This is identical to the arithmetic mean.
centroidAlt :: C y => T y -> y Source #
firstMoment :: C y => T y -> y Source #
zeros :: (Ord y, C y) => T y -> T Bool Source #
Detects zeros (sign changes) in a signal. This can be used as a simple measure of the portion of high frequencies or noise in the signal. It ca be used as voiced/unvoiced detector in a vocoder.
zeros x !! n
is True
if and only if
(x !! n >= 0) /= (x !! (n+1) >= 0)
.
The result will be one value shorter than the input.
data BinaryLevel Source #
Instances
Enum BinaryLevel Source # | |
Defined in Synthesizer.Plain.Analysis succ :: BinaryLevel -> BinaryLevel # pred :: BinaryLevel -> BinaryLevel # toEnum :: Int -> BinaryLevel # fromEnum :: BinaryLevel -> Int # enumFrom :: BinaryLevel -> [BinaryLevel] # enumFromThen :: BinaryLevel -> BinaryLevel -> [BinaryLevel] # enumFromTo :: BinaryLevel -> BinaryLevel -> [BinaryLevel] # enumFromThenTo :: BinaryLevel -> BinaryLevel -> BinaryLevel -> [BinaryLevel] # | |
Eq BinaryLevel Source # | |
Defined in Synthesizer.Plain.Analysis (==) :: BinaryLevel -> BinaryLevel -> Bool # (/=) :: BinaryLevel -> BinaryLevel -> Bool # | |
Show BinaryLevel Source # | |
Defined in Synthesizer.Plain.Analysis showsPrec :: Int -> BinaryLevel -> ShowS # show :: BinaryLevel -> String # showList :: [BinaryLevel] -> ShowS # |
binaryLevelToNumber :: C a => BinaryLevel -> a Source #
flipFlopHysteresis :: Ord y => (y, y) -> BinaryLevel -> T y -> T BinaryLevel Source #
Detect thresholds with a hysteresis.
flipFlopHysteresisStep :: Ord a => (a, a) -> BinaryLevel -> a -> BinaryLevel Source #
chirpTransform :: C y => y -> T y -> T y Source #
Almost naive implementation of the chirp transform, a generalization of the Fourier transform.
More sophisticated algorithms like Rader, Cooley-Tukey, Winograd, Prime-Factor may follow.
binarySign :: (Ord y, C y) => T y -> T BinaryLevel Source #
deltaSigmaModulation :: C y => T y -> T BinaryLevel Source #
A kind of discretization for signals with sample values between -1 and 1. If you smooth the resulting signal (after you transformed with 'map binaryLevelToNumber'), you should obtain an approximation to the input signal.
deltaSigmaModulationPositive :: C y => y -> T y -> T y Source #
A kind of discretization for signals with sample values between 0 and a threshold. We accumulate input values and emit a threshold value whenever the accumulator exceeds the threshold. This is intended for generating clicks from input noise.
See also deltaSigmaModulation
.