Page 6 of 7

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 1:25 am
by steve
Robert J. H. wrote:This instant slope is the maximum and only achievable for big gain corrections
Yes, that's correct.
I'd not really considered how much less the slope would be for small gain values as it's not usually important, but you are quite correct that within the working range of that plugin the 12 dB figure is misleading. I'll update the manual accordingly.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 1:31 am
by steve
The revised text:
  • When the spectral selection begins at 0 Hz this effect applies a low-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the upper frequency of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency, and upper and lower boundaries this effect applies both low- and high-frequency shelving filters. In this case the half-gain frequency of the low shelf filter is defined by the lower frequency boundary of the spectral selection and the half-gain frequency of the high shelf filter is defined by the upper boundary of the spectral selection. The rolloff for both filters is 12 dB/octave. The gain control sets the amount of boost or cut between the two frequencies.
http://manual.audacityteam.org/man/Spec ... it_shelves

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 3:11 am
by Paul L
I opened bug 837 for Gale's display issue.

There was something that bugged me in the track artist code that might or might not account for this. The fix should be simple if I am right.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 4:26 am
by Robert J. H.
steve wrote:The revised text:
  • When the spectral selection begins at 0 Hz this effect applies a low-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the upper frequency of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency, and upper and lower boundaries this effect applies both low- and high-frequency shelving filters. In this case the half-gain frequency of the low shelf filter is defined by the lower frequency boundary of the spectral selection and the half-gain frequency of the high shelf filter is defined by the upper boundary of the spectral selection. The rolloff for both filters is 12 dB/octave. The gain control sets the amount of boost or cut between the two frequencies.
http://manual.audacityteam.org/man/Spec ... it_shelves
It's max 12 dB roll-off.
However, The average over all possible gain values is
6.67 dB (2 Cent span),
6.0 dB (1 octave)
4.9 dB (2 octaves)
2.97 dB (4 octaves)

That's the peculiarity of shelving filters after all.
You have to decide if you want to write max 12 dB, 6dB on average or both.
In general, I personally find the filter unsuited for spectral editing.
For a lowshelf, the filter begins to work far above the highest frequency. I'd expect the half-gain point rather in the center of the rectangle, don't you think?
One should be able to decide which type is used and which line defines the half-gain point. A higher filter order for less transition width wouldn't be bad either.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 6:05 am
by Videogamer555
Actually the center frequency should never be the logarithmic center. The center of a filter who's upper bound is 10000Hz, and who's lower bound is 100Hz, should NEVER be 1000Hz. At least not for scientific use. Maybe in the music industry, using a logarithmic center frequency is useful. However in SCIENTIFIC use, the LINEAR center is most useful. The linear center between 100 Hz and 10000Hz is 5050Hz. For example if I want to filter frequencies of an electromagnetic signal, blocking everything below 100Hz and above 10000Hz, and having the filter most strongly pass its center frequency, that means I want the signal most strongly passed to be 5050Hz. And before you say that a computer can't receive radio waves, the fact is IT CAN, without any additional hardware than a sound card. The highest frequency that can be received for a 192kHz sampling soundcard is 96kHz. This is near the low end of the LF (low frequency) band of the RF spectrum. To do this, simply plug in an antenna into the microphone or line in port on your soundcard. Then turn up the gain in your Windows mixer control. After recording a segment, you can use software to further boost the signal strength. For processing such a recorded signal I need some decent software. Goldwave is GREAT for this, but it costs money, so I'm just using the demo version and plan to stop using it when the demo version runs out. Meanwhile, I need Audacity (a free program) to have features added to it to make it as usable to me as Goldwave has been. So that's why I'm asking for these features. When the demo version of Goldwave runs out. I'll be fully switching to Audacity for my signal processing needs for my hobby LF, VLF, and ELF radio listening hobby. So that's why I'm trying to get the developers to add in features that I will be depending on for my signal processing needs.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 8:32 am
by vpd
I also needed a bandpass filter, so I created this plugin and I can say it works for me:
bandpass.ny
Simple bandpass plugin
(795 Bytes) Downloaded 70 times

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 1:28 pm
by Gale Andrews
steve wrote:The revised text:
  • When the spectral selection begins at 0 Hz this effect applies a low-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the upper frequency of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency, and upper and lower boundaries this effect applies both low- and high-frequency shelving filters. In this case the half-gain frequency of the low shelf filter is defined by the lower frequency boundary of the spectral selection and the half-gain frequency of the high shelf filter is defined by the upper boundary of the spectral selection. The rolloff for both filters is 12 dB/octave. The gain control sets the amount of boost or cut between the two frequencies.
