Resonant Filter

Not much to say about it. It’s a resonant filter.

The “bandpass” version is equivalent to applying the high-pass and the low-pass resonant filters.
See here for how to install: http://audacityteam.org/download/plugins

Using a high resonance setting will probably produce peaks over 0 dB, so be sure to work in 32 bit float format so that you can amplify it back down into normal (below 0 dB) range.

OBSOLETE:
resonant.ny (1.15 KB)
:OBSOLETE

Current version: [u]on the Audacity wiki[/u]

That’s OK if it’s documented, but as it stands looking at the plug-in, it looks unintuitive IMO. “High then low” though not ideal would be clearer.


Gale

What is a bandpass resonant filter if not a resonant filter that rolls of below and above the resonant peak?

Correct me, but that’s an upside down notch filter. You could integrate the two, using a gain or loss slider that went through zero in the middle where it didn’t do anything. The sides, slopes, Q, etc. are identical.

Koz

A bandpass filter normally passes frequencies between a range. There is no range control.

I do vaguely understand that you can create a bandpass filter by combining low pass and high pass, but I don’t think everyone will know this.

If this goes on Wiki and you say what that control means, then it’s acceptable.


Gale

The properties that define a bandpass filter are:
Lower corner frequency (f1)
Upper corner frequency (f2)
Centre frequency (fc)
Bandwidth
Q

