pipeparts.condition module

Review Status

Names

Hash

Date

Florent, Sathya, Duncan Me, Jolien, Kipp, Chad

8a6ea41398be79c00bdc27456ddeb1b590b0f68e

2014-06-18

pipeparts.condition.mkcondition(pipeline, src, target_rate, instrument, psd=None, psd_fft_length=32, ht_gate_threshold=inf, idq_gate_threshold=inf, veto_segments=None, nxydump_segment=None, track_psd=False, block_duration=250000000, zero_pad=None, width=64, statevector=None, dqvector=None, idq_series=None, idq_channel_name=None, fir_whiten_reference_psd=None, track_latency=False)[source]

Build pipeline stage to whiten and downsample h(t).

  • pipeline: the gstreamer pipeline to add this to

  • src: the gstreamer element that will be providing data to this

  • target_rate: the requested sample rate.

  • instrument: the instrument to process

  • psd: a psd frequency series

  • psd_fft_length: length of fft used for whitening

  • ht_gate_threshold: gate h(t) if it crosses this value

  • veto_segments: segments to mark as gaps after whitening

  • track_psd: decide whether to dynamically track the spectrum or use the fixed spectrum provided

  • width: type convert to either 32 or 64 bit float

  • fir_whiten_reference_psd: when using FIR whitener, use this PSD to define desired desired phase response

Gstreamer graph describing this function

digraph mkbasicsrc {
     rankdir = LR;
     compound=true;
     node [shape=record fontsize=10 fontname="Verdana"];
     edge [fontsize=8 fontname="Verdana"];

     capsfilter1 ;
     audioresample ;
     capsfilter2 ;
     reblock ;
     whiten ;
     audioconvert ;
     capsfilter3 ;
     "segmentsrcgate()" [label="segmentsrcgate() \n [iff veto segment list provided]", style=filled, color=lightgrey];
     tee ;
     audioamplifyr1 ;
     capsfilterr1 ;
     htgater1 [label="htgate() \n [iff ht gate specified]", style=filled, color=lightgrey];
     tee1 ;
     audioamplifyr2 ;
     capsfilterr2 ;
     htgater2 [label="htgate() \n [iff ht gate specified]", style=filled, color=lightgrey];
     tee2 ;
     audioamplify_rn ;
     capsfilter_rn ;
     htgate_rn [style=filled, color=lightgrey, label="htgate() \n [iff ht gate specified]"];
     tee ;

     // nodes

     "\<src\>" -> capsfilter1 -> audioresample;
     audioresample -> capsfilter2;
     capsfilter2 -> reblock;
     reblock -> whiten;
     whiten -> audioconvert;
     audioconvert -> capsfilter3;
     capsfilter3 -> "segmentsrcgate()";
     "segmentsrcgate()" -> tee;

     tee -> audioamplifyr1 [label="Rate 1"];
     audioamplifyr1 -> capsfilterr1;
     capsfilterr1 -> htgater1;
     htgater1 -> tee1 -> "\<return\> 1";

     tee -> audioamplifyr2 [label="Rate 2"];
     audioamplifyr2 -> capsfilterr2;
     capsfilterr2 -> htgater2;
     htgater2 -> tee2 -> "\<return\> 2";

     tee ->  audioamplify_rn [label="Rate N"];
     audioamplify_rn -> capsfilter_rn;
     capsfilter_rn -> htgate_rn;
     htgate_rn -> tee_n -> "\<return\> 3";
}
pipeparts.condition.mkhtgate(pipeline, src, control=None, threshold=8.0, attack_length=128, hold_length=128, invert_control=True, **kwargs)[source]

A convenience function to provide thresholds on input data. This can be used to remove large spikes / glitches etc. Of course you can use it for other stuff by plugging whatever you want as input and ouput

NOTE: the queues constructed by this code assume the attack and hold lengths combined are less than 1 second in duration.

Gstreamer Graph

digraph G {
     compound=true;
     node [shape=record fontsize=10 fontname="Verdana"];
     rankdir=LR;
     tee ;
     inputqueue ;
     lal_gate ;
     in [label="\<src\>"];
     out [label="\<return\>"];
     in -> tee -> inputqueue -> lal_gate -> out;
     tee -> lal_gate;
}
pipeparts.condition.mkmultiband(pipeline, head, rates, instrument=None, unit_normalize=True)[source]

Build pipeline stage to multiband a stream.

  • rates: a list of the requested sample rates, e.g., [512,1024].