An Audio Comb Filter for Switched-antenna RDFs

(And a "Mini"  version of the comb filter - read about it here)

"Do I really want to remove that tone?"

After using a "Doppler"-type of ARDF unit for a while, one learns to pick up subtle audible cues that tell something about the possible quality of the bearing:
  • Distortion.  If the audio becomes more distorted, it is likely that one is experiencing multipath and that the displayed bearings should be considered to be suspect.
  • Harmonics of the switching tone.  If the "timbre" of the switching tone changes, this also may indicate that multipath is present and degrading the accuracy of the bearings.
  • Brief changes in the sound of the tone.  While moving in a vehicle, brief instances of multipath can show up as short-term changes in the way the tone and audio modulated onto the received sounds, including a change in the timbre and/or distortion.
The question has been asked "Won't a notch filter remove these potentially, valuable audible clues from the received audio?"

Having used this sort of ARDF system - both with and without a comb filter, I can say that such information is not removed - but it is changed slightly.

When multipath is occurring, this implies that some sort of distortion is also present in the audio.  What this means is that it is likely that the switching tone will get mixed with the audio that is being modulated onto the carrier and that artifacts at frequencies other than that of the tone (and its harmonics) will be produced:  These artifacts have a very distinctive sound, even with the comb filter active.

Likewise, those transient changes caused by "mobile flutter" (brief instances of multipath experienced in a moving vehicle) also cause audible artifacts - even with the comb filter active.  Not only are there mixing products with the modulated audio that are readily apparent, the rapid changes cause modulation sidebands to appear on the switching tone, increasing the bandwidth:  Because the notches in the come filter are so narrow, these sidebands aren't well-filtered and show up as a sort of "pinging" in the audio - and this is true even if one is monitoring an unmodulated carrier.

From experience, I know that even with the comb filter active, I can still rely on audible artifacts to indicate - without having to look at the the display - various aspects of the quality of the signal being received, such as multipath - and there isn't that constant, tedious tone present all of the time!  For more information about mobile use, read below.

Any "active" direction-finding system that switches antennas necessarily modulates the received signal with its switching signal:  After all, it's the phase of this signal relative to the switching of the antennas that is used to determine the bearing.  The resulting tone, however, can become tedious after a while and it can obscure some of the contents (e.g. modulation) on the signal.  This can especially be a problem if the modulation is very low or there are some background noises on the signal that might give some clues as to its origin.

The switching of the antenna array superimposes upon it a waveform that has the fundamental and harmonics of the original switching frequency, and the harmonic content can vary widely.  Removal of these switching components requires that the filter remove not only the fundamental, but these harmonics of it as well.

