hspear-0.14: Haskell Spear Parser

Safe HaskellNone

Sound.Analysis.Spear.PTPF

Contents

Description

Spear PTPF (par-text-partials-format) files.

Synopsis

Tuple

duples :: [t] -> [(t, t)]Source

Adjacent duples.

 duples [1..6] == [(1,2),(3,4),(5,6)]

triples :: [t] -> [(t, t, t)]Source

Adjacent triples.

 triples [1..6] == [(1,2,3),(4,5,6)]

List

at_last :: (a -> a) -> [a] -> [a]Source

Apply f at last element.

 at_last negate [1..3] == [1,2,-3]

mean :: Floating a => [a] -> aSource

Numerically stable mean

 map mean [[1..5],[3,5,7],[7,7],[3,9,10,11,12]] == [3,5,7,9]

minmax :: Ord b => [b] -> (b, b)Source

minimum & maximum.

 minmax [0..5] == (0,5)

Node

data Node Source

Record to hold data for single node of a partial track.

Constructors

Node 

Fields

n_partial_id :: Int

Partial identifier

n_time :: Double
 
n_frequency :: N_Data
 
n_amplitude :: N_Data
 

Instances

n_temporal_f :: (N_Time -> N_Time) -> Node -> NodeSource

Apply transform f at n_time.

Seq

data Seq Source

A sequence of partial Node data.

Instances

s_map :: (Node -> Node) -> Seq -> SeqSource

Apply f at s_data of Seq and re-calculate temporal bounds.

s_summarise :: ([a] -> b) -> (Node -> a) -> Seq -> bSource

s_temporal_f :: (N_Time -> N_Time) -> Seq -> SeqSource

Apply transform f at n_time.

PTPF

data PTPF Source

A PTPF is a set of Seq.

Constructors

PTPF 

Fields

p_partials :: Int
 
p_seq :: [Seq]
 

Instances

p_from_seq :: [Seq] -> PTPFSource

Generate PTPF from set of Seq. Re-assigns partial identifiers.

p_map :: (Seq -> Seq) -> PTPF -> PTPFSource

Parser

ptpf_node :: Int -> (STR, STR, STR) -> NodeSource

Parse Node.

ptpf_seq :: (STR, STR) -> SeqSource

Parse Seq from pair of input lines.

ptpf_header :: [STR] -> Maybe IntSource

Parse header section, result is number of partials.

Operations

ptpf_time_asc :: PTPF -> [(N_Time, [Node])]Source

All Nodes grouped into sets with equal start times.