amplitude and phase do not match expected shape when plotting a FIR filter that produces a 4000 Hz sample rate
Begin forwarded message:
From: Mary Templeton <firstname.lastname@example.org>
Subject: JPlotResp bug for large number of FIR coefficients
Date: September 5, 2018 at 9:01:45 AM PDT
To: Rob Casey <email@example.com>
Cc: Mary Templeton <firstname.lastname@example.org>, Chad Trabant <email@example.com>
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
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.