## Bug #1052

### amplitude and phase do not match expected shape when plotting a FIR filter that produces a 4000 Hz sample rate

0%

**Description**

Begin forwarded message:

From: Mary Templeton <met@iris.washington.edu>

Subject: JPlotResp bug for large number of FIR coefficients

Date: September 5, 2018 at 9:01:45 AM PDT

To: Rob Casey <rob@iris.washington.edu>

Cc: Mary Templeton <met@iris.washington.edu>, Chad Trabant <chad@iris.washington.edu>

Hi Rob,

I encountered a bug in JPlotResp 1.80 (and an earlier version) when plotting a

FIR filter that produces a 4000 Hz sample rate. The amplitude and phase do not match

the expected shape and do not match Excel plots of the AMP and PHASE curves generated

with the same command line arguments from the same RESP file.

For the 4000 Hz sample rate, I would expect a high-frequency corner of ~1700 Hz (~85% of Nyquist).

When I use evalresp to generate a fap curve, I get plots that I would expect:

where the corner frequency is ~1700 and the phase is zero throughout most of the passband. Sercel’s Matlab

plots agree with the evalresp results.

The JPlotResp graph, on the other hand, shows a corner frequency of ~700 Hz and the phase is quite different:

I’m attaching the RESP files that generated the AMP, PHASE and JPlotResp plots. It is unusual in

that it has 4219 FIR coefficients - possibly the most JPlotResp has plotted. Messages in the console

make me think that it is reading all of the coefficients:

`XX SR009 ?? FLZ 2006,1,00:00:00`

SEED units: In="((METER) (SECOND^-1) )"(vel), Out="COUNT"

Calc_sens=3.355440E+07 (reported=3.355440E+07) @ 5.000000E-02 Hz

Calc_delay=9.820797E-03, Correction_applied=4.119141E-03

Est_delay=4.119141E-03, Final_sample_interval=5.960464E-04(sec/sample)

Stg 1: LAPLACE A0=1.000000E+00 0 Poles 0 Zeros Sd=1.000000E+00

Stg 2: GAIN Sd=1.000000E+01

Stg 3: FIR H0=1.0 1 Coefficient SInt=4.656613E-06 Sd=3.355440E+06

Stg 4: FIR_ASYM H0=1.0 4219 Coefficients SInt=4.656613E-06 Sd=1.000000E+00

Generating output plot

For what it’s worth, I’ve tried increasing the memory:

java -Xmx1024m -jar JPlotResp.jar

but it didn’t change the plot appearance.

Here is the RESP file that generated all plots:

I’d be grateful if you could route this to the appropriate recipient.

Many thanks,

Mary