Showing posts with label squelch noise. Show all posts
Showing posts with label squelch noise. Show all posts

Friday, November 20, 2015

FM squelch and subaudible tone detection on the mcHF

In a previous installment  ("Adding FM to the mcHF SDR Transceiver" - link) I described how the demodulation of FM signals was added to the mcHF SDR transceiver but being able to receive FM implies the addition of a few other features, namely that of squelch "circuitry" - of both "carrier" and "tone" types.

Determining the "squelch" status of a received signal:

One of the most obvious ways to determine the presence of a signal is to compare the signal strength against a pre-set threshold:  If the signal is above that threshold it is considered to be "present" and an audio gate is opened so that it may be heard.

This sounds like a good way to do it - except that it isn't, really, at least not with FM signals.

If you were listening to an FM signal on 10 meters that was fading in and out (as it often does!) one would have to set the threshold just above that of the background noise - or "open" (e.g. disable) it completely to prevent it from disappearing when the signal strength dove into a minimum during QSB.  If the background noise were to vary - as it can over the course of a day and with propagation - the squelch would be prone to opening and closing as well.

As it turns out, typical FM squelch circuits do not operate on signal strength as there are better methods for determining the quality of the signal being received that can take advantage of the various properties of the FM signals themselves.

Making "Triangle Noise" useful:

Mentioned in the previous entry on this topic was "Triangle Noise", so-called by the way it is often represented graphically.
Figure 1:
A graph representing the relative amplitude of noise with strong weak FM signals.  It is the upward tilt of the noise energy to which "Triangle" noise refers - the angle getting "steeper" as the signal degrades.  Also represented is a high-pass filter that removes the modulated audio, leaving only the noise to be detected.
From this diagram one can begin to see why pre-emphasizing audio along a curve similar to the "weak signal noise" line can improve weak-signal intelligibility by boosting the high-frequency audio on transmit (and doing the inverse on receive) to compensate for the noise that encroaches on weak signals.

As can be seen in Figure 1 the noise in a recovered FM signal increases as the signal get weaker - but notice something else:  The noise increases more quickly at higher frequencies of audio than it does at lower audio frequencies.  Looking at Figure 1 you might make another observation:  Because there is typically some low-pass filtering of the transmitted audio to limit its occupied bandwidth, there is no actual (useful) audio content above that frequency from the distant station, but the noise is still there.

High-pass filtering to detect (only) "squelch noise":

From the above drawing in Figure 1 it can be recognized that if we only "listen" to the high-frequency audio energy that passes through the "Squelch noise" high-pass filter all we are going to detect is the noise level, independent of the modulated audio.  If we base our signal quality on the amount of noise that we detect at these high frequencies - which are typically above the typical hearing range (usually ultrasonic, above 10 kHz) - we can see that we don't need to know anything about the signal strength at all.

This method works owing to an important property of FM demodulators:  The amount of recovered audio does not change with the signal strength as the demodulator is "interested" only in the amount of frequency change, regardless of the actual amplitude.  What does change is the amount of noise in our signal as thermal noise starts to creep in, causing uncertainty in the demodulation.  In other words, we can gauge the quality of the signal by looking only at the amount of ultrasonic noise coming from our demodulator.
Figure 2: 
An representation of an analog squelch circuit with hysteresis.  The high-pass filter removes the "program" audio modulated onto the carrier (e.g. voice) which is then amplified as necessary and then rectified/filtered to DC to derive a voltage proportional to the amount of ultrasonic noise present:  The higher the voltage, the "weaker" and noisier the signal.
The resulting voltage is then fed with a comparator that includes hysteresis to prevent it from "flapping" when it is near the squelch threshold.

An analog representation of a squelch circuit may be seen in Figure 2.  For the simplest circuit, the high-pass filter could be as simple as an R/C differentiator followed by a single-transistor amplifier, and the same sorts of analogs (pun intended!) could be applied in software.

After getting the mcHF FM demodulator to be functional I tried several different high-pass filter methods - including a very simple differentiator algorithm such as that described in the previous posting - except, of course, that the "knee" frequency was shifted far upwards.  The absolute value was then taken from the output of the high-pass filtered and smoothed and printed on the screen while the input signal, modulated with a 1 kHz audio sine wave and fed to a SINAD meter (read about SINAD here - link) while signal level was varied:  In this way I could see how the output of the noise detection circuit behaved with differing signal conditions.

