High pass / low pass / band pass / band cut filter

This is a filter plug-in that can perform high pass, low pass, band pass and band stop filtering.

Controls:

  • Filter type: [High Pass, Low Pass, Band Pass, Band Cut. Default High Pass]
  • High Pass Filter passes frequencies above its cutoff frequency and attenuates frequencies below its cutoff frequency. This effect can therefore be used to reduce low frequency noise.
    • Low Pass Filter passes frequencies below its cutoff frequency and attenuates frequencies above its cutoff frequency. This effect can therefore be used to reduce high pitched noise.
    • Band Pass filter passes frequencies within the specified frequency range and attenuates frequencies below and above this frequency band.
    • Band Cut Filter attenuates frequencies within the specified frequency range and passes frequencies below and above this frequency band.
  • Rolloff (dB per octave): [6 dB, 12 dB, 24 dB, 36 dB, 48 dB. Default 6 dB]
    Sets the steepness of the attenuation. Higher rolloff values give a steeper attenuation of frequencies above the cutoff frequency. For example, with a rolloff of 6 dB per octave, the sound decreases by 6 dB in amplitude for each octave above the cutoff frequency (an octave above is double the frequency)
  • Frequency (Hz): [1 to 20000 Hz. Default 1000]
    For high pass and low pass filters, this is the -3 dB corner frequency. For band pass and band cut filters this is the centre frequency.
  • Band filter width (Hz): [1 to 10000 Hz. Default 1000 Hz]
    This applies only to band pass and band cut filters and is the width of the filter frequency band.
  • Crossfade filter in/out (ms): [0 to 100 milliseconds. Default 0]
    When set greater than 0, the processed sound will be introduced with a short crossfade from the original audio at the beginning and end of the selection. This control sets the length of the crossfade.

Installation instructions:
http://wiki.audacityteam.org/wiki/Download_Nyquist_Plug-ins#Installing_Plug-ins

After installation and restarting Audacity the effect will appear in the Effect menu and is called “Filter…”


The “Crossfade filter in/out” control:

When applying a filter to a section of audio, there is likely to be a “glitch” (pop) occur at the start / end of the selection unless the selection can be made such that the waveform is close to silence at the start/end of the selection. Sometimes it is not possible or not practical to make the selection start and end close to silence and this is the purpose of the “Crossfade filter in/out” feature. If this control is set greater than zero, there will be a short crossfade automatically applied at the start and end of the selection, thus avoiding clicks at the start or end. A setting of around 20 milliseconds is usually sufficient to avoid clicks.

If required for a special effect, the crossfade duration may be set longer than 100 ms by typing the required value in the text box. The crossfade duration cannot be more than half of the length of the selection.


Filter frequency range:

Filter frequencies cannot be greater than half the sample rate. Note that for a band pass or band cut filter the filter frequency will be higher than the “centre frequency”. for example, for a centre frequency of 10000 Hz (10 kHz) and a band-width of 15000 Hz (15 kHz) the audio will be filtered between 500 Hz and 20000 Hz (10000 Hz is the centre of this range on a logarithmic scale).
filter.ny (2.91 KB)

You appear to have left out the All Cut filter, although I suppose you could get there with appropriate values of High Pass and Low Pass. Does Band Cut go to infinite bandwidth? Koz

That’s the secret hidden function. Press Ctrl+L (Command+L)

No. See the note “Filter frequency range:” in my previous post.

If you’re interested, here are the (Q-)values for lowpass10 (-60dB/octave). It follows the conventions of the predefined Nyquist functions. The values apply equally to Highpass10 when lowpass2 is replaced by highpass2.

(defun lowpass10 (x hz)
  (lowpass2 (lowpass2 (lowpass2 (lowpass2 (lowpass2 x 
            hz 3.1969) 
          hz 1.1013) 
        hz 0.7071) 
      hz 0.5612) 
    hz 0.5062))

It would be nice when the odd ordered filters would also be included (lowpass3 … lowpass9) for roll-offs of 18 dB, 30 dB … 54 dB.

Hi,

The band-cut have no effect on my track or selection.

Tested with those settings:

(I tweaked the settings with no success.)

to cut this frequency peak:

However, the band-pass works with the same settings.

I know there are other plugins to do that but I love all the options, especially the Band filter width (Hz) option instead of being octave or Q.

Please could you fix it.

config: windows xp sp3, audacity 2.0.5

The frequency band that you are attempting to produce is too narrow for this type of filter. You need to use a “notch filter” to achieve such a narrow stop band. There is a notch filter included in Audacity. http://manual.audacityteam.org/o/man/notch_filter.html

This type of filter can be expected to work down to around 1/4 octave stop band width, which for a centre frequency of 6450 Hz is a bit over 1000 Hz.
As a rough guide, to calculate the minimum width that will work for the 48 dB per octave band stop filter, multiply the centre frequency by 0.18.
6450 x 0.18 = 1161 Hz
That will give you around 6dB attenuation at the centre frequency.

There is another band-stop filter available here: http://wiki.audacityteam.org/wiki/Nyquist_Effect_Plug-ins#Band_Stop_Filter
In this filter, the band width is specified in octaves. The minimum width is again 1/4 octave, but it will produce a much steeper roll-off, thus the attenuation within the frequency band is very much greater than for the “High pass / low pass / band pass / band cut filter”.

Thanks for your explanation.

I have good result with the notch filter but I hoped there were a more user friendly plugin to cut off a frequency or a narrow range that will simply allow user to enter the range in frequency (not octave or Q ratio).

Ex 1:

lower cutoff frequency = …
upper cutoff frequency = …

or

EX 2:

center frequency = …
band filter width (Hz) = …

Do you think it is just impossible to write a such plugin for audacity?

The problem is in defining filters in a meaningful way.

Frequency filters are not “on/off” things. There is always a transition between the “pass” range and the “stop” range. Different types of filter have different characteristics, and are usually described in terms that are appropriate for the characteristics.

For the “High pass / low pass / band pass / band cut filter” it is reasonable to define the pass band or stop band as an upper and lower frequency value because they are simply a high pass filter and a low pass filter combined. High pass and low pass filters are generally defined in terms of the -3dB point (the "corner frequency) and the “slope” of the filter (how many dB attenuation per octave beyond the corner frequency). This is only really appropriate if the slope is fairly linear (a constant number of dB per octave). For “Notch filters” that is not the case. Typically Notch filters have an increasing slope approaching the centre frequency, thus they are generally defined in terms of centre frequency and “q”. Specifying the “slope” of a notch filter is meaningless because it depend on what part of the transition curve is being measured.

This is a notch filter with a centre frequency of 1000 Hz, q = 0.5
Do you see the difficulty in specifying the lower and upper frequency limits?

Yes but it would be more meaningful for common users to set the range to cut off (slope being automatically calculated according to it) in frequency range. Plus the more the frequency to cut off is high, the more a same given Q ratio apply a wider cut off. So it can be hard to precisely cut off a high frequency in the rare cases when high-cut can’t be used.

Sorry, I’ve read that 3 times and I still don’t understand what you are saying.