http://manual.audacityteam.org/man/Spec ... it_shelves
That's the old text, so I assume a copy/paste error here.

The current text removes reference to the slope completely.

I'm obviously not a filter expert but as a layman I find it confusing that there is now no reference at all to slope, given the other spectral edit effects mention rolloff.

Are we saying the greater the gain, the steeper the slope (not just the longer the hill), and is the slope still steepest at the mid point?

How is the "instant slope" defined?


Gale

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 1:32 pm
by Paul L
Videogamer555, your needs may be accommodated by some people here, or maybe you will even be motivated to learn to do it yourself, with Nyquist plug ins that will be usable without waiting for newer versions of the Audacity binaries. But don't confuse what a filter does with what the graphical display does.

Some effects require one or two frequency numbers as inputs. Spectral selection is simply about another means of supplying those numbers from mouse drags instead of requiring typing. The suite of features that will ship with it, that are aware of its inputs, is small and basic for now but can be easily extended by advanced end-users like Robert.

So even without version 2.1.0, Nyquist effects that require explicit numerical input may still be devised to do what you want. Audacity has long been designed for such extensibility.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 8:44 pm
by steve
Gale Andrews wrote:That's the old text, so I assume a copy/paste error here.
Oops, my mistake :oops:

The current text:
  • When the spectral selection begins at 0 Hz this effect applies a low-frequency shelving filter with the half-gain frequency defined by the upper frequency of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high-frequency shelving filter with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency, and upper and lower boundaries this effect applies both low- and high-frequency shelving filters. In this case the half-gain frequency of the low shelf filter is defined by the lower frequency boundary of the spectral selection and the half-gain frequency of the high shelf filter is defined by the upper boundary of the spectral selection. The gain control sets the amount of boost or cut between the two frequencies.
Gale Andrews wrote:as a layman I find it confusing that there is now no reference at all to slope, given the other spectral edit effects mention rolloff.
Yes, but your view is now biased from reading the previous text which specified slope (albeit incorrectly).
The other shelf filter that is shipped with Audacity is the "Bass and Treble" effect. That does not mention what the slope is, and never has, but to my knowledge there has not been a single person query that in the two years that we have been shipping the effect.

Being pragmatic about this, why does it matter to the user what the slope is? They can't change it even if they want to. We could provide something like Robert's table of mid-transition band slope for different gain settings, but to most users that will be meaningless, and for those that do understand it is really just details about the inner workings of the effect - like telling a car driver what the alternator voltage is at various engine rpm speeds. The only way that a user will really know if the effect does what they want is for them to use it. Either it does what they want or it doesn't.
Gale Andrews wrote:How is the "instant slope" defined?
There's a case in point. You are an Audacity expert, but even for you the technical details provided by Robert, although precise, and clear, do not convey precise meaning. That's no criticism of yourself, but the technical details are "technical". To properly define "instant slope" see: http://en.wikipedia.org/wiki/Differential_calculus, but that is far more technical than the knowledge required to use the effect. The "half gain frequency" is an important concept for being able to effectively use the effect, as is the "gain", but the precise slope is not really relevant - even the author of the effect quoted the slope incorrectly, but no doubt tested the effect to see and hear that it performed in the way that he wanted. How the effect performs in practice - what it "sounds like" - is the really important issue, but that can only really be appreciated by using the effect.