In doing this testing I noted that a simple differentiator did not work as well as I'd hoped - likely due to the fact that unlike an analog circuit in which the high-frequency energy can continue to increase in intensity with frequencies well into the 10's or 100's of kHz, in the digital domain we have a "hard" limit enforced by Nyquist, stopping at 23 kHz or so on the mcHF with its 48 ksps rate.

With less high frequency spectral noise energy (overall) to work with it is necessary to amplify the output of a simple differentiator more, but this also brings up the lower frequency (audio) components, causing it to be more affected by speech and other content, requiring a better filter.  Ultimately I determined that 6-pole IIR high-pass audio filter with a 15 kHz cut-off frequency, capable of reducing "speech" energy and its second and third harmonics below 9-10 kHz by 40-60dB, worked pretty well:  In testing I also tried a similar filter with an 8 kHz cut-off, but it was more-affected by voice modulation and its immediate harmonics.

Comment:

If the FM demodulation is working properly the result will be a low-distortion, faithful representation of the original audio source with little/no energy above the low-pass filter's cut-off in the transmitter.  If the signal is distorted in some way - such as with multipath distortion, being off-frequency or with excess deviation, energy from this distortion can appear in the ultrasonic region which cannot be easily distinguished from "squelch" noise.
If this energy is high enough, the squelch can close inadvertently since the signal may be "mistaken" as being weak:  This is referred to as "squelch clamping" and is so-called as it is often seen on voice peaks of signals degraded by multipath and/or off-frequency.

Determining noise energy:

In short, the algorithm to determine the squelch energy was as follows:

loop:

   squelch_avg = (1-α) * squelch_avg + sqrt(abs(hpf_audio)) * α
   if(squelch_avg > MAX_VALUE)
      squelch_avg = MAX_VALUE

Where:
   α = "smoothing" factor
   hpf_audio = audio samples that have been previously high-pass filtered to remove speech energy
   squelch_avg = the "smoothed" squelch output

If you look at the above pseudocode example you'll notice several things:
  • The square root value of the absolute value of the high-pass noise energy is taken.  It was observed that as the signal got noisier, the noise amplitude climbed very quickly:  If we didn't "de-linearize" the squelch reading based on the noise energy - which already has a decidedly non-linear relationship to the signal level - we would find that the majority of our linear squelch adjustment was "smashed" toward one end of the range.  By taking the square root our value increases "less quickly" with noisier signals than it otherwise would.
  • The value "squelch_avg" is integrated (low-pass filtered) to "smooth" it out - not surprising since it is a measurement of noise which, by its nature, is going to vary wildly - particularly since the instantaneous signal level can be anything from zero to peak values.  What we need is a (comparatively) long-term average.
  • The "squelch_avg" value is capped at "MAX_VALUE".  If we did not do this the value of "squelch_avg" would get very high during periods of no signal (maximum noise) and take quite a while to come back down when a signal did appear, causing a rather sluggish response.  The magnitude of "MAX_VALUE" was determined empirically by observing "squelch_avg" with a rather noisy signal - the worst that would be reasonably expected to open a squelch.
Obtaining a usable basis of comparison:

The above "squelch_avg" value increases as the quieting of the received FM signal decreases which means that we must either invert this value or, if a higher "squelch" setting means that a better signal is required for opening the squelch, that same "squelch setting" variable must have its sense inverted as well.

I chose the former approach, with a few additional adjustments:
  • The "squelch_avg" value was rescaled from its original range to approximately  24 representing no-signal conditions to 3 representing a full-quieting signal with modulation with hard limits imposed on this range (e.g. it is not allowed to exceed 24 or drop below 3).
  • The above number was then "inverted" by subtracting it from 24, setting its range to 2 representing no signal to 22 for one that is full-quieting with modulation.
It is not enough to simply compare the derived "squelch_avg" number after scaling/inversion with the squelch setting, but rather a bit of hysteresis must also be employed or else the squelch is likely to "flap" about the threshold.  I chose a value of 10% of the maximum range, or a hysteresis range of +/-2 which seemed to be about right.