Note that this filter may also be useful if you are using another receiver whose antenna is anywhere near your Doppler switched antenna system:  Because switched antennas tend to "space modulate" the local environs, any other receiver and/or transmitter nearby will be afflicted with the switching tone to some extent.  (While this won't get the tone out of your transmitted signal, it will likely remove it from the received signal.)

Finally, there are occasions where listening one may want to listen to the tone:  The practiced ear can often tell - just from the tone - if the received signal is being distorted by multipath (or other types of) distortion.  The presence of such distortion may alert the user that the readings being obtained may not be valid.  For this reason it should be possible to switch the filter out of the audio path.

Note:  While the rotation frequency for the Montreal Doppler II is 500.8 Hz, the Doppler III's rotation is approximately 499.3 Hz using Jacques' original firmware:  If you are interested in using this comb filter with the Doppler III, let me know.  Note that the alternate firmware for both the Doppler II and Doppler III operates at 500.8 Hz.

Please note:  This is NOT an official page of VE2EMM and he cannot be reasonably expected to answer questions pertaining to it.  If you have questions/comments about this page, please direct them using the contact information at the bottom of this page.

Tackling the problem:

In this particular case we are using the VE2EMM Montreal II Doppler unit.  This unit switches the antennas at 500.8 Hz (5 MHz/9984 to be precise) and this frequency is from a quartz crystal reference. (Note:  This comb filter may be modified to use other frequencies as noted later.)  Having such a stable frequency makes it much easier to notch out the switching tone and its harmonics as these are very stable and predictable.  Because we are actually removing the fundamental and its harmonics, we need a comb filter.  This type of filter does precisely as its name implies, an effect easily visualized with the aid of a spectrum display (see below.) Comment:  The VE2EMM Montreal III Doppler unit - running the original firmware operates at approximately 499.3 Hz instead of 500.8 Hz.  For best performance with the Montreal III running original firmware, a slight frequency shift is required (see below.)
The as-build prototype comb filter.
Figure 1:
The as-built prototype of the comb filter prior to installation.

Click on the image for a larger version.

Our design criteria are as follows:

Building a series of analog notch filters is certainly possible - but practically speaking one would have to build (and adjust) at least five (to get each of the first 5 harmonics) of them in this case.  While practical, it is hardly elegant - plus I wanted to try something else:  Using simple DSP (Digital Signal Processing) techniques.

Normally, when one thinks of  "DSP" one may also think of cost and complexity.  We are fortunate, however, that we are trying to just build a comb filter:  This filter can be implemented with very modest software and hardware requirements:  Even a PIC can do it!

The design:

I decided to use the PIC16F819.  This microcontroller has 2k of program memory, 256 bytes of RAM, a built-in 10-bit A/D converter, and a hardware-based PWM generator that may be used as a 10 bit D/A converter.
The as-build prototype comb filter, mounted inside the Doppler II enclosure.
Figure 2:
The comb filter board (in the foreground) crammed into the enclosure.

Click on the image for a larger version.

Also to be included with the comb filter is all of the necessary anti-aliasing filtering as well as a decent audio amplifier:  While mobile radios usually have an audio amplifier capable of a room-filling 1 or 2 watts, the audio amplifier in an HT is usually inadequate when pressed to do the same task.

The original (and typical) design used a rheostat to set the volume and this required that the audio amplifier to be turned up quite high if a "loud" volume were ever needed.  The rheostat was then turned down to adjust the speaker volume to the desired level.  With this arrangement, I noticed an annoying tendency for the speaker's changing load (when the rheostat was adjusted - particularly when it was turned all of the way up) to cause the audio phase (and thus the bearing) to shift slightly.  The use of an additional audio amplifier handily solves this and the other problems.

How the hardware works:

From a hardware standpoint, operation of the comb filter is straightforward:

U1A forms a 3-pole Chebychev lowpass filter with a "knee" of about 3.5 kHz.  The purpose of this filter is to remove energy at frequencies higher than this - particularly those near or above the Nyquist frequency - which is one-half of the sampling rate.  In this case the lowest sampling rate is 10 kHz (for the 8-tap implementation of Algorithm 2) meaning that those signals above 5 kHz need to be adequately attenuated.

From the output of the filter the input audio is fed into the PIC.  As seen from the schematic, a pair of 10k resistors are used to bias the input at mid-supply, or 2.5 volts.  Although this PIC has five multiplexed A/D channels, it has only one 10 bit A/D converter - and we need only the one input on Pin 17.
The LM380 vs the LM386

The LM380 audio amplifier is a big brother to the LM386 - but is capable of more output power and operation at higher voltages. 

The LM380, which is rated to operate at up to 22 volts, will easily drive an 8 ohm speaker to at least 1.5 watts when operating from 12 volts - and it's capable of over 2 watts if a 4 ohm speaker is used (although that latter case may require a bit of extra heat-sinking on the amplifier.) 

In contrast, the LM386, when operated at 12 volts, is capable of, at most, about 0.5-1 watt of audio output or so.  Furthermore, the most commonly-available versions of the LM386 (those with the -1, -2, and -3 suffix) are NOT rated for operation above 12 volts and should not be used here!  Use only the LM386-4 at 12 volts and above.

(And before anyone asks:  Yes, they still make the LM380!)

The PIC, after suitably digesting the inputted signal, outputs the processed audio on pin 8.  This pin is configured to be used as a PWM (Pulse Width Modulation) output - a sort of poor-man's D/A converter.  This converter simply uses hardware timers to adjust the duty cycle from very low values (corresponding with a low voltage) to higher duty cycles (corresponding with high voltage.)  Despite it simplicity, the PWM technique works very well and has good accuracy and linearity, being commonly used as the "1-bit D/A" found on many CD players.  A minor drawback of a PWM-type of D/A converter over a more conventional one (such as an R/2R) is that the PWM converter can produce a very strong component at the clock frequency - which, in this case, is the sampling rate.

The output of the PWM generator is lowpass filtered using U1B - a filter nearly identical to the input filter - which quite effectively removes high-frequency components.  The output of this filter is then passed to a volume control, attenuated, and put into an LM380 audio amplifier.

There is also a "Clip Indicator."  When the audio input or output goes above a certain amplitude, pin 9 will pulse high indicating the possibility of clipping.  In actual fact, the clip indicator's threshold is well below the "full-scale" A/D input/output level - about 6 db lower.  This amount of headroom allows occasional "flickering" of the CLIP LED without the peaks (which will be higher) actually going into distortion.  The output pulse is lengthened by the 0.1 uF capacitor and this pulse then drives the transistor that illuminates the LED. (Note that only the input/output levels of the PIC are monitored and that this indicator has nothing to do with whether or not the LM380 audio amplifier is clipping:  You use your ears for that.)

Pins 10, 11, 12 and 13 are inputs used to select the operational mode of the comb filter.  Internal pullups are used in the PIC and the appropriate mode is changed by grounding the appropriate pin(s) as described below.

Hand-drawn schematic of the comb filter.
Figure 3:
The schematic of the comb filter.

Click on the image for a larger version.

As seen from the picture, the comb filter was constructed on a small piece of proto board and all ICs are socketed.

Owing to the rather sensitive A/D converter (with 10 bits of resolution - one bit being equal to a voltage change of about 0.005 volts) and the presence of the audio amplifier on-board, it is relatively important that proper construction techniques be observed:

Important note:

If the PIC16F88 is used instead of the PIC16F819, the audio output is on RB0 (pin 6) rather than RB2 (pin 8.)

How the software works:

Bypass mode:

When pins 10, 11, and 12 are left floating (and are pulled high by resistors internal to the PIC) the comb filter is in the "Bypass" mode where input signals are simply passed to the output.  In this mode, all 10 A/D bits are simply sent to the 10 bit PWM converter and the sample rate is set to about 19.53 kHz.

Algorithm 1:
Filter mode
Pin 10 
Pin 12 
Pin 13 
Algorithm 1 - 88% feedback
Algorithm 1 - 75% feedback
Algorithm 1 - 94% feedback
Algorithm 1 - 97% feedback
Algorithm 2 - 8 Tap
Algorithm 2 - 4 Tap
Algorithm 2 - 2 Tap
Algorithm 2 - 1 Tap
Table 1:
This table shows the various strapping options for mode selection.  "Open" pins may also be tied to the PIC's V+ line.

In all cases pin 11 (RB5) is left open for "bypass" mode and grounded to enable the filter.

When pin 11 (RB5) is pulled low and pin 10 (RB4) is left floating (high) the comb filter is enabled and Algorithm 1 is used.  This comb filter samples at 12 kHz, uses IIR techniques and works as follows:

There are four implementations of Algorithm 1 selected by the state of pins 12 (RB6) and 13 (RB7.)  The algorithms differ from each other in terms of the amount of feedback that occurs in the IIR filter.  With the two pins open, a "default" algorithm  that feeds back about 88% of its output to its input is selected that offers good performance and fast response.

Other algorithms may be selected that use from 75% to 97% feedback and the performance of these filters varies in terms of how broad the "notches" in the comb are as well as how fast the filter can adapt to current conditions.  Naturally, the higher the feedback, the narrower the notches, but the slower the response.  This means that on a rapidly changing, fluttery signal the 97% feedback filter may "ring" noticeably on rapid signal fluctuations.  This filter may also "ping" when the squelch opens/closes.  As an aside, it is interesting to observe that this type of filter, as the amount of feedback is lowered to unity, turns into a "1-tap" FIR filter (see below) and takes on a distinctly "hollow" sounding characteristic.  (This effect is just becoming audible in the "75% feedback" mode.)

Algorithm 2:

When both pins 11 (RB5) and 10 (RB4) are grounded the comb filter is enabled using Algorithm 2.  This algorithm is a simple tapped FIR comb filter and it works as follows:

There are four implementations of this algorithm.  The "default" is an 8-tap comb filter (with a sampling rate of 10 kHz) but filters (at a sampling rate of 12 kHz) with 4, 2, and 1 tap may also be selected.
Algorithm 1
(88% feedback)
Algorithm 1
(75% feedback)
Algorithm 2
(8-tap mode)
Algorithm 2
(4, 2, and 1-tap modes)
500 (Fundamental)
1000 (2nd harmonic)
1500 (3rd harmonic)
2000 (4th harmonic)
2500 (5th harmonic)
3000 (6th harmonic)
Table 2:
This table shows the approximate amounts of attenuation of the various harmonics provided by the comb filter in its various modes.  All readings are in db relative to the strength of the indicated spectral component as measured in bypass mode.  Higher-order harmonics are also reduced, but were not measured.  As mentioned below, the 8-tap mode of algorithm 2 suffers slightly because it is 0.2 Hz high in frequency.


Audio Clips:

Here are some audio clips demonstrating the filter's effectiveness.  There is one file for each of the algorithms and in each case, the 1st 10 seconds are the original unfiltered audio with the switching tone in its fully glory.  At approximate 10 second intervals, the mode is changed as evidenced by a "click."  Each MP3 file is about 150k.
Audio Clip
0-10 sec
10-20 sec
20-30 sec
30-40 sec
40-50 sec
Algorithm 1 (IIR)
No filter (Bypass mode)
88% Feedback
94% Feedback
75% Feedback
97% Feedback
Algorithm 2 (FIR)
No filter (Bypass mode)
8-tap mode
4-tap mode
2-tap mode
"1-tap" mode

Comments on the audio clips:

Measured response of the comb filter:
Spectrum analysis plots of the frequency response of the comb filter in various modes.
Figure 4:
These are spectrum analysis graphs of the various algorithms.  These were produced using white noise on the input of the filter.

Click on the image for a larger version.

Attenuation table:

The efficacy of the comb filter in its various modes was measured and the results are shown in the table.  Note that the measured attenuation is relative to that component's strength when in the bypass mode and not to the fundamental.  In several cases (with the higher-order harmonics) there was not enough signal present to fully measure the amount of attenuation provided by the comb filter:  In these cases, one knows only that it was reduced by ">40 db" for example.

Spectrum analysis plots:

Also note the spectrum analyzer plots showing the filters bandpass.  This analysis was done using the Spectran software and a computer-generated white noise on the input of the filter.

A few comments on these plots:

Using the comb filter:

A few random bits:

This comb filter was designed to work specifically with the VE2EMM Doppler.  This unit has a tone frequency of 500.8 Hz - but this comb filter could be designed to operate at any frequency from this up to at least 1.5 kHz or so.

Please note that the notches are extremely narrow - and a fundamental frequency difference of even 1 Hz from the intended center frequency will result in significant (15 db) degradation of the notch depth at 500 Hz.  This happened to some extent in the case of the 8-tap filter where the exact frequency of that filter is 501.0 Hz:  This deviation of 0.2 Hz from its intended frequency caused a 4db reduction in the notch depth at 500 Hz and similar performance reductions at the harmonics.  When used (without modification) with the Montreal III, this comb filter is still usable, but the 1.6 Hz difference causes noticeable degradation unless this filter is "retuned" to accommodate (or modified - see below) the Montreal III's 499.22 Hz switching tone.   Note that the Doppler III running the Alternate Firmware operates at 500.8 Hz.   If you anticipate use of this comb filter with your Doppler system, consider the following:

Additional versions:

Getting more info:

The code for this comb filter has been written to work on the PIC16F819 and it is available for the PIC16F88 as well.  If you are interested in this - and especially if you have need for it to use something other than 500.8 Hz, you may send an email to the address below.

Figure 5:
Schematic of the "Mini" comb filter.
Click on the image for a readable version.
Schematic of the "Mini" comb filter

The "Mini" Comb filter:

I've "ported" some of this comb filter code over to the PIC12F683.  This PIC is an 8-pin device and has the capabilities of supporting a subset of the features of the "full sized" comb filter and is intended to be inserted into the audio line of an existing Doppler unit - as long as there is an audio amplifier (as is the case with the Doppler III.)

Because this PIC has less RAM - and also because I wanted to apply the "KISS" principle - it only has two modes that are readily available:
There are three filtering algorithms that are selectable during construction (unless you add a switch, of course...) and these are selected by pulling pin 6 ("GP1") high (through a 1k resistor - the temporary jumper JP1 shown on the schematic) while the device is being powered up or the mode is changed.  When a new mode is selected, the CLIP LED will flash a certain number of times to indicate the selected filter mode and once selected, the filter mode setting will be stored in nonvolatile memory and "remembered":
When JP1 is installed, the selected mode will change every time the power is reapplied or the mode switch is changed, so this jumper should be removed immediately after the desired mode is selected.  When the filter is "cold booted" (power applied) it will quickly blink the CLIP LED the number of times corresponding to the selected mode.  Note that a very brief power interruption may not cause the mode setting to be blinked as this processor may not immediately detect the loss of power until the filter capacitors sufficiently discharge.  Finally, a "1 blink" mode indicator is not used, as that may be too difficult to distinguish from normal, random blinking of the the CLIP LED.
Figure 6:
As-built prototype of the "mini" comb filter installed in the Montreal Doppler III.
Click on image for a larger version.

As-built prototype of the "mini" comb filter

In addition to the power, crystal, and audio in/out pins, there are only two pins remaining on this 8-pin chip:

Performance of this unit is more-or-less identical to that of the "full sized" version.  All that is needed for it to operate is a high-level source of audio (up to 3 volts or so peak-peak) that is lowpass filtered to about 3 kHz (the "anti-aliasing" filter) and a nearly identical output filter to "clean up" the output audio.

Integration into the Doppler III:

The "output" of the comb filter is connected to the "high" side of the volume control on the Doppler III, but it is recommended that a slight modification be made to the input of the Doppler III to allow the audio level being input to the Doppler III's filtering to be adjusted independently from the audio input level to the comb filter.  To do this, a 1k pot - with the wiper connected to the audio input of the unit -  is placed at the audio input to the Doppler III to adjust audio level.  The ungrounded end of R50 (the 27 ohm "loading" resistor) is lifted from the circuit board connected to the "radio" side of the added potentiometer.

The audio input to the comb filter is directly from the radio - the "hot" (radio) side of the 1k pot added in the above step rather than from the original source - which is now "level adjusted" with the newly-added potentiometer.  For adjustment, tune in a "clean" signal containing audio peaking at a full 5 kHz deviation (or slightly more) and set the volume control on the radio at about 1/3-1/2 of the way up (that is, turned up a bit, but well below distortion.)  Now, adjust the newly-added "input-level" adjustment pot on the Doppler unit to just provide a "solid" quality level of 8 on the display.

Now, adjust the "input level" control on the comb filter such that CLIP LED flashed only on occasional high-level audio peaks.  Once this is done, the "output level" control on the comb filter is adjusted to provide the desired amount of audio level drive for the volume control.

Why is all of this necessary?  In my experience, the Doppler III's audio input is too sensitive - requiring a minute amount of audio from the radio being used.  Adding the comb filter gave me the opportunity (or excuse) to add an "input level" control to allow a more "midrange" setting of the volume control to be used.  Having an "input level" control on the DF unit that is separate from that on the comb filter allows flexibility in adjustment to optimize the range of both.  Because the output level of the comb filter is quite high, the adjustment on the output allows one to set the amplifier's drive to a reasonable level.

Usage of the comb filters while mobile:

As mentioned above, being able to listen to the audio tone can allow someone with experience to determine, without looking at the display, something about the quality of the bearing:  The "timbre" of the tone and the way it changes can alert the savvy user to the likely presence of multipath and to the fact that the bearings being received at that instant may be suspect in their validity.

For this reason, both of the described units have the "bypass" mode readily available that allows one to quickly switch the filter in and out to allow an "audible examination" of the switching tone.  One would possibly have the comb filter switched in much of the time to avoid "ear fatigue" or if there was something modulated onto the monitored signal that was being masked by the switching tone.

It is also worth pointing out that even with the comb filters switched in, it is possible to determine something about the bearing quality:  As one moves about in an area with a multipathy signal, the switching tone varies wildly in amplitude and harmonic content - not to mention the likelihood that some noise and fading comes and goes.  The two different algorithms of comb filter react quite differently in these situations.

As mentioned before, Algorithm 1 tends to "ping" a bit when the tone changes rapidly, with the intensity of the "pinging" increasing on a given signal as the amount of feedback is increased.  What this means is that when using Algorithm 1, one will start to hear "pinging" of the switching tone as the multipath conditions worsen - a good indicator of signal quality that can be heard even when the comb filter is active!  As you might guess, the "75% feedback" version of Algorithm 1 is somewhat less-sensitive to this effect than the "88% feedback" version.

Algorithm 2 is more-or-less immune to the "pinging" effect, but there's another phenomenon that causes a sound similar to the "pinging" to be heard when multipathy signals are being filtered.  As the multipath comes and goes, the amplitude of the switching tone and its harmonics varies rapidly.  This effectively causes a random amplitude modulation of the spectral components of the switching tone which causes the generation of random sidebands around the actual switching tone frequencies:  Because the comb filter's notches are so narrow, some of this energy falls outside the effective bandwidth of the notch, resulting in audible artifacts.  In addition to this, as the signal quality degrades, distortion in the audio being received can cause some of the audio frequencies to mix with the switching tone (due to nonlinearities) and produce audible artifacts in that manner as well.  In short, Algorithm 2 is much-less affected by the "pinging" but multipath is still evident to the user even when the comb filter is active.

For the "full-sized" version of the comb filter, it's probably a tossup between the "8-tap" and "75% feedback" algorithms when using them mobile:  Both work very nicely.

In the case of the "mini" version of the comb filter, I find that the "75% feedback" algorithm (2 flashes) works very nicely while causing only minimal coloration of the audio.  The "3-tap" algorithm work very well, too - if you don't mind a bit of a "hollow" sound imparted on the audio.  Because you have the three algorithms to select from, you can decide for yourself!

Note:  This page (and other pages at this site) are not "official" pages of VE2EMM.  These pages are simply set up to aid those who have built or might build the described equipment.

Note:  The author does not officially endorse any vendors mentioned above.  The level and satisfaction of performance of any of the above circuits is largely based on the skill and experience of the operator.  Your mileage may vary.  Do not taunt happy fun ball.

Do you have any questions on this or other DF-related topics or are you interested in getting a comb filter?  If so, you may send email to the address below:

For information about the availability of this firmware, go here.

Do you have any questions on this or other DF-related topics?  Go here.

Return to the KA7OEI ARDF Page.

This page updated on 20080804

Since 12/2010: