.TH FIR 1 "13 August 1993" "MIT DB software 8.1" "DB applications" .SH NAME fir \- general-purpose FIR filter for DB records .SH SYNOPSIS \fBfir\fR [ \fIoptions\fR ... ] \fB-c\fR [ \fIcoefficients\fR ... ] .SH DESCRIPTION \fIfir\fR can be used to apply any desired finite impulse response filter to any desired section of a database record. \fIOptions\fR are: .TP \fB-c\fI coefficient\fR [ \fIcoefficient\fR ... ] Filter using the specified \fIcoefficients\fR (must be the last option; \fB-c\fR marks the beginning of the coefficient list). .TP \fB-C\fI file\fR Read the filter coefficients from the specified file rather than from the argument list. .TP \fB-f\fI time\fR Filter from the specified time on the input record (default: start at the beginning of the record). .TP \fB-h\fR Print a usage summary. .TP \fB-i\fI record\fR Use the specified record for input (default: record 16). .TP \fB-n\fI record\fR Create a header file for the output signals, with the specified \fIrecord\fR name. The signal descriptions are copied from those of the input signals. .TP \fB-o\fI record\fR Use the specified record for output (default: record 16). .TP \fB-ri\fR Rectify the input (i.e., take its absolute value) before filtering. .TP \fB-ro\fR Rectify the filtered output. .TP \fB-s\fI shift\fR To compensate for phase shift, read ahead on the input record by the specified interval before starting the filter. \fIShift\fR is specified in standard time format (use \fBs\fInn\fR to compensate for a phase shift of \fInn\fR samples). .TP \fB-t\fI time\fR Filter until the specified time on the input record (default: go to the end of the record). .PP Unless the \fB-C\fR option is used, the \fB-c\fR argument should appear at the end of the option list. Filter coefficients are real numbers separated by spaces; the last coefficient is applied to the most recent input sample. .PP In the present implementation, the same filter is applied to each input signal. If the output record header file specifies fewer signals than are present in the input, any extra input signals are discarded. .PP The shell variable \fBDB\fR should be set and exported (see \fIsetdb\fR(1)). .SS Examples .PP A low-pass "boxcar" filter: .br \fBfir -c .2 .2 .2 .2 .2\fR .PP The complementary high-pass filter: .br \fBfir -c -.2 -.2 .8 -.2 -.2\fR .PP An attenuator: .br \fBfir -c .4\fR .PP A differentiator: .br \fBfir -c -1 1\fR .PP A 60-Hz notch filter, with partial correction for phase shift, for the MIT\-BIH database (360 samples/second): .br \fBfir -s s2 -c .5 0 0 .5\fR .PP A "triangle" filter for QRS detection (at 128 samples/second): .br \fBfir -s s8 -c -1 -2 -3 -4 -1 2 5 8 5 2 -1 -4 -3 -2 -1\fR .SH SEE ALSO .PP mfilt(1)