The final step was to make sure that if the squelch was set to zero that it was unconditionally open - this, to guarantee so that no matter what, some sort of signal could be heard without worrying about the noise threshold occasionally causing the squelch to close under certain conditions that might cause excess ultrasonic energy to be present.

The result is a squelch that seems to be reasonably fast in response to signals, weak or strong, but very slightly slower in response to weak signals.  This slight asymmetry is actually advantageous as it somewhat reduces the rate-of-change that might occur under weak-signal conditions (e.g. squelch-flapping) - particularly during "mobile flutter."  The only downside that is currently noted is that despite the "de-linearization" the squelch setting is still somewhat compressed with the highest settings being devoted to fairly "quiet" signals" and most of the range representing somewhat noisier signals - but in terms of intelligibility and usability, it "feels" pretty good.

Subaudible tone decoding:

One useful feature in an FM communications receiver is that of a subaudible tone (a.k.a. CTCSS) decoder.  For an article about this method of tone signalling, refer to the Wikipedia article here - link.

In short, this method of signalling uses a low-frequency tone, typically between 67 and 250 Hz, to indicate the presence of a signal and unless the receiver detects this tone on the received signal it is ignored.  In the commercial radio service this was typically used to allow several different users to share the same frequency but to avoid (always) having to listen to the others' conversations.  In amateur radio service it is often used as an interference mitigation technique:  The use of carrier squelch and subaudible tone greatly reduces the probability that the receiver's squelch will falsely open if no signal is present or, possibly, if the wrong signal - in the case where a listener is an an area of overlapping repeaters - is present - but this works only if there is a tone being modulated on the desired signal in the first place.

The Goertzel algorithm:

There are many ways to detect tones, but the method that I chose for the mcHF was the Goertzel algorithm.  Rather than explain exactly how this algorithm works I'll point the reader to the Wikipedia article on the subject here - link.  The use of the Goertzel algorithm has several distinct advantages:
  • Its math-intensive parameters may be calculated before-hand rather than on the fly.
  • It requires only simple addition/subtraction and one multiplication per iteration so it need only take a small amount of processor overhead.
  • Its detection bandwidth is very scalable:  The more samples that are accumulated, the narrower it is - but also slower to respond.
The Goertzel algorithm, as typically implemented, is capable of "looking" at only one frequency at a time - unlike an FFT which looks at many - but since it is relatively "cheap" in terms of processing power (e.g. the most intensive number-crunching is done before-hand) it is possible that one could implement several of them and still use fewer resources than an FFT.

The Goertzel algorithm, like an FFT, will output a number that indicates the magnitude of the signal present at/about the detection frequency, but by itself this number is useless unless one has a basis of comparison.  One approach sometimes taken is to look at the total amount of audio energy, but this is only valid if it can be reasonably assured that no other content will be present such as voice or noise, which may be generally true when detecting DTMF, but this cannot be assured when detecting a subaudible tone in normal communications!

"Differential" Goertzel detection:

I chose to use a "differential" approach in which I set up three separate Goertzel detection algorithms:  One operating at the desired frequency, another operating at 5% below the desired frequency and the third operating at 4% above the desired frequency and processed the results as follows:
  • Sum the amplitude results of the -5% Goertzel and +4% Goertzel detections.
  • Divide the results of the sum, above, by two.
  • Divide the amplitude results of the on-frequency Goertzel by the above sum.
  • The result is a ratio, independent of amplitude, that indicates the amount of on-frequency energy.  In general, a ratio higher than "1" would indicate that "on-frequency" energy was present.
By having the two additional Goertzel detectors (above and below) frequency we accomplish several things at once:
  • We obtain a "reference" amplitude that indicates how much energy there is that is not on the frequency of the desired tone as a basis of comparison.
  • By measuring the amplitude of adjacent frequencies the frequency discrimination capability of the decoder is enhanced without requiring narrower detection bandwidth and the necessarily "slower" detection response that this would imply.
In the case of the last point, above, if we were looking for a 100 Hz tone and a 103 Hz tone was present, our 100 Hz decoder would "weakly-to-medium" detect the 103 Hz tone as well but the +4% decoder (at 104 Hz) would more strongly detect it, but since its value is averaged in the numerator it would reduce the ratiometric output and prevent detection.

Setting the Goertzel bandwidth:

