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

Audacity Bugzilla



Bug 1049 - Spectral edit effects fail on 0 Hz low frequency.
Spectral edit effects fail on 0 Hz low frequency.
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Nyquist
2.1.1
Per OS All
: P4 Repeatable
Assigned To: Default Assignee for New Bugs
: patch_closed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-25 14:00 UTC by Gale Andrews
Modified: 2018-08-20 11:46 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1 Generate some audio, change to a Spectral Selection view and open Spectral Selection Toolbar. 2 Enter low frequency of 0 Hz and any high frequency e.g. 12000 Hz. 3 Open Spectral edit parametric EQ, choose a Gain and OK. 4 The effect fails silently. You can press Debug instead of OK to see the error, presumably because 0 Hz has no center frequency or bandwidth? So should we have a message box asking to define a non-zero frequency?
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
stevethefiddle: Test‑OK‑Lin+


Attachments
Fix for bug 1049 (3.29 KB, patch)
2015-12-08 16:33 UTC, Steve Daulton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gale Andrews 2015-06-25 14:00:43 UTC

    
Comment 2 Steve Daulton 2015-07-28 03:45:01 UTC
I'm seeing this error in the debug window when following the steps to reproduce:

error: unbound variable - INF
if continued: try evaluating symbol again
1> 1
1> "Audio Track"
1> "wave"
1> "Spectrum"
1> 1
1> 0
1> 30
1> 1
1> 0
1> 44100
1> 32
1> ((0 30))
1> 0.799999
1> T
1> 4.3
1> 4.3
1> VALIDATE
1> WET
1> RESULT
1> "Low frequency is undefined."
1>
Comment 3 Steve Daulton 2015-11-04 06:32:24 UTC
Bug reopened as it is not fixed.

Parametric EQ and Multi tool should show a meaningful error when the lower frequency bound = 0. Currently it fails with the message:
"Nyquist returned the value: <upper frequency limit>" 

To reproduce: 
1) Set Spctral Edit Toolbar to show Upper and Lower frequencies. 
2) Make a selection 
3) Enter 0 as the lower frequency and say 1234 Hz as the upper frequency.
4) Apply either the "Parametric" or "Multi" Spectral effects.

The reason that 0Hz is invalid is because when the lower frequency is zero, the bandwidth in octaves is undefined (it is a ratio in which the denominator is zero).
Comment 4 Gale Andrews 2015-12-06 16:53:42 UTC
(In reply to Steve Daulton from comment #3)
Also there is still a completely silent failure in multi tool if low frequency is 0 Hz and high is undefined. 

In Parametric EQ if low frequency is 0 Hz and high is undefined, the message states that Low Frequency is undefined, which is not actually true.
Comment 5 Steve Daulton 2015-12-08 12:27:52 UTC
"Spectral edit parametric EQ" no longer fails silently as described in the steps to reproduce. It fails with a message:
"Nyquist returned the value: 12000.000000"

As this bug refers to more than one "Spectral Edit" effect, and the above change in symptoms, I've updated the bug title.
Comment 6 Steve Daulton 2015-12-08 16:33:55 UTC
Created attachment 653 [details]
Fix for bug 1049

I think this should fix all the issues detailed in the comments.
Comment 7 Gale Andrews 2015-12-27 17:17:21 UTC
Given http://bugzilla.audacityteam.org/show_bug.cgi?id=1275#c7 should this be DEVEL - FIX MADE ?
Comment 8 Steve Daulton 2015-12-27 21:12:15 UTC
(In reply to Gale Andrews from comment #7)
Yes, DEVEL - FIX MADE.

The issue in comment 2 no longer occurs. 

For a parametric ("mid-band") Eq, both the upper and lower frequencies 'must' be defined or an error is raised. Similarly error messaged are raised for "Spectral Multi-tool" when the settings create a dangerous error condition (invalid biquad filter values).

For "Spectral Shelf" filters it is perfectly valid to have just one frequency defined. I think it is more useful to treat Nyquist and above as "undefined" than as an error. I think it is debatable whether 0 Hz should be treated as an error or as "undefined", but given if we are to treat Nyquist and above as "undefined" then it is more consistent to do the same for 0 Hz.
Comment 9 Gale Andrews 2015-12-28 09:50:35 UTC
(In reply to Steve Daulton from comment #8)
Moved to DEVEL - FIX MADE. I'm happy with Spectral edit multi-tool and Parametric EQ.

> For "Spectral Shelf" filters it is perfectly valid to have just one frequency 
> defined. I think it is more useful to treat Nyquist and above as "undefined" 
> than as an error. I think it is debatable whether 0 Hz should be treated as an 
> error or as "undefined", but given if we are to treat Nyquist and above as 
> "undefined" then it is more consistent to do the same for 0 Hz.
As per http://bugzilla.audacityteam.org/show_bug.cgi?id=1278#c9 we have Spectral edit shelves doing nothing on 0 Hz to Nyquist Frequency and 0 Hz to undefined but the Undo Stack history shows them, so arguably they are still failing silently on those 0 Hz cases.
Comment 10 Steve Daulton 2015-12-28 10:57:09 UTC
(In reply to Gale Andrews from comment #9)
> arguably they are still failing silently on those 0 Hz cases.
As described in comment 2 and in the "Steps to Reproduce", there was previously an internal error (in Nyquist / Audacity). Now it does "nothing", but there is no internal error condition - the actual output is the same as the calculated output.

I agree that it is debatable what we 'should' do when the user input is nonsense but is handled by the code without error. I'd suggest that we close this bug and raise any residual issues separately, subject to the outcome of this discussion: http://sourceforge.net/p/audacity/mailman/message/34724528/
Comment 11 Peter Sampson 2016-02-18 10:29:51 UTC
Testing on Mac El Capitan on 01a95c5-2.1.3-alpha-13-feb-16
and
Testing on W10 on audacity-win-r4d154c4-2.1.3-alpha-18-feb-16

Using the steps to reproduce on both these platforms I now get an apptropriate error message instead of a "silent fail"
Comment 12 Steve Daulton 2017-01-19 15:00:45 UTC
Testing on Debian, Audacity 2.1.3 alpha. The bug as described is fixed.
Comment 13 Peter Sampson 2017-07-15 05:27:27 UTC
Closing this bug that was tested an all three platforms a while back (and still works an alphas on Win and Mac