Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1026 - Nyquist eq-lowshelf fails for low frequency high negative gain
Nyquist eq-lowshelf fails for low frequency high negative gain
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: Nyquist
2.1.1
Per OS All
: P2 Repeatable
Assigned To: Default Assignee for New Bugs
http://audacity.238276.n2.nabble.com/...
: nyquist
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-12 03:52 UTC by Steve Daulton
Modified: 2018-08-20 11:51 UTC (History)
5 users (show)

See Also:
Steps To Reproduce:
Apply the following code in the Nyquist Prompt to a 44100 Hz track using the debug button: (eq-lowshelf *track* 2000 -18)
Release Note:
GROUP: Effects and Analysis * '''Using a low frequency shelving filter in [http://manual.audacityteam.org/o/man/spectral_selection.html#Spectral_edit_shelves Spectral edit shelves] with a half-gain frequency below about 3000 Hz and a gain above +12 dB will fail without an error message''' (except for a debug error if you use the Debug button).
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
stevethefiddle: Regression+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2015-06-12 03:52:27 UTC
Initially marked as P2 because it causes a serious regression in a "flagship feature" of 2.1.0.

If the frequency for a Nyquist low shelf filter is below about 3000 Hz and the gain less than -12 dB, there is an error in nyq:biquad (in dspprims.lsp):
"a0 < 1 (unstable parameter) in biquad"

This error will occur in Spectral Edit Shelves or any other Nyquist effect that uses a low-shelf filter with a half gain frequency below 3 kHz and more than 12 dB cut.

I think that the sanity  check in nyq:biquad is overly restrictive as instability does not appear in eq-lowshelf until a0 < 0.5024
Making the test less restrictive fixes this bug, but perhaps Roger has a better solution.

(defun nyq:biquad (x b0 b1 b2 a0 a1 a2)
  (if (< a0 0.5024)
      (error (format t "a0 too small (unstable parameter) in biquad: ~a~%" a0)))
  (let ((a0r (/ 1.0 a0)))
    (snd-biquad x (* a0r b0) (* a0r b1) (* a0r b2) 
                  (* a0r a1) (* a0r a2) 0 0)))
Comment 1 Gale Andrews 2015-06-15 00:35:52 UTC
Regression on 2.1.0.

I can reproduce the problem fine, but am not clear why Low Frequency undefined, High Frequency 1000 Hz, Gain > +12 dB works, which I understand is a low shelving filter only, with half-gain frequency of 1000 Hz. 

Low Frequency 0 Hz, High Frequency 1000 Hz, Gain > +12 dB fails, which I understand is a low shelving filter with half-gain frequency of "minimally above 0 Hz", plus a high shelving filter with a half-gain frequency of 1000 Hz. Or am I not interpreting 0 Hz and undefined correctly? 
 
Is it a legitimate workaround for this issue if you want e.g. +14 dB gain to apply two passes at +7 dB gain? If not I would be tempted to say P1. Are you (Steve) happy with P2?
Comment 2 Steve Daulton 2015-06-15 06:44:59 UTC
(In reply to Gale Andrews from comment #1)
> I can reproduce the problem fine, but am not clear why Low Frequency undefined,
> High Frequency 1000 Hz, Gain > +12 dB works, which I understand is a low
> shelving filter only, with half-gain frequency of 1000 Hz. 

To reproduce the issue with a ('single') low shelf filter (low frequency undefined), set Gain to -18 dB ('minus' 18 dB).
Comment 3 Steve Daulton 2015-06-15 07:09:55 UTC
(In reply to Gale Andrews from comment #1)
> Is it a legitimate workaround for this issue if you want e.g. +14 dB gain to
> apply two passes at +7 dB gain?
I'd say that is a legitimate work-around, though the result will be 'slightly' different.

> Are you (Steve) happy with P2?
I think P2 is appropriate.

Even without the "Spectral edit shelves" I'd be tempted to go for P3 because it will be a serious regression in an unknown number of (non-shipped) Nyquist plug-ins (those that use eq-lowshelf) and by inference is a regression in the (shipped) Nyquist Prompt effect.
Comment 4 Steve Daulton 2015-06-19 09:28:51 UTC
Fixed committed (with agreement of RM) 07ca677.
Comment 5 Gale Andrews 2015-06-24 23:53:04 UTC
Tested on Windows and Mac.