One of the parameters not easily determined in reading about the Goertzel algorithm is that of the detection bandwidth.  This parameter is a bit tricky to discern without using a lot of math, but here is a "thought experiment" to understand the situation when it comes to being able to detect single-frequency (tone) energy using any method.

Considering that the sample rate for the FM decoder is 48 ksps and that the lowest subaudible tone frequency that we wish to detect is 67.0 Hz, we can see that at this sample rate it would take at least 717 samples to fully represent just one cycle at 67.0 Hz.  Logic dictates that we can't just use a single cycle of 67 Hz to reliably detect the presence of such a tone so we might need, say, 20 cycles of the 67 Hz tone just to "be sure" that it was really there and not just some noise at a nearby frequency that was "near" 67 Hz.  Judging by the very round numbers, above, we can see that if we had some sort of filter we might need around 15000 samples (at 48 ksps) in order to be able to filter this 67 Hz signal with semi-reasonable fidelity.

As it turns out, the Goertzel algorithm is somewhat similar.  Using the pre-calculated values for the detection frequency, one simply does a multiply and a few adds and subtractions of each of the incoming samples:  Too few samples (fewer than 717 in our example, above) and one does not have enough information with which to work at low frequencies to determine anything at all about our target frequency of 67 Hz, but with a few more samples one can start to detect on-frequency energy with greater resolution.  If you let the algorithm run for too many samples it will not only take much longer to obtain a reading, but the effective "detection bandwidth" becomes increasingly narrow.  The trick is, therefore, to let the Goertzel algorithm operate for just enough samples to get the desired resolution, but not so many that it will take too long to obtain a result!  In experimentation I determined that approximately 12500 samples were required to provide a tradeoff between adequately-narrow frequency resolution and reasonable response time.

This is part of the reason for the "differential" Goertzel energy detection in which we detect energy at, above and below the desired frequency:  This allows us to use a somewhat "sloppier" - but faster - tone detection algorithm while, at the same time, getting good frequency resolution and, most importantly, the needed amplitude reference to be able to get a useful ratiometric value that is independent of amplitude.

Debouncing the output:

While an output of greater than unity from our differential Goertzel detection generally indicates on-frequency energy, one must use a significantly higher value than that to reduce the probability of false detection.  At this point one can sort of treat the output of the tone detector as a sort of noisy pushbutton switch an apply a simple debouncing algorithm:

loop:

   if(goertzel_ratio >= threshold)   {
      debounce++
      if(debounce > debounce_maximum)
         debounce = debounce_maximum
   }
   else   {
      if(debounce > 0)
         debounce--
   }
   if(debounce >= detect_threshold)
      tone_detect = 1
   else
      tone_detect = 0

where:

   "goertzel_ratio" is the value "f/((a+b)/2))" described above where:
      f = the on-frequency Goertzel detection amplitude value
      a = the above-frequency Goertzel detection amplitude value
      b = the below-frequency Goertzel detection amplitude value
   "threshold" is the ratio value above which it is considered that tone detection is likely.  I found 1.75 to be a nice, "safe" number that reliably indicated on-frequency energy, even in the presence of significant noise.
   "detect_threshold" = the number of "debounce" hits that it will take to consider a tone to be valid.  I found 2 to be a reasonable number.
   "debounce_maximum" is the highest value that the debounce count should attain:  Too high and the it will take a long time to detect the loss of tone!  I used 5 for this which causes a slight amount of effective hysteresis and a faster "attack" than "decay" (e.g. loss of tone).

With the above algorithm - called approximately once every 12500 samples (e.g. just under 4 times per second with a 48ksps sample rate) - the detection is adequately fast and quite reliable, even with noisy signals.

Putting it all together:

Figure 3:
An FM signal with a subaudible tone being detected, indicated by
the "FM" indicator in red.
If tone decoding is not enabled, the Goertzel algorithms are not called at all (to save processor overhead) and the variable "tone_detect" is set to 1 all of the time.  For gating the audio a logical "AND" is used requiring that both the tone detect and squelch be true - unless the squelch setting is 0, in which case the audio is always enabled.

Finally, if the squelch is closed (audio is muted) the audio from the FM demodulator is "zeroed".


* * *

In a future posting I'll describe how the the modulation part of this feature was accomplished on the mcHF along with the pre-emphasis of audio, filtering and the generation of burst and subaudible tones.


