DSPRelated.com
Forums

Squelch Algorithm

Started by b2508 October 22, 2015
Hi all,

I am completely unfamiliar with squelch algorithm and I would be grateful
if you could help. 

I am suppose to do it in FPGA on IQ data. Is the right way calculating
average power over some number of data samples and compare it with
threshold? If not average power then what is the value that's compared to
threshold?

Thank you in advance.


---------------------------------------
Posted through http://www.DSPRelated.com
"b2508" <108118@DSPRelated> writes:

> Hi all, > > I am completely unfamiliar with squelch algorithm and I would be grateful > if you could help. > > I am suppose to do it in FPGA on IQ data. Is the right way calculating > average power over some number of data samples and compare it with > threshold?
First of all, "right" is somewhat subjective in this context. It is true that what you propose will work correctly. However, it is probably not the most computationally efficient way. Consider this: Pavg(N) = (1 / N) * \sum_{n = 0}^{n < N} (K * (I[n]^2 + Q[n]^2)) = (K^2 / N) \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) Now if in the end you are simply going to compare Pavg[N] to some threshold rho, e.g., if (Pavg(N) > rho) { do something; } else { do something else; } then note that Pavg(N) > rho ==> (K^2 / N) \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho ==> \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho * (N / K^2) So you can save at least one multiply by simply comparing to eta = rho * (N / K^2) (which is computed only once at design time) instead.
> If not average power then what is the value that's compared to > threshold?
I think so. The choice of N should be carefully made. You should also take account of any AGC in the signal chain if you want to use this approach or else you may unsquelch on noise alone. If your input signal has an expected spectral shape and the noise is largely white, you could combat the AGC problem somewhat by filtering the input before computing the power and doing the threshold -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Randy Yates <yates@digitalsignallabs.com> writes:

> "b2508" <108118@DSPRelated> writes: > >> Hi all, >> >> I am completely unfamiliar with squelch algorithm and I would be grateful >> if you could help. >> >> I am suppose to do it in FPGA on IQ data. Is the right way calculating >> average power over some number of data samples and compare it with >> threshold? > > First of all, "right" is somewhat subjective in this context. > > It is true that what you propose will work correctly. However, > it is probably not the most computationally efficient way. > > Consider this: > > Pavg(N) = (1 / N) * \sum_{n = 0}^{n < N} (K * (I[n]^2 + Q[n]^2)) > > = (K^2 / N) \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > > Now if in the end you are simply going to compare Pavg[N] to some > threshold rho, e.g., > > if (Pavg(N) > rho) > { > do something; > } > else > { > do something else; > } > > then note that > > Pavg(N) > rho ==> > (K^2 / N) \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho ==> > \sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho * (N / K^2) > > So you can save at least one multiply by simply comparing to eta = rho * (N / K^2) > (which is computed only once at design time) instead.
PS: I forgot the square root in this analysis but hopefully you still see the point. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
>Randy Yates <yates@digitalsignallabs.com> writes: > >> "b2508" <108118@DSPRelated> writes: >> >>> Hi all, >>> >>> I am completely unfamiliar with squelch algorithm and I would be >grateful >>> if you could help. >>> >>> I am suppose to do it in FPGA on IQ data. Is the right way
calculating
>>> average power over some number of data samples and compare it with >>> threshold? >> >> First of all, "right" is somewhat subjective in this context. >> >> It is true that what you propose will work correctly. However, >> it is probably not the most computationally efficient way. >> >> Consider this: >> >> Pavg(N) = (1 / N) * sum_{n = 0}^{n < N} (K * (I[n]^2 + Q[n]^2)) >> >> = (K^2 / N) sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) >> >> Now if in the end you are simply going to compare Pavg[N] to some >> threshold rho, e.g., >> >> if (Pavg(N) > rho) >> { >> do something; >> } >> else >> { >> do something else; >> } >> >> then note that >> >> Pavg(N) > rho ==> >> (K^2 / N) sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho ==> >> sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho * (N / K^2) >> >> So you can save at least one multiply by simply comparing to eta = rho
*
>(N / K^2) >> (which is computed only once at design time) instead. > >PS: I forgot the square root in this analysis but hopefully you still
see
>the point. >-- >Randy Yates >Digital Signal Labs >http://www.digitalsignallabs.com
Why square root? Isn't this just average value and not root mean square? In my opinion i[n]^2+q[n]^2 is not squared power, but just power of sample or squared amplitude/voltage. --------------------------------------- Posted through http://www.DSPRelated.com
"b2508" <108118@DSPRelated> writes:

