Bug #1052

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

Added by Autumn Johnson over 4 years ago.

Start date:
Due date:
% Done:


Estimated time:


Begin forwarded message:

From: Mary Templeton <>
Subject: JPlotResp bug for large number of FIR coefficients
Date: September 5, 2018 at 9:01:45 AM PDT
To: Rob Casey <>
Cc: Mary Templeton <>, Chad Trabant <>

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,

07B52F16-B447-4A85-9B7F-05B27C8BDE2D_4_5005_c.jpeg (29.1 KB) 07B52F16-B447-4A85-9B7F-05B27C8BDE2D_4_5005_c.jpeg plot1 Autumn Johnson, 01/17/2020 01:04 PM
A4D62B0F-8C6C-419A-A610-8D4C9C2953EC_4_5005_c.jpeg (20.7 KB) A4D62B0F-8C6C-419A-A610-8D4C9C2953EC_4_5005_c.jpeg plot2 Autumn Johnson, 01/17/2020 01:05 PM
6A9288ED-0CBF-44CA-AAC2-56A25D4C192F.png (144 KB) 6A9288ED-0CBF-44CA-AAC2-56A25D4C192F.png plot3 Autumn Johnson, 01/17/2020 01:06 PM
RESP.XX.SR009..FLZ (194 KB) RESP.XX.SR009..FLZ RESP file Autumn Johnson, 01/17/2020 01:08 PM

Also available in: Atom PDF