[End]

This page stolen from "ka7oei.blogspot.com".

Thursday, January 17, 2013

Two repeaters, one frequency (part 4) - Voting receivers

This is an ongoing series of posts:  For the most recent, previous post in this series, see Part Three (link).

In the other three parts of this string of posts I described the two repeaters, how their operation is greater than the sum of their parts and how the two transmitters can share the same frequency without causing mutual interference.

This time, it's the "Voting Receivers".

In order to achieve reasonable parity with a multiple-transmitter system, we also need to duplicate the effect on receive which means that we have to take the users' signals from both sites and then decide how to use them on transmit and for this, we have a "Voter" system.

As its name implies, the voter "looks" at all of the signals that it is getting from the various receivers and somehow decides which one is best - and that one is sent to all of the transmitters in the system.  The result of this is that during a user's transmission, it's possible that the receiver being used might change several times as the signal fades from one receiver and is picked up by another - particularly in areas where coverage overlaps!

Now, then, does one "vote" on a signal?

First, let's talk a bit about what happens to an FM signal as it gets weaker.

Unlike AM, in which the audio can get weaker as the signal gets closer to the noise, the audio from an FM signal stays constant no matter how weak or strong the signal might be - although something interesting happens when it gets to be too weak:  It doesn't get quieter, it gets noisier!

What is happening is that as the signal gets weaker, the detector - which looks for the "frequency wobble" of an FM signal - starts to have trouble distinguishing between the desired signal and the background noise, so that noise starts to creep into the audio.  There is a threshold at which a slight decrease in signal starts to result in a very marked increase in noise and for a number of reasons, this is often referred to as the "limiting threshold."
Figure 1:
The front panel of the voting controller showing the indicators
of the input channel status (green) as well as various
status/health indicators of the unit itself (red.)  A DE-9
jack provides access to the RS-485 bus for configuration
and status monitoring.
Click on the image for a larger version.

What this means is that if you have two copies of the same signal from two different receivers, you can tell which one is the weaker signal NOT by how loud or quiet its audio might be, but looking at how much extra noise it contains:  If the receivers are otherwise identical, of the two versions of the same signal, the noisier one will always be the weaker one!

How, then, does one compare noise?

There are two common techniques:
  • Compare "quiet-ness".  In the pauses and spaces between words, there will be brief pauses of silence - or, at the very least, portions that aren't as loud as the peaks of the audio.  The weaker signal will have more noise, so it won't be as "quiet" during these pauses as the strong signal.  The receiver that has the highest "minimum" audio level will be the one that is weaker.
  • Compare total loudness.  As it turns out, as a signal gets weaker, the noise gets added to the audio which means that if you look at the total amplitude of the two signals, the one that's louder overall (that is, there's the audio plus noise) will be the one that is weaker.
Comment: 
One can also look at the level of ultrasonic noise from the discriminator, but this is not easily done on sites connected only via a voice-bandwidth audio link and may be discussed in a later blog entry.
For a number of reasons, we chose the second method for our voting system.

It makes the job a bit easier if one looks only at the higher-frequency audio - say, that above about 2 kHz - as this has less speech energy in it overall, yet the noise will increase at the high frequencies of the de-emphasized audio just as readily as it will at the lower frequencies.  By "looking" only at these higher frequencies it becomes a bit easier to ignore the voice energy when trying to make comparisons of quality between multiple channels of the same audio.

There are some complications, however:

As you can imagine, no matter what method of voting you pick, it's important that all of the audio sources are as identical to each other as possible in terms of amplitude (loudness) and frequency response.  Consider the following example.
  • One receiver is louder than the other due to a misadjustment.  The louder receiver - even if it has a perfectly good signal - will look "worse" than a quieter one since more total audio energy will be detected from it.  In other words, compared to the the other, quieter receiver, the loud one will be considered noisier.  Because of this, the voter will "prefer" the quieter signal, even if it is a bit noisier.
  • One receiver has better "highs" than the other.  Since the noise from a weak signal will readily appear in the "highs", if two equally-noisy signals appear at once, the receiver with the stronger "highs" will be considered the worse one and the voter will prefer the other signal.  Since our system looks at the audio above 2 kHz, a receiver with extra "highs" makes things even worse!
