Nyquest prompt notch function

Using Nyquist scripts in Audacity.
Post and download new plug-ins.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Nyquest prompt notch function

Permanent link to this post Posted by cnwtx » Sat Aug 14, 2010 11:17 pm

I am wondering if there is a method to eliminate a range of frequencies using the Notch feature of the Nyquest
prompt. For example: to remove all frequencies between 500 and 700 Hz.

Thanks,
Cliff
There are 10 types of people in the world, those who understand binary and those who don't
cnwtx
 
Posts: 46
Joined: Fri Aug 13, 2010 2:14 am
Operating System: Please select

Re: Nyquest prompt notch function

Permanent link to this post Posted by steve » Sun Aug 15, 2010 11:02 am

The notch filter produces a characteristic "V" shaped filtering with the greatest attenuation at the centre frequency.
See here for more information: http://www-k.ext.ti.com/SRVS/Data/ti/Kn ... /notch.htm

...so you could use a notch filter with a centre frequency at around 590 Hz and adjust the "Q" to provide the required filter width (higher "width" value for a more narrow notch).
For example:
Code: Select all
(setq freq 590)
(setq width 1.0)
(notch2 s freq width)


Alternatively, you may be better to use a "band stop" filter.
To do that, you simply combine a low pass filter (set at the lower frequency range) with a high pass filter (set at the upper frequency range).
For example:
Code: Select all
(setq low-f 500)
(setq hi-f 700)
(sim
  (lp s low-f)
  (hp s hi-f))


In this example, the slope of the high-pass and low-pass filters are only 6 dB per octave, so the amount of attenuation between the low and high frequency limits will only be around 2 dB. For steeper filter slopes you can use higher order filters such as highpass2 highpass4 highpass8 lowpass2 lowpass4 lowpass8.
For example:
Code: Select all
(setq low-f 500)
(setq hi-f 700)
(sim
  (lowpass8 s low-f)
  (highpass8 s hi-f))


note that the filter frequency in the above example refers to (approximately) the -3 dB point of the filter. For greater attenuation at 500 Hz and 700 Hz you would need to set hi-f and low-f for a wider band.

For even steeper filter slopes you can use multiple passes through the filters, though this will tend to introduce ringing near the corner frequencies if you go too extreme.
This example produces a cut-off at around 98 dB per octave - which works out as -6 dB at the corner frequencies and -20 dB at 590 Hz:
Code: Select all
(setq low-f 500)
(setq hi-f 700)
(sim
  (lowpass8
    (lowpass8 s low-f)
  low-f)
  (highpass8
    (highpass8 s hi-f)
  hi-f))

This is not actually much better than the more simple 48 dB per octave filter (above), but will show improved attenuation for wider stop bands.

(I've moved this topic to the "Nyquist" part of the forum)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46549
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Nyquest prompt notch function

Permanent link to this post Posted by cnwtx » Sun Aug 15, 2010 6:53 pm

Okay... This should solve most of the problems that I have been having.
I assume that to remove all frequencies below, say, 100 Hz, I would enter the low frequency at 0 Hz?

Thanks,
Cliff
There are 10 types of people in the world, those who understand binary and those who don't
cnwtx
 
Posts: 46
Joined: Fri Aug 13, 2010 2:14 am
Operating System: Please select

Re: Nyquest prompt notch function

Permanent link to this post Posted by steve » Sun Aug 15, 2010 8:04 pm

cnwtx wrote:I assume that to remove all frequencies below, say, 100 Hz, I would enter the low frequency at 0 Hz?

Just use a high-pass filter.
from the Nyquist Prompt that would be something like (hp s 100) or (highpass4 s 100) or whichever high-pass filter you want to use.
Alternatively there is a high-pass filter in the Effect menu (Audacity 1.3.12) that does exactly the same.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46549
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu


Return to Nyquist



Who is online

Users browsing this forum: No registered users and 4 guests