>>Randy Yates <yates@digitalsignallabs.com> writes: >> >>> "b2508" <108118@DSPRelated> writes: >>> >>>> Hi all, >>>> >>>> I am completely unfamiliar with squelch algorithm and I would be >>grateful >>>> if you could help. >>>> >>>> I am suppose to do it in FPGA on IQ data. Is the right way > calculating >>>> average power over some number of data samples and compare it with >>>> threshold? >>> >>> First of all, "right" is somewhat subjective in this context. >>> >>> It is true that what you propose will work correctly. However, >>> it is probably not the most computationally efficient way. >>> >>> Consider this: >>> >>> Pavg(N) = (1 / N) * sum_{n = 0}^{n < N} (K * (I[n]^2 + Q[n]^2)) >>> >>> = (K^2 / N) sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) >>> >>> Now if in the end you are simply going to compare Pavg[N] to some >>> threshold rho, e.g., >>> >>> if (Pavg(N) > rho) >>> { >>> do something; >>> } >>> else >>> { >>> do something else; >>> } >>> >>> then note that >>> >>> Pavg(N) > rho ==> >>> (K^2 / N) sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho ==> >>> sum_{n = 0}^{n < N} (I[n]^2 + Q[n]^2) > rho * (N / K^2) >>> >>> So you can save at least one multiply by simply comparing to eta = rho > * >>(N / K^2) >>> (which is computed only once at design time) instead. >> >>PS: I forgot the square root in this analysis but hopefully you still > see >>the point. >>-- >>Randy Yates >>Digital Signal Labs >>http://www.digitalsignallabs.com > > Why square root? Isn't this just average value and not root mean > square?
It should be Pavg(n,N) = Vrms(n,N)^2 / R, so yes there is no need to take the square root and then square it again. I also forgot the R, but that can be put into the threshold as well. I should have put this on paper instead of squirting it into a usenet message. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Thu, 22 Oct 2015 03:21:43 -0500, b2508 wrote:

> Hi all, > > I am completely unfamiliar with squelch algorithm and I would be > grateful if you could help. > > I am suppose to do it in FPGA on IQ data. Is the right way calculating > average power over some number of data samples and compare it with > threshold? If not average power then what is the value that's compared > to threshold?
What are you squelching? One of the best 2-meter repeaters in the western suburbs of Boston back when I lived in the area (ca. 1986) took the signal out of the discriminator, then ran it into parallel high- and low-pass filters. When lots of output was present on the high-pass filter the squelch was activated. It worked great, but depended on the characteristics of voice-band FM and noise in the preceding IF strip for its performance. Somehow I doubt that the technique is applicable to whatever you're doing. Context is everything. -- www.wescottdesign.com
On 24.10.15 10:01, Tim Wescott wrote:
> On Thu, 22 Oct 2015 03:21:43 -0500, b2508 wrote: > >> Hi all, >> >> I am completely unfamiliar with squelch algorithm and I would be >> grateful if you could help. >> >> I am suppose to do it in FPGA on IQ data. Is the right way calculating >> average power over some number of data samples and compare it with >> threshold? If not average power then what is the value that's compared >> to threshold? > > What are you squelching? One of the best 2-meter repeaters in the > western suburbs of Boston back when I lived in the area (ca. 1986) took > the signal out of the discriminator, then ran it into parallel high- and > low-pass filters. When lots of output was present on the high-pass > filter the squelch was activated. > > It worked great, but depended on the characteristics of voice-band FM and > noise in the preceding IF strip for its performance. Somehow I doubt > that the technique is applicable to whatever you're doing. > > Context is everything.
FM much easier to squelch than the modulations having an AM component, due to the steep S/N change when the signal rises out of the background. I suspect that the OP is trying to invent a squelch for SSB, which is at least an order of magnitude more difficult. -- -Tauno Voipio
On Sat, 24 Oct 2015 10:58:46 +0300, Tauno Voipio wrote:

