Introduction

The purpose of this note is to review and document the FIR filters that are used in the Quanterra Q330 data acquisition system. This documention will observed step reponses to those predicted by the manufacturers documentation and those given in our SEED Response files for the system.

For the Q330 system, these filters would form the third and last stage of the response specification - the first is the analog sensor description and the second is the A/D section.

This detailed documentation is required because we prefer using the IRIS evalresp/JEvalResp program, which provides amplitude and phase response as a function of frequency, for the deconvolution using gsac> or sacevalr. These programs have an interesting quirk:

"FIR Filters:

All FIR filters are considered as having a zero phase-shift, even if they are not symmetrical and the delay correction is null. If there are two FIR filters in the same stage, the program expects that the second FIR filter is a continuation of the first.

The FIR response

FIR: SEED and evalresp

According to the SEED Manual Version 2.4, the FIR response is described using header blockettes 054 for the FIR, 057 for the Decimation and Correction and 058 for the gain.

Block 057 has two pertinent entries: B057F07 Estimated delay, and B057F08 correction applied. According to the documentation, these field have the following meaning:

Field 7: Estimated delay (seconds). The estimated pure delay for the stage, it may or not be also corrected in field 8. the field value is nominal, and may be unreliable.

Field 8: Correction applied (seconds). The time shift to the time tab due to the delay at this stage of the filter; a negative number indicating the amount of time added to the former time tag. The actual delay is difficult to estiamte, and the correction applied neglects dispersion. This field allows the user to know how much the correction was used, in case a more accurate correction is to be applied later. A zero here implied no correction was done.

.

evalresp-3.2.25 and JEvelResp treat the FIR file in the same manner. The programming comment in resp_fctns.c says (3) the expected delay from the FIR filter stages in the channel s filter sequence is calculated and stored in the filter structure.

Further calc_fctns.c does the following:

#ifdef USE_DELAY
            calc_time_shift((corr_applied-calc_delay), w, &of);
#else
            calc_time_shift(0, w, &of);
#endif
which means that the corr_applied-calc_delay is set to zero.

To compute the response the phase of an asymmetric FIR is adjusted so that zero lag corresponds at the center of the FIR, rather than at the beginning.

Note that I assume that one begins the creation of evalresp, by running the command configure with no flags.

If we examine the Quanterra FIR file FLbelow100-100.txt, we note that the sample rate is 100 Hz, the delay of the filter is 0.041607 sec, and that there are 65 coefficients. evalresp, even though it does not use this by default computes

calc_delay = ((nc-1)/2.0) * blkt_ptr->blkt_info.decimation.sample_int;
corr_applied = blkt_ptr->blkt_info.decimation.applied_corr;
Note that the first is the center of the FIR. The applied_corr is Field 8. I propose the following artifice. Given N FIR filter coefficients (N is odd for Quanterra). The center of the filter, henceforth to be called zero lag, is at C index (N -1)/2.

The Quanterra delay is respect to index 0 of the original FIR. We move prepend M zeros so that the Quanterra delay is moved as close to the center of the FIR as possible. Definitions:

N      : Number of points in original FIR
M      : Number of zeros to be prepended to FIR
J      : Index corresponding to delay 
         J = FIR_delay * sample rate 
         (for the filter in this example, J = 4)

Computation:  We want the new zero to satisfy the equation

         M + J = ( M + N - 1) /2

or

     M = N - 1 - 2 J

        M = 65 -1 -2 * 2  = 60 for our example

The applied correction with respect to this 
new center is now 0.041607 - 4/100 = 0.001607 sec.

If M < 0, we then add zeros to the end of the response.

To further overcome the granularity due ot round off, J can be computes as J = FIR_delay * sample rate +0.499

FIR responses for Q330

The current section will compare the response of the given FIR to a step input to that computed using the response file created by prepending/appending zeros.

Hopefully the true and evalresp will differ by less than one sample

Last Changed February 13, 2005