Suggestion (Bandpass Filter and Custom FFT Filter)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Band pass filters need not be symmetric, but often are, and in the case of frequency band selection in Audacity, the band pass filter is symmetric.
The short answer is that the centre frequency is defined as (F0 * F1)^0.5, where F0 and F1 are the lower and upper bounds respectively. The reason for this design decision is that it works with symmetric fixed slope filters.
In more detail:
In the case of the "Spectral edit multi tool", when a frequency band is selected, a fixed-parameter, second-order notch filter, derived from a biquad filter. The center frequency is given by (F0 * F1)^0.5, where F0 and F1 are the lower and upper bounds respectively.
In the case of "Spectral edit parametric EQ...", when a frequency band is selected, a fixed parameter, second-order midrange equalization (EQ) filter, derived from a biquad filter, is applied. The half-gain width is defined as 0.5 * bandwidth, where "bandwidth" is defined as log(mF1 / mF0)/log(2.0). Again F0 and F1 are the lower and upper bounds respectively.
In the case of "Spectral edit shelves...", when a frequency band is selected, the filter comprises of a high-shelf and low-shelf filter in series. Both shelf filters are fixed-parameter, second-order shelving equalization (EQ) filters, derived from biquad filters. The upper and lower frequency bounds are the half-gain points of each shelf filter. The centre frequency, though not used for determining the filter response, is the intersection of the slopes of the two filters.
The short answer is that the centre frequency is defined as (F0 * F1)^0.5, where F0 and F1 are the lower and upper bounds respectively. The reason for this design decision is that it works with symmetric fixed slope filters.
In more detail:
In the case of the "Spectral edit multi tool", when a frequency band is selected, a fixed-parameter, second-order notch filter, derived from a biquad filter. The center frequency is given by (F0 * F1)^0.5, where F0 and F1 are the lower and upper bounds respectively.
In the case of "Spectral edit parametric EQ...", when a frequency band is selected, a fixed parameter, second-order midrange equalization (EQ) filter, derived from a biquad filter, is applied. The half-gain width is defined as 0.5 * bandwidth, where "bandwidth" is defined as log(mF1 / mF0)/log(2.0). Again F0 and F1 are the lower and upper bounds respectively.
In the case of "Spectral edit shelves...", when a frequency band is selected, the filter comprises of a high-shelf and low-shelf filter in series. Both shelf filters are fixed-parameter, second-order shelving equalization (EQ) filters, derived from biquad filters. The upper and lower frequency bounds are the half-gain points of each shelf filter. The centre frequency, though not used for determining the filter response, is the intersection of the slopes of the two filters.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Though is the filter is an asymmetric band pass filter, then either the centre frequency shown in the spectrogram will not coincide with the centre frequency of the filter, or the upper and lower bounds shown in the spectrogram will not coincide with the filter. Deciding on the best compromise would be a design decision for the person designing such a filter.Paul L wrote:Your suggestion about varying the rolloff frequencies is a good one, and it could be easily remedied by writing other versions of the Nyquist plug ins -- no need to change Audacity binaries.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
"Center frequency" meaning geometric mean is the usual technical jargon, is it not?Gale Andrews wrote:I certainly agree what "center frequency" means will need properly explaining in the Manual. We may wish to remember the likely skill/knowledge level of the majority of our users.steve wrote:That is correct. The spectral selection is a fixed order high, low or band pass filter, thus in the case of band pass the centre frequency is proportionally in the centre, thus it will appear in the centre in Spectrogram (log f) view and below the centre in linear Spectrogram view. This is basic physics.Videogamer555 wrote:I notice a problem in frequency selection in spectrogram in version 2.1.0. When you using the linear frequency display, for selecting the spectrum, it doesn't have the center frequency in the center. Instead it has it below the center.
The question I have is what proportion and what centre are we talking about for the centre line in the Spectrogram views. Are we talking about centre frequencies of band* and notch filters? Anyone can see that the center frequency in either log or linear view for example between a range of 2000 to 8000 Hz is below what some might expect (5000 Hz). Neither is it the geometric mean which I understand would be 4000 Hz.
I guess many people will ask this, so I'll be first.
Gale
If you select from 2000 Hz to 8000, surely 4000 should be the center. I just confirmed that this is so on my build, in log and linear views, and using the precise readouts of the spectral selection toolbar. If you don't see the same, there is a bug!
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Yes it is.Paul L wrote:"Center frequency" meaning geometric mean is the usual technical jargon, is it not?
Yes.Paul L wrote:If you select from 2000 Hz to 8000, surely 4000 should be the center.
Confirming that it works as expected here (Linux).Paul L wrote: I just confirmed that this is so on my build, in log and linear views, and using the precise readouts of the spectral selection toolbar. If you don't see the same, there is a bug!
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Videogamer555, are you familiar with Nyquist plug-ins?
Audacity contains a complete interpreter for a programming language that has access to a library of mathematical functions for signal processing. Defining a new effect can be an uncomplicated task of writing a page or less of code in a file placed in the correct folder, then restarting Audacity. The effect does not have to wait for a new release of Audacity to be built-in.
The Highpass and Lowpass filters in the effects menu are in fact implemented this way, as interpreted source code files, and each contains very little code. Adding a Bandpass should be very easy.
But wait, steve has already done that for us, of course! Reiterating: http://forum.audacityteam.org/viewtopic ... 07#p204507
Audacity contains a complete interpreter for a programming language that has access to a library of mathematical functions for signal processing. Defining a new effect can be an uncomplicated task of writing a page or less of code in a file placed in the correct folder, then restarting Audacity. The effect does not have to wait for a new release of Audacity to be built-in.
The Highpass and Lowpass filters in the effects menu are in fact implemented this way, as interpreted source code files, and each contains very little code. Adding a Bandpass should be very easy.
But wait, steve has already done that for us, of course! Reiterating: http://forum.audacityteam.org/viewtopic ... 07#p204507
-
Robert J. H.
- Posts: 3633
- Joined: Thu May 31, 2012 8:33 am
- Operating System: Windows 10
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Hi Paul.
The developer manual for the Spectral Edit Multi Tool mentions a roll-off of 6 dB per octave.
That's wrong, you're using lowpas2 and highpass2 which actually should have a 12 dB per octave roll-off (at least according to specifications...).
Also, I'm not sure if eq-band and -shelves shouldn't have some bandwidth corrections.
They deviate by 3 to 9 dB in comparison to the notch filter. The latter one has a correct corner attenuation of -3 dB.
Thus, the bandwidth for the eq-shelves is approx. 11000 Hz from -3 to -3 dB point (instead of 6000).
However, that's for only one such frequency pair and the ripples in the passband make it hard to determine the exact corner points.
The developer manual for the Spectral Edit Multi Tool mentions a roll-off of 6 dB per octave.
That's wrong, you're using lowpas2 and highpass2 which actually should have a 12 dB per octave roll-off (at least according to specifications...).
Also, I'm not sure if eq-band and -shelves shouldn't have some bandwidth corrections.
They deviate by 3 to 9 dB in comparison to the notch filter. The latter one has a correct corner attenuation of -3 dB.
Code: Select all
Name Frequency Notch2 Parametric EQ Delta Notch/Eq Shelf Delta Notch/Shelf
F0 2000 -38.0729 -41.49 3.42 -46.6439 8.57
Fc 4000 -65.7908 -58.37 -7.42 -53.9078 -11.88
F1 8000 -37.9766 -41.11 3.14 -47.1083 9.13However, that's for only one such frequency pair and the ripples in the passband make it hard to determine the exact corner points.
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Robert, lowpass.ny uses lowpass2 when you choose 6 dB/octave rolloff, and highpass.ny uses highpass2.
If my new effects are wrong, then these old effects are wrong.
I don't know, are they wrong? I am only gluing the pieces together, I think you know the math better than I.
Where is the documentation you consulted about lowpass2?
If my new effects are wrong, then these old effects are wrong.
I don't know, are they wrong? I am only gluing the pieces together, I think you know the math better than I.
Where is the documentation you consulted about lowpass2?
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
Thanks Robert. Now corrected to say 12 dB per octave.Robert J. H. wrote:The developer manual for the Spectral Edit Multi Tool mentions a roll-off of 6 dB per octave.
That's wrong, you're using lowpas2 and highpass2 which actually should have a 12 dB per octave roll-off (at least according to specifications...).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
No, they use "lp" and "hp" respectively for 6 dB per octave.Paul L wrote:Robert, lowpass.ny uses lowpass2 when you choose 6 dB/octave rolloff, and highpass.ny uses highpass2.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Suggestion (Bandpass Filter and Custom FFT Filter)
You are right, and I have been a fool. I am embarrassed.steve wrote:No, they use "lp" and "hp" respectively for 6 dB per octave.Paul L wrote:Robert, lowpass.ny uses lowpass2 when you choose 6 dB/octave rolloff, and highpass.ny uses highpass2.
We can fix the manual or change the effects!
I say change the effects! I think it's better to have the slighter effect that you can repeat ad lib!