When we first installed the voter, we had all of these problems, but we expected that we'd have to tweak a few things, but several things caught us off-guard:

  • The first one was that the "local" receiver was connected to the voter via copper wire, while the other receiver was connected via a UHF radio link.  The local receiver had better "highs" in its audio than the receiver on the UHF radio link and the "highs" in the voices of the users on the local receiver caused the voter to "think" that the signal was worse than it really was and it would jump back-and-forth while people were talking.
  • Due to a design flaw in the local receiver it was discovered that it would start to clip if the received signal's deviation was greater than about +/-3 kHz.  Interestingly, this flaw had gone unnoticed in the 30 years that this receiver had been used because no-one had looked for it, and it really didn't sound that bad since the transmitter removed the speech harmonics, anyway.  Coupled to this was the fact that pre-emphasized audio - common on our VHF and UHF bands - boosts the highs as compared to the lows, further masking the clipping.  With all of that distortion, the voter was "seeing" plenty of audio energy above 2 kHz and voting "away" from it in favor of the receiver connected via the UHF radio link.
The first problem required that we put a low-pass filter on the audio from the local receiver to make it "look" like the audio coming across the UHF link and for this, a filter was installed that scraped off the audio above about 3 kHz.

The second problem - the receiver distorting - was a bit trickier.  Once on the workbench, I noticed that the clipping was asymmetrical and I traced it to an emitter-follower audio stage coupling from the discriminator chip with insufficient headroom, trying to go "below" ground.  Poking around with an oscilloscope, I noticed that the input signal to this emitter-follower stage was "clean", so I modified it by turning it "upside-down" and using a PNP with its collector connected to the ground side instead of an NPN with its collector connected to the V+.  Doing this moved its clipping threshold "upwards", toward the V+ supply instead of ground.

That problem solved, I then noticed that I still couldn't go above about +/- 3 kHz deviation without significant distortion - but this time I traced it down to the 10.7 MHz IF crystal filters.  As it turned, one or more of these had gone bad and the filtering was no longer "flat" across the required 15 kHz IF bandwidth of this single-conversion receiver.

Fortunately - because of another project - I had on hand some extra 10.7 MHz crystal filters and I was able to replace those in the receiver and nicely flatten out the response.  The ultimate result was that the receiver could accept about +/-7 kHz of deviation modulated with a 1 kHz tone before it started to distort badly.  The measured IF bandwidth was now about 16 kHz at the -3dB points and much more than 20dB down at 20 kHz.

Re-installing the receiver, the audio levels from the remote receiver (via the UHF link) and the local receiver were very carefully matched and the voter behaved a bit better - but it was still favoring the "remote" receiver slightly.  Fortunately, when I designed the voter I included a number of software parameters that could be tweaked and I was able to "bias" the voter slightly toward the local receiver.

The voting controller:

Figure 2:
The main voter board.  As you can see, it is all hand-wired on
glass-epoxy prototyping board.
Click on the image for a larger version.
The voter itself is homebrew and uses a PIC18F4620 processor at its heart.  Capable of accepting up to 8 receivers, it has two voting channels:  The "current" receiver - the one that is being selected for on-air, and the "other" channel that is being compared to the on-air receiver.


If there is just one receiver active, the choice is simple:  Select it - no voting required!

If there are two receivers active they are compared against each other, the "better"one being put on-air and the worse one on the "other" channel:  If, at any time the signal on the "other" receiver gets to be better of quality than the one that is on-air, they flip positions.

If more than two receiver go active at the same instant it will grab the lowest-number receiver first and then compare, one-at-a-time, the quality of the other receivers against it.  If it finds that one of these other receivers has a better signal, it will put that receiver on the air and the process repeats itself with the processor constantly seeing if any of the other receivers have a better signal than the one that's currently on-air.

In the audio chain of the voter is a digitally-programmable potentiometer that is used to set the gain of each selected receiver (on both the main, on-air channel and the "other" channel) to the levels that allow the audio of each receiver to be perfectly matched.  There is also a "phase selector" switch that allows either a 0 or 180 degree phase change of the receiver to account for the fact that there may be an audio inversion somewhere earlier in the audio chain.

