Changes between Initial Version and Version 1 of decimate

03/25/12 13:13:24 (10 years ago)



  • decimate

    v1 v1  
     3= [wiki:Earthworm Earthworm] Module: decimate = 
     4'''Contributed by: ''' 
     6== Function == 
     7Implements filter and decimate routines. 
     9== Details == 
     10The Decimate module implements multi-stage filter and decimation routines to process wave data (TYPE_TRACEBUF2) coming from the InRing defined in decimate.d. Decimated trace messages are written to the OutRing with their SCNs changed as specified in decimate.d. The decimated trace message retains its TYPE_TRACEBUF2 type, but it (normally) has a new SCNL name. 
     12Decimate uses FIR filters to reduce the incoming wave frequency content down to the Nyquist frequency of the output wave. FIR filters have the advantage of being strictly causal and stable. However, there is considerable delay introduced by a FIR filter. Fortunately FIR filters have linear phase so the delay does not change the shape of the wave. The delay will be removed from the data by adjusting their timestamps. This adjustment makes the filter acausal: small precursory artifacts will be seen in front of impulsive wave arrivals. This is an inherent characteristic of FIR filters. See "Of Poles and Zeros" by Frank Scherbaum for a method of removing these artifacts. 
     14The decimation is performed as part of the filter routine for efficiency. The FIR filter coefficients are determined from the specified decimation rate, using the Remez Exchange algorithm. This produces an equi-ripple filter. Currently the ripple limits are hard coded to 0.005 in the pass band and 0.0031 in the stop band (see decimate.h in the source directory.) The foefficients zeroes of each filter, as well as the effective delay, are logged on startup. FIR filters have no poles. 
     17=== Example Configuration File === 
     20#                     Configuration File for decimate 
     22MyModId          MOD_DECIMATE 
     23InRing           WAVE_RING       # Transport ring to find waveform data on, 
     24OutRing          WAVE_RING       # Transport ring to write output to, 
     25                                 # InRing and OutRing may be the same. 
     26HeartBeatInterval     30         # Heartbeat interval, in seconds, 
     27LogFile            1             # 1 -> Keep log, 0 -> no log file 
     28#Debug                           # Write out debug messages (optional) 
     30# Specify the decimation rates as one or more integer values greater than 1, 
     31# all on one "DecimationRates" line, enclosed in quotes. 
     32# These will be used in successive stages of decimation. The overall 
     33# decimation rate is the product of all the stage decomation rates. 
     34# The filters will be more efficient if several small decimation stages 
     35# are used instead of one large one, and if largest rates are given first. 
     36# Currently a maximum of 10 stages is enforced. 
     37DecimationRates    "5 2"     # Decimation rates of each stage, in quotes! 
     39MinTraceBuf         10       # Minimum number of samples in output TRACE_BUF. 
     41MaxGap              1.5      # Maximum gap, in sample periods, allowed 
     42                             # between trace data points. 
     43                             # When exceeded, channel is restarted. 
     44# If you want Decimate to compute and log its filter coefficients and then 
     45# exit, specify "TestMode". 
     49# Specify logo of the messages to grab from the InRing. 
     50# TYPE_TRACEBUF2 is assumed, therefore only module ID and 
     51# installation ID need to be specified 
     53GetWavesFrom    INST_WILDCARD MOD_WILDCARD  # TYPE_TRACEBUF2 (assumed) 
     56# List SCNL codes of trace messages to decimate and their output SCNL codes 
     57# Wildcard characters are not allowed here. 
     59#        IN-SCNL     OUT-SCNL 
     60GetSCNL ABC EHZ UW --  ABC EWZ UW -- 
     64== Helpful Hints ==