08 December 2007

Comb Filter to effect a frequency and its harmonics!

After I did all that work described in my last post, my friend Jerry emailed to tell me that you can effect a frequency and all its harmonics at once with a Comb Filter. Sure enough, once I knew the name I looked for Comb Filter and found that David R. Sky, the same guy that designed the Nyquist-language Notch Filter that plugs in to Audacity has also designed a Comb Filter for it. I have now downloaded the comb filter and installed it the same way I did the Notch Filter. It can be found at: http://audacity.sourceforge.net/download/nyquistplugins

I don't have time to play with it right now, because I have to do my content editing tonight, but next time I'll try that first.

Here's what David wrote about it on the Sourceforge download page:

Comb filter | View comb.ny | Download comb.zip

Example audio clips: [MP3 Clip 1]

The name 'comb' filter comes from how it acts on the audio spectrum of what it's applied to: it looks like a comb with the teeth pointing up. For example, if you set the comb frequency at 1000 Hz, the comb filter emphasizes 1000 Hz as well as 2000, 3000, 4000 and so on Hz. This particular plug-in produces an 'airy' effect, which is more pronounced the higher the comb decay value is set, and resonance is increasingly produced as well.

A comb filter can be produced using flanger-like settings on a delay effect, but this filter does not use a delay to get the result, so it does sound somewhat different.

Written by David R. Sky

60 cycle hum removal using Audacity and Notch Filter

Audacity is the free and open-source audio editing program available from Sourceforge. I prefer the Beta version, which has important new features compared to the so-called "stable" version. You can download Audacity itself at: http://audacity.sourceforge.net/download/

For this editing project, I was working with audio recorded by someone else using a telephone line, and somewhere in the phone line or the setup there was a very typical 60-cycle hum, of the type induced by electricity, which got recorded on the original track. (Note, we are both in North America. In some countries the electricity induces a 50-cycle hum instead.) Some audio editing programs have a plug-in that comes packaged with them that will let you choose to eliminate this kind of hum and its harmonics in one pass. Audacity, as far as I can tell, currently does not.

To improve this hum, what I did was:

First, I installed the Nyquist plug-in called Notch Filter. (There's a link to this download page at the end of this article.) The Notch Filter lets you narrow in on a very specific frequency and notch it out of the sound. (The analog tool I used to use for this kind of problem is a parametric equalizer.)

With this digital notch filter, you choose a "notch frequency" and a "notch q" - the Q determines how wide a spectrum of frequency you are choosing, centred around the frequency you chose.

I found and highlighted a section with only the ambience and the hum, and tested on that until I got an acceptably low noise level. Here's what I had to do:

For 60 cycle hum, I chose 60 for the notch frequency and set the notch q to the highest number (the narrowest bandwidth) - which was 5. It was hard to tell any difference so I went through and did the same for each of the harmonics: 120, 180... all the way through 720. This was fast when applied to the test segment, but took about 30 seconds each pass for the entire almost-30-minute piece.

When I had finished, I thought too much of the low end had been lost.

So, I re-imported the original file (post normalization), and using the Amplify function, I took it down by trial and error to -14db below its original level. Playing this together with the multiply-Notched file restored the hum slightly, though at a lower level, but it also restored some low end to the voice. As the low end had been a bit overloud on the original, this was a nice combination.

I exported the two files in a mixdown to a combined .wav file, and with that proceeded to editing the content itself.

Here's the page where I found the advice on harmonics:
http://recordrestoration.com/01-Get%20Rid%20of%20Noise.htm

3-The first thing you will do is eliminate any 60 cycle hum present in the waveform. Go to Effects/Filters/Notch Filter. In the "Presets" box, click on "60Hz + Harmonics." The notch width box should be set to "super narrow." Click "OK" and the notch filter will remove any 6o cycle hum present. (The filter actually very selectively removes 60 cycle hum + its harmonics, 120, 180, 240, etc.). The frequency ranges filtered out in this step are so narrow that the loss will not be audible. If you are in a country that uses 50 cycle AC current, instead of the "60Hz + Harmonics" preset selection, choose "50Hz + Harmonics." If you are sure there is no AC hum present in your waveform, you can forego this step.


Here's the information and link about the Notch Filter - you have to follow the link and then search or scroll down to the plug-in you want (Notch Filter), then click through where it says Download Notch and that will offer to save to your computer:

http://audacity.sourceforge.net/download/nyquistplugins

Notch Filter | View notch.ny | Download notch.zip

Notch filter

Like its name suggests, a notch filter cuts out a "notch" in the spectrum of your audio. The default frequency is 60Hz, great for removing 60Hz electrical hum, in case your recording equipment has picked this up.

The second control, q, determines the width of the notch cut from your audio. Default q is 1, below 1 creates a wider notch, above 1 creates a narrower notch.

Works on mono and stereo audio.

By David R. Sky


After you download and run the installer program for the Nyquist Notch Filter, you have to save the file for the plug-in to C:\Program Files\Audacity\Plug-ins [or, instead of Plug-ins you might install it in a folder named Nyquist]. When the program is installed it appears as Notch Filter, in the bottom section of Audacity's Effects list (see the pulldown menu under Effects on toolbar).