Circuit Lake

Electronic Project and Circuit Collection

AVR Digital Hum Nuller

08/16/2011 Category: Audio, AVR, Microcontroller, Project

This ATmega168-based digital comb filter built to clean a realtime audio signal. It can remove the ubiquitous 60Hz (50Hz in some countries) hum noise caused by power lines and household electrical wiring. Since the noise is not strictly sinusoidal it is necessary to remove all harmonics of 60Hz, and that is what this filter does.

Audio Hum Nuller Filter

Dan Stahlke, project designer, explained that the hum cleaning algorithm works by building a sort of average background waveform and then subtracting this from the signal to pick out only the non-periodic features. The result is that signals that oscillate at 60Hz or multiples thereof get attenuated while everything else passes through unchanged. The bandwidth is limited to 24kHz due to both RAM and CPU constraints in the ATmega168 chip. As a workaround it is possible to use the digital filter to just output the simulated background waveform and subtract this from the signal using an analog circuit.

Filtered waveforms from this project will be output via the serial port when PD3 is not tied to ground. If you are running Linux and have a serial port capable of a 2M baud connection (an FTDI-USB cable will do) then you can use the included oscilloscope program to view these waveforms on your computer.

Hum Filter
Project Firmware, Schematic and Documentation