A loose definition of "instant slope" is "the steepness at a specific point". In this case, the "specific point" is half way up the hill (the "half gain" point).
Partly guessing, I think that Robert approximated the "instant slope at the half gain point" by calculating the slope between two points close to and either side of the half gain frequency. The formula for that would be something like:

Code: Select all

(a1-a2)/(log(f1/f2)/log(2))
where f1 and f2 are the two frequencies and a1 and a2 are the amplitude gain at those frequencies.

Making a quick test myself, I applied the shelf filter with a half gain frequency of 1000 Hz and a gain of 12 dB to an impulse signal.
Plotting the spectrum and exporting provided these figures either side of the half gain frequency:

Code: Select all

Frequency (Hz)	Level (dB)
990.527344	-4.288725
1033.593750	-3.847514
Putting those figures into the above equation:

Code: Select all

(4.288725-3.847514)/(log(990.527344/1033.593750)/log(2)) = -7.185783205 
which is pretty close to Robert's figure of -7.3 dB per octave.
Gale Andrews wrote:Are we saying the greater the gain, the steeper the slope (not just the longer the hill), and is the slope still steepest at the mid point?
As Robert wrote, the maximum slope for this type of filter is 12 dB per octave, but for small gain levels the slope is less (as shown in his table).
I previously wrote that this type of filter has a half gain slope of about 12 dB per octave, which is correct for large gain values, but as Robert illustrated is not the case for small gain values, and that as the gain range in this effect is limited to +/- 24 dB, the actual slope for "Spectral edit shelves" will always be substantially less than 12 dB per octave.
Yes, as can be seen in Bill's graphs, the slope is steepest at the half gain point (the mid point of the transition band):

Image

The slope of the filter could have been made constant steepness at the half gain frequency by automatically calculating the filter Q value (fixed at 1.0 in the current version) necessary to produce the required slope, but the filter response would then necessarily become peaky at low gain settings to maintain the slope steepness. We don't mention the filter Q value in the documentation, though that is a more meaningful measure than the slope for this type of filter. I think that mentioning the filter Q would be too much information for most users.

Re: Suggestion (Bandpass Filter and Custom FFT Filter)

Posted: Wed Jan 21, 2015 9:56 pm
by Robert J. H.
Gale Andrews wrote:
steve wrote:The revised text:
  • When the spectral selection begins at 0 Hz this effect applies a low-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the upper frequency of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high-frequency shelving filter with a rolloff of 12 dB/octave and with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency, and upper and lower boundaries this effect applies both low- and high-frequency shelving filters. In this case the half-gain frequency of the low shelf filter is defined by the lower frequency boundary of the spectral selection and the half-gain frequency of the high shelf filter is defined by the upper boundary of the spectral selection. The rolloff for both filters is 12 dB/octave. The gain control sets the amount of boost or cut between the two frequencies.
http://manual.audacityteam.org/man/Spec ... it_shelves
That's the old text, so I assume a copy/paste error here.

The current text removes reference to the slope completely.

I'm obviously not a filter expert but as a layman I find it confusing that there is now no reference at all to slope, given the other spectral edit effects mention rolloff.

Are we saying the greater the gain, the steeper the slope (not just the longer the hill), and is the slope still steepest at the mid point?
The steepness rises until the curved segments are separated by a more or less linear portion. This does not happen for the available effect range of +/-24 dB. The "instant" slope is about 11 dB there (measured at 1000 Hz).
The average of 6 dB/octave is faster reached.
BTW I don't know why the gain is restricted. Paul states in the comment that the program may crash with higher gains.
That's a new one for me. I've not encountered a problem with e.g. 120 dB cut (boost might be another thing).
How is the "instant slope" defined?


Gale
Its not an official name, I think. I mean the slope in a single point.
In my sample, it is just a partial differentiation within 2 cents around the center frequency, i.e. extrapolated from a 1/600 octave.
One could of course search for this value directly with the given filter transfer function (i.e. define the range as infinitesimal small and solve the differential equation). However, it's precise enough, considering a digital filters round-off errors.

We could describe the slope in a separate sentence instead of mentioning the roll-off for all 3 cases repeatedly.
Or we give a table with different gains.