(illustration from Wikipedia

To fully define a bandpass filter it is not necessary to use all of these terms. The filter may be fully defined by either “upper and lower corner frequencies and Q”, but more commonly bandpass filters are defined by “centre frequency, bandwidth and Q”.

fc = (f1 + f2)/2 = f1 + bw/2 = f2 - bw/2
In addition to “Q”, only two of the remaining 4 parameters are required and most commonly it is the centre frequency and bandwidth

A resonant filter is a special case of high, low or bandpass filter where the Q is “too high” so that it causes ringing at fc.
For a bandpass filter to ring at a singe frequency (fc), then the “upper” and “lower” filter frequencies must be the same (otherwise there will be two resonant frequencies).
Bandwidth is thus determined by the Q (or vice verse).
so it is only necessary to define fc and bw, or fc and Q.

On synthesizers it is most common to use the more descriptive term “resonance” rather than bandwidth or Q. A high Q setting = narrow bandwidth = high resonance. They are three ways to describe the same thing.

In the built-in Nyquist resonant filter, Roger Dannenberg uses “centre frequency and bandwidth”:
(reson sound center bandwidth n)
http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html#index419

He could just as easily have used “centre frequency and Q” or “centre frequency and resonance”.
In physics and engineering it is more common to use either the term “Q” or “bandwidth”.
In musical applications it is far more common to use the term “resonance”.
I’m not inventing new terms, I’m using the terms that are in most common usage in musical applications.

Which seems like good text for the plug-in’s Wiki page (apart from the “singe frequency”).

I certainly had to spend a while figuring what you meant by “bandpass” in this context, so especially if you use a “friendly” term like “Resonant” you may expect some confused users along the way. I don’t think it especially matters if you use “Band Pass” in the plug-in as long as you document it.

What you possibly forget is that naive users may not think of curves, but are thinking more like a knife cut with nothing above or below (and with no rolloff value here there is nothing quite so obvious to suggest otherwise).


Gale

I’ve made a few minor changes to the interface.

After a bit of research, this appears to be the most common order for the controls and seems like a sensible order.
(also suggested text for the documentation)

  • Filter frequency: [1 to 20000 Hz] Sets the resonant frequency of the filter. The frequency must be less than half the track sample rate.
  • Resonance (Q): [0.1 to 100] Sets the amount of resonance. The higher this is set, the greater the peak at the resonant frequency and the narrower the boosted frequency range. Resonance occurs with Q values greater than 0.707. At 0.707 the filters behave as a conventional second order high-pass, low-pass or combined high-pass and low-pass (bandpass) filter. Below 0.707 the transition from passed frequencies to stopped frequencies is more gradual. Values greater than 100 may be set by typing the required value into the text box.
  • Filter type: [Low Pass (default), High Pass, Band Pass]
  • Low pass allows low frequencies to pass and reduces the level of high frequencies. “Resonance (Q)” values greater than 1 will cause a significant boost at the filter frequency
    • High pass allows high frequencies to pass and reduces the level of low frequencies. “Resonance (Q)” values greater than 1 will cause a significant boost at the filter frequency.
    • Band Pass reduces the level below and above the filter frequency. “Resonance (Q)” values greater than 1 will cause a significant boost at the filter frequency. The effect is equivalent to applying both a high-pass and a low-pass filter with the same filter frequency.
  • Output level: The resonant filter will typically cause the filtered output to have a higher level than the original waveform so an output level control is provided so that the output level may be reduced. As the actual output level cannot be accurately predicted before processing, it is highly recommended that the audio track should be set to 32-bit float format so that if the filtered track exceeds 0 dB the Amplify or Normalize effects may be used to bring the level back down to below 0 dB without clipping.

I could also include this as an introduction:

A resonant filter is a special case of high-pass, low-pass or bandpass filter where the Q is “too high” so that it causes ringing at filter frequency.

For a bandpass filter to ring at a single frequency, then the “upper” and “lower” filter frequencies must be the same (otherwise there will be two resonant frequencies). Bandwidth is thus determined by the Resonance (Q) setting.

And the updated plug-in:
resonant.ny (1.26 KB)

Thanks. I think the output level slider is a good idea.

Perhaps rather than state “Resonance (Q)” values greater than 1 will cause a significant boost at the filter frequency" three times, put that once after “Resonance occurs with Q values greater than 0.707” in the “Resonance” section?

The first paragraph should definitely be included in my opinion.

Instead of “(otherwise there will be two resonant frequencies)” you could possibly say “hence there is only a choice of a single filter frequency in this plug-in”. Just a suggestion…

I bet we’ll be asked on seeing “0.7071”, “Does this use a 12 dB rolloff, then”? The official answer is…?


Gale

Here I go again, coming late to the party!

I’ll confirm that statement about “naive users”. Until I used the Plot Spectrum analysis before and after using the High-pass filter I thought that ALL sound below the threshold would be eradicated. What actually happened seemed to be that sound below the threshold was progressively attenuated. I have said this before, but I think that expert users (not just in Audacity but in any field of endeavour) have a tendency to be unable to think like a novice user. Prior to my retirement I was a driving instructor. For the safety of all road users, I had to learn to think like a novice driver in order to read a traffic situation as they would be reading it. Only then could I anticipate their actions and be ready to correct them before they got themselves into potentially dangerous positions.

One further thought from a novice user: what the hell is “Q”? It means absolutely nothing to me.

The user interface should never assume “technical knowledge” on the part of the user. If technical knowledge is required in order to use that “tool”, the knowledge should be readily available at the point of usage (via a Help button, a Tooltip, a hyperlink or whatever).

Thanks Gale for the suggestions regarding documentation text - all good.

The “official” answer is: Yes, when Q = 0.7071 the roll-off is 12 dB/octave.
The technically correct answer is “when Q = (sqrt 2)/2 the roll-off is 12 dB/octave.”


I don’t completely agree.

This plug-in is not intended for distribution with Audacity. It is a somewhat “specialist” tool, intended as an optional (additional) plug-in.
For the majority of Audacity users this type of filter is without use. Probably the most likely use is for messing with sound synthesis and as such the target audience is probably a little more technically inclined than most users.

If you look on almost any sound desk (console) over $500 you will find a “Q” control in the channel equalisation, without any “point of usage” indication of what it does. Such desks are intended for professional, semi-professional or enthusiastic amateur users and as such it is quite reasonable to expect the user to either know what it is, or to rtfm.

I do fully agree that “Q” is likely to have no meaning for the vast majority of Audacity users, and that is one of the main reasons that I have long wanted it to be removed from the standard high-pass/low-pass filter effects.


Going a little off-topic here, but that is a very common misconception.
We have tried to address that in the latest version of the manual:
http://manual.audacityteam.org/man/High_Pass_Filter
http://manual.audacityteam.org/man/Low_Pass_Filter

It would be nice to have context sensitive help, where the appropriate part of the manual could be opened directly from the effect, but we don’t yet have that.

@Steve,
Thanks for the detailed response. I take your point about advanced users of advanced tools having appropriate technical knowledge. The link to the High Pass filter page in the manual was enlightening. However, the manual and the product are out-of-synch. See the two screen grabs below.
Audacity-2012-06-17-1.JPG
Audacity-2012-06-17-2.JPG
Note that I have not checked the Low Pass manual entry against the product. It might also be out-of-synch.

regards,
Peter

The link that I gave is for the “latest version” of the manual, which is the “development” version. http://manual.audacityteam.org/man/High_Pass_Filter
which is in sync with the soon to be released 2.0.1 version.

The “current release version” of the manual is in sync with the release (2.0.0) version of Audacity and has a much shorter entry: http://manual.audacityteam.org/manual/help/manual/man/effect_menu.html#filters

OK. Now I understand. Thanks.

Here’s a bandpass filter after my own heart: :wink:
http://www.gvst.co.uk/gband_manual.htm .

Have we got a Nyquist bandpass filter somewhere? I could not find it. Or is this it?


Gale

This is it. (first post: Resonant Filter )

Should the “Output Level” control not be called “Gain”? I had forgotten why it was included, so I was misled at first.

If we ever have a combined High Pass/Low Pass/Band Pass/Band Stop filter in Audacity, will the Band Pass also be a resonant filter, the only difference being that the Q default will be set lower?


Gale

Yes, or “amplification” or something similar.
It would probably be more convenient if it really were “output level”, but with the current implementation of Nyquist that requires loading the entire selection into ram, which will crash or freeze if the selection is longer than the available ram .

General purpose filters are usually tuned so that the passband is essentially flat. The classic example being a Butterworth filter. Tweaking just one parameter changes how steep the filter is (for a given “order”) and how sharp the “corner” is. For this algorithm (which is probably the most widely used) the sweet spot is a value of sqrt(1/2) or 0.707106781 which produces a Butterworth response. Lower values reduce the steepness and give the corner a larger radius. Higher values can give a slightly steeper initial transition and tighter corner, but create a peak at the corner frequency. The higher the value, the greater the peak (more “resonance”).

In most cases one would want to avoid resonance, but it can be useful as an “effect”.

Resonant filters are widely used in sound synthesis. It is very common for “synthesizers” to include resonant filters that can sweep across a frequency range, often where the centre frequency can be controlled by a low frequency oscillator. In the old days, a “LFO” (low frequency oscillator) would produce a “control voltage” that could be connected to the resonant filter to control the centre frequency. In modern DAW applications a “MIDI control message” can often be connected to the filter to allow “automation” of the centre frequency.

As no doubt was written earlier in this topic, band pass/stop filters can be defined either by the centre frequency and width (usually in octaves), or by specifying the lower and upper corner frequencies. I think the latter is easier for novices. “Advanced” users will probably be more familiar with the former but should have little difficulty with the latter.

So I would recommend making that change and moving to Wiki.

I’m glad you agree on that.


Gale