> On 24.10.15 10:01, Tim Wescott wrote: >> On Thu, 22 Oct 2015 03:21:43 -0500, b2508 wrote: >> >>> Hi all, >>> >>> I am completely unfamiliar with squelch algorithm and I would be >>> grateful if you could help. >>> >>> I am suppose to do it in FPGA on IQ data. Is the right way calculating >>> average power over some number of data samples and compare it with >>> threshold? If not average power then what is the value that's compared >>> to threshold? >> >> What are you squelching? One of the best 2-meter repeaters in the >> western suburbs of Boston back when I lived in the area (ca. 1986) took >> the signal out of the discriminator, then ran it into parallel high- >> and low-pass filters. When lots of output was present on the high-pass >> filter the squelch was activated. >> >> It worked great, but depended on the characteristics of voice-band FM >> and noise in the preceding IF strip for its performance. Somehow I >> doubt that the technique is applicable to whatever you're doing. >> >> Context is everything. > > > FM much easier to squelch than the modulations having an AM component, > due to the steep S/N change when the signal rises out of the background. > > I suspect that the OP is trying to invent a squelch for SSB, which is at > least an order of magnitude more difficult.
I've seen it done, but it's basically just a threshold on the AGC line, and you end up twiddling with it endlessly unless you're working someone very local. -- www.wescottdesign.com
On 25.10.15 03:44, Tim Wescott wrote:
> On Sat, 24 Oct 2015 10:58:46 +0300, Tauno Voipio wrote: > >> On 24.10.15 10:01, Tim Wescott wrote: >>> On Thu, 22 Oct 2015 03:21:43 -0500, b2508 wrote: >>> >>>> Hi all, >>>> >>>> I am completely unfamiliar with squelch algorithm and I would be >>>> grateful if you could help. >>>> >>>> I am suppose to do it in FPGA on IQ data. Is the right way calculating >>>> average power over some number of data samples and compare it with >>>> threshold? If not average power then what is the value that's compared >>>> to threshold? >>> >>> What are you squelching? One of the best 2-meter repeaters in the >>> western suburbs of Boston back when I lived in the area (ca. 1986) took >>> the signal out of the discriminator, then ran it into parallel high- >>> and low-pass filters. When lots of output was present on the high-pass >>> filter the squelch was activated. >>> >>> It worked great, but depended on the characteristics of voice-band FM >>> and noise in the preceding IF strip for its performance. Somehow I >>> doubt that the technique is applicable to whatever you're doing. >>> >>> Context is everything. >> >> >> FM much easier to squelch than the modulations having an AM component, >> due to the steep S/N change when the signal rises out of the background. >> >> I suspect that the OP is trying to invent a squelch for SSB, which is at >> least an order of magnitude more difficult. > > I've seen it done, but it's basically just a threshold on the AGC line, > and you end up twiddling with it endlessly unless you're working someone > very local.
There was one in the Trio 599 receiver, but it was not a great success. -- -TV (OH2UG)
On Sat, 24 Oct 2015 10:58:46 +0300, Tauno Voipio wrote:

> FM much easier to squelch than the modulations having an AM component, > due to the steep S/N change when the signal rises out of the background.
If the signal has an AM component then it is even more necessary to use hysteresis and a fast attack/slow decay filter. And using hysteresis implies a log architecture of some sort. If you do all this, it is not too difficult to have an effective squelch for signals with A.M. ("Effective" being somewhere between "might help" and "better than nothing".) Steve