Both the selected "on-air" and the "other" receiver are passed through a 2 kHz high-pass filter which then goes to a rectifier circuit, the result being that a DC voltage is produced that is proportional to the amount of audio energy.  While some of the energy above 2 kHz is going to be voice energy, some of it will also be the added noise on a weaker signal, so that "noisy" channel (e.g. the one with the poorer signal) will have a higher voltage than the other.  The two voltages are digitized by the computer and used to make the decision as to which receiver has the better signal.

Cleaning up the squelch noise:

One issue with using a link receiver for connecting receivers for voting is the fact that if there's a "choppy" signal, the remote receiver's squelch will constantly open and close - but how do you convey that fact to the voter?

One way is to simply turn the UHF transmitter on and off and follow receiver squelch, but this gets a bit messy, particularly since there will be a burst of noise every time that happens (e.g. the "ker" in "kerchunk"!)

To avoid this, the instant the squelch of the remote receiver closes, a 3.2 kHz "voting tone" is sent down the link.  At the voter, this tone is detected and treated in the same way as dropping of the link transmitter and this causes a "squelch" indication from that remote receiver to show that the input signal has gone away.  After the tone is detected, the link transmitter can shut off and that extra "ker" (e.g. burst of noise) won't ever be heard by the user!

This tone also has another purpose:  Since it is a very strong 3.2 kHz tone it will be intercepted by the voter's noise detector as a full-scale indication of "bad signal noise" and the voter will instantly "see" it as a signal of inferior quality and jump away from it in favor of another signal, if available.

Other circuits:

In order to meet FCC rules, the UHF link transmitter must occasionally ID and this is done using a 2.44 kHz tone frequency, a frequency above most of the audio content.  2.44 kHz notch filters are used in front of the tone detector (but NOT in the audio path to the audio output of the voter) in each of the voter's channels (e.g. the one that is on-air, and the "other" one) to remove the link IDer and keep it from affecting the voting as well as a notch filter to remove the 3.2 kHz "voting tone" that is sent on the UHF link.  If the link IDs with no-one talking, the 3.2 kHz voting tone will already be on, keeping an "open squelch" indication from being passed to the voter and prevent that ID from even keying up the repeater.  If an ID happens to occur while someone is talking through the voter, there's no harm as the pitch of the ID is fairly high and most people don't ever notice it!
Figure 3:
Inside the voter's die-cast metal box with the circuit board removed.
All input/output signal lines go through feedthrough capacitors
and ferrites to remove any RF energy that might be coupled
onto them - an absolute necessity since the repeater site
has extremely high levels of RF energy!
Click on the image for a larger version.


Another circuit an 8-channel multiplexed input that is very rapidly scanned to determine which COS (squelch) output lines from the receivers are active, this being done so that the voter knows which receivers are actually active!  The voter also has the capability of producing "courtesy beep" tones which are used to identify the various remote receivers by pitch allowing users to determine into which a particular user is being received.  Since most of our users come across the main receiver, this one doesn't have a beep!

The voter - like the disciplined oscillator - has an RS-485 bus on it which allows it to be configured via a serial port as well as be queried and configured remotely.  As it turns out, one can kludge an RS-485 interface to talk to most RS-232 ports by using just one of the receive/transmit lines and this is brought out on a DE-9 front-panel connector.  In this way, one can look at the configuration of the voter - even make adjustments - while on-site as well as talk to any other device that is also hanging on the RS-485 bus!

Finally, the voter has 16 front-panel LEDs, 8 of which indicate which receiver is (or recently was) active while the other 8 LED indicate the various states of the hardware for monitoring and diagnostic purposes.


Final comments:

This voter was installed in October of 2009 and has been in continuous service ever since.  In the first month, the code was tweaked slightly to allow more-detailed tweaking of the noise detection algorithm to minimize the likelihood of "false voting" and to permit one receiver to be favored slightly more than the other.  The only "major" change was to add a minimum "dwell" time to the voting - that is, once a particular receiver was selected, it had to stay there for a minimum amount of time before another receiver was allowed to be selected unless, of course, that receiver dropped out!

The only hardware tweak was increasing the gain of the noise detectors to allow the voter to better-determine the relative quality of signals that were already nearly "full-quieting":  Before doing this the voter couldn't tell the difference between signals that were better than about 18dB quieting, but now this has been extended to about 25-27dB quieting - a noise level below that which most users even notice!

[End]

This page stolen from ka7oei.blogspot.com