08 December 2007

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).

4 comments:

Anonymous said...

Reading these kind of posts reminds me of just how technology truly is undeniably integral to our lives in this day and age, and I am fairly certain that we have passed the point of no return in our relationship with technology.


I don't mean this in a bad way, of course! Societal concerns aside... I just hope that as the price of memory drops, the possibility of copying our brains onto a digital medium becomes a true reality. It's one of the things I really wish I could experience in my lifetime.


(Posted on Nintendo DS running [url=http://kwstar88.zoomshare.com/2.shtml]R4i[/url] DS OperaV2)

Anonymous said...

Thanks for this post. I've been trying to find a way to remove 60 Hz hum for years. I would never have thought about removing the harmonics too. It really works.

Anonymous said...

Awesome post once again. I am looking forward for more updates=)

Anonymous said...

I really like iit when people come together and share ideas.

Grezt site, keep it up!