AGC testing in SDRs and analog receivers.

110 views
Skip to first unread message

Leif Asbrink

unread,
Sep 8, 2011, 8:43:18 PM9/8/11
to lin...@googlegroups.com, perse...@yahoogroups.com, sdr-ra...@yahoogroups.com, SDR...@yahoogroups.com, soft_...@yahoogroups.com
Hi All,

A well functioning AGC is not a trivial thing. With digital
technology we should be able to do much better compared to
what was possible in analog receivers. Practical experience
may point in a different direction however...

Today I have uploaded an Internet page with AGC testing
for a large number receivers. SDR softwares, SDR hardwares
and oldfashioned analog radios.

The test is performed by sending the same signal into all the
radios. The signal is a wideband .wav file. It can be used
directly by SDR softwares and it can be sent to a SDR transmitter
to produce an RF signal that can be sent into analog as well as
SDR hardwares.

If you are interested, check the loudspeaker outputs from
different receivers. They differ dramatically....
http://www.sm5bsz.com/lir/agctest/agctest.htm

The test is for AGC and dynamic range. A receiver may fail
because of poor selectivity (IC706MKIIG) or high phase
noise (FT1000) or poor linearity (FT221R) or bad AGC.

The new page has two purposes.

1) To show that modern SDRs generally are VERY good at
fighting close range interference.

2) To encourage SDR developers to optimize the AGC algorithms.
To that end this link might be useful:
http://www.sm5bsz.com/lir/agc/agc.htm

73

Leif / SM5BSZ

VK2KU

unread,
Sep 9, 2011, 9:58:01 PM9/9/11
to Linrad
Leif,

MOST interesting.
Note that the file agctest-softrock.mp3 produces a 404 Not Found
error.

Best wishes,

Guy VK2KU

On Sep 9, 10:43 am, Leif Asbrink <l...@sm5bsz.com> wrote:
> Hi All,
>
> A well functioning AGC is not a trivial thing. With digital
> technology we should be able to do much better compared to
> what was possible in analog receivers. Practical experience
> may point in a different direction however...
>
> Today I have uploaded an Internet page with AGC testing
> for a large number receivers. SDR softwares, SDR hardwares
> and oldfashioned analog radios.
>
> The test is performed by sending the same signal into all the
> radios. The signal is a wideband .wav file. It can be used
> directly by SDR softwares and it can be sent to a SDR transmitter
> to produce an RF signal that can be sent into analog as well as
> SDR hardwares.
>
> If you are interested, check the loudspeaker outputs from
> different receivers. They differ dramatically....http://www.sm5bsz.com/lir/agctest/agctest.htm

Earl Shaffer

unread,
Sep 9, 2011, 11:31:55 PM9/9/11
to lin...@googlegroups.com
Hi Leif.
 
In a world where a good noise blanker is not present, I can see an advantage to AGC that allows a
signal with a high peak to average ratio to saturate allowing a weak signal to be heard. It seems to
me that if such a noise source existed, it would be an easy thing to use a noise blanker to eliminate
it.  A real signal might exist like this with precipitation static, a very strong local oscillator sweeping
in frequency (scanner?) or radar. Have you tried your noise blanker on this test signal instead of
the RF limiting AGC? The tradeoffs with the RF limiting AGC would be the same as those for a noise blanker.
A narrow bandwidth RX would not suffer IMD from a neighboring signal, but would be stretched in time.
A wide bandwidth RX would not suffer so much from pulse stretching, but can suffer from IMD with
neighboring signals inside that bandwidth.
 
Another good test would be Softrock with Linrad and RF limiting AGC.
 
In any case, I think your RF limiting AGC is a good addition to your tools for an optimal DSP receiver.
It is easy to hear the differences between your recordings and that difference is surprising.
It would seem that a radio such as the Icom 706 series might not only suffer from the expected pulse stretching
but also suffers IMD in the passband which would reduce the effectiveness of an audio limiter or audio based
noise blanker.
 
I always get compliments when visitors hear Linrad here.
 
73, Jim Shaffer, WB9UWA.
--
Earl Shaffer,  WB9UWA
 
My EME array photos
Detailed array photos
Facebook

Leif Asbrink

unread,
Sep 10, 2011, 6:16:17 AM9/10/11
to lin...@googlegroups.com
Hi Guy,

> Note that the file agctest-softrock.mp3 produces a 404 Not Found
> error.

Corrected now.

73

Leif / SM5BSZ

Leif Asbrink

unread,
Sep 10, 2011, 8:09:12 AM9/10/11
to lin...@googlegroups.com
Hello Jim,


> In a world where a good noise blanker is not present, I
> can see an advantage to AGC that allows a
> signal with a high peak to average ratio to saturate allowing a weak signal
> to be heard. It seems to
> me that if such a noise source existed, it would be an easy thing to use a
> noise blanker to eliminate it.
No, it is not. I suggest you download the test file and
try the Winrad noise blanker.

> A real signal might exist like this with precipitation static, a very
> strong local oscillator sweeping
> in frequency (scanner?) or radar. Have you tried your noise blanker on this
> test signal

Yes. Of course. It does not work well enough. The test file
is a realistic simulation of difficult circumstances on low
bands with strong signals and cow fences.

> instead of the RF limiting AGC?

The AGC is not RF limiting.

> The tradeoffs with the RF limiting AGC would be the
> same as those for a noise blanker.

I do not know what you mean by "RF limiting AGC"
The AGC is a function that changes the gain of the baseband
signal after it has passed through all filters.

> A narrow bandwidth RX would not suffer IMD from a neighboring signal, but
> would be stretched in time.
> A wide bandwidth RX would not suffer so much from pulse stretching, but can
> suffer from IMD with
> neighboring signals inside that bandwidth.
>
> Another good test would be Softrock with Linrad and RF limiting AGC.

Softrock is surprisingly good under the conditions simulated
with the test file. Very much better than FT1000 for example


> In any case, I think your RF limiting AGC is a good addition to your tools
> for an optimal DSP receiver.
> It is easy to hear the differences between your recordings and that
> difference is surprising.
> It would seem that a radio such as the Icom 706 series might
> not only suffer
> from the expected pulse stretching
> but also suffers IMD in the passband which would reduce the
> effectiveness of
> an audio limiter or audio based noise blanker.

I think one can buy better filters to insert into the IC706
and after doing that it might become useful. I am not
so sure however, the sideband noise might be to high
so reciprocal mixing would drown the weak signal in noise.

> I always get compliments when visitors hear Linrad here.

:-)

73

Leif / SM5BSZ

Earl Shaffer

unread,
Sep 10, 2011, 10:05:18 AM9/10/11
to lin...@googlegroups.com
Hi Leif.
 
I call it an RF limiting AGC, because from your description of it, that is what it seems to be.
Too often AGC is derived from the peak signal values resulting in an inaudible signal in
your test situation. In that case, none of the signal ever clips or limits. In the case of your
AGC, that AGC responds to average signal level which can result in narrow but strong noise
peaks going into clipping or limiting. Thus the name RF limiting AGC seems a proper name.
I suspect lightening static can result in a similar situation with the test receivers responding
similarly. There are significant differences between radios in your test results. Not sure I would
want to try your test signal with Winrad. I would not expect that to have a good noise blanker.
Perhaps there is room for further development with your current noise blanker even though it
seems to be the best one. What is your opinion of sampling the noise blanker channel outside
of the band in use? It is done in some 30 - 50 Mhz receivers.
 I need to improve RF filtering ahead of my 160 meter SDR. There is
none now and I think IMD renders my test file suspect for noise blanker testing. When observing
the image frequency, the strong on frequency signals create some IMD. Currently I am building
a 2 meter EME array for a nearby contest station.
 
73, Jim Shaffer, WB9UWA.

Leif Asbrink

unread,
Sep 10, 2011, 3:20:51 PM9/10/11
to lin...@googlegroups.com
Hi Jim,


> I call it an RF limiting AGC, because from your
> description of it, that is what it seems to be.
Well, RF with frequency=zero ;-)

> Too often AGC is derived from the peak signal values resulting in an
> inaudible signal in your test situation.

Yes. This is the very point I want to make:-)

> In that case, none of the signal ever clips or limits.

Yes.

> In the case of your
> AGC, that AGC responds to average signal level which can
> result in narrow but strong noise peaks going into
> clipping or limiting. Thus the name RF limiting AGC seems a
> proper name.

Oooh! Limiting is done in the baseband I and Q. The
phase between I and Q is preserved while the sum of the
squares is limited. The clipping corresponds to
RF clipping, but not quite because the overtones that
are generated will alias into the passband in case
the user has selected a low sampling rate for the
baseband.

> I suspect lightening static can result in a similar situation with the test
> receivers responding similarly.

Yes.

> There are significant differences between radios in your test
> results. Not sure I would
> want to try your test signal with Winrad. I would not expect that to have a
> good noise blanker.

The test signal is designed to make noise blankers not
work. It is a test for AGC problems - and dynamic range.
Winrad does not work well, but that has nothing to do
with the Winrad blanker.

> Perhaps there is room for further development with your current noise
> blanker even though it seems to be the best one.

Absolutely. It can be greatly improved. There is no
interest from users however. I would need a library
of files with situations where the blanker does not
work so well.......

> What is your opinion of sampling the noise blanker
> channel outside of the band in use? It is done in
> some 30 - 50 Mhz receivers.

That is totally useless. It was an easy way in analog
receivers, but not very good.

> I need to improve RF filtering ahead of my 160 meter SDR. There is
> none now and I think IMD renders my test file suspect for noise blanker
> testing. When observing
> the image frequency, the strong on frequency signals create some IMD.

The dumb blanker creates IMD to the extent that signals are
not red on the main spectrum. It is a compromise however
and it can never be perfect. The smart blanker is different,
it does not cause intermodulation, but it requires that
the system is calibrated and that the pulses are truly
wideband. On low bands where the antenna has a non-flat
frequency dependence it does not work well.

Long ago I planned for a baseband blanker but I have not
started to implement it because of lack of input. It would
be intended for pulses that are not wideband.



> Currently I am building
> a 2 meter EME array for a nearby contest station.

I wish you good luck with that:-)

73

Leif

neil G4BRK

unread,
Sep 12, 2011, 3:35:42 AM9/12/11
to lin...@googlegroups.com
Hi Leif,

Very interesting topic and information, especially the role of clipping in the
RX chain and the recordings with impulse noise.

Since putting in a switch to turn off the AGC on my FT-847 (for digital use) I have found
it's often best to turn off the AGC when operating in VHF contests. However it gets
quite tiring to listen to and can cause disturbance to others in the house :-)
I do get quite a lot of impulse interference despite being in a small village and this
does seem to be what upsets the AGC most - I suspect power lines as it is more
continuous than a cow fence. Even fast AGC eliminates the weaker signals.

Hopefully when I finish a few microwave, PA and antenna projects I can get back to
playing with SDR and see what improvements I can make in operation. With luck you
will have invented the perfect AGC by then :-)

73  Neil  G4BRK

Leif Asbrink

unread,
Sep 12, 2011, 5:10:25 PM9/12/11
to lin...@googlegroups.com
Hello Neil,

> Since putting in a switch to turn off the AGC on
> my FT-847 (for digital use) I have found
> it's often best to turn off the AGC when operating
> in VHF contests.

I always operated that way:-)

> However it gets quite tiring to listen to and can
> cause disturbance to others in the house
> :-)

More RF gain and less AF gain in combination with
the use of headphones is how I solved that problem in the past:-)

> I do get quite a lot of impulse interference despite
> being in a small village and this does seem to be what
> upsets the AGC most - I suspect power lines as it is
> more continuous than a cow fence.

Yes. Do you have any remaining impulse interference
when the noise blanker is enabled? (I assume there is one...)

> Even fast AGC eliminates the weaker signals.

Yes, but it should not. I consider that a design error.

> Hopefully when I finish a few microwave, PA and
> antenna projects I can get back to playing with SDR and
> see what improvements I can make in operation. With
> luck you will have invented the perfect AGC by then :-)

Hmmm, I do not think I will try to improve the AGC any more
unless I get interesting recordings that demonstrate
shortcomings. I think you will find that most SDRs are
already very good compared to your FT-847:-)

73

Leif

Earl Shaffer

unread,
Sep 17, 2011, 11:38:15 PM9/17/11
to lin...@googlegroups.com
Hi All.
 
I have been thinking about advanced ways AGC could work in an SDR.
One thing I have been thinking is that a proper AGC could nearly replace a noise blanker
since noise pulses can clip, reducing their level substantially.
 
One advantage an SDR has over a conventional radio is that there is a delay in the processing which leads to an effect I like to call "time travel". It is in effect possible to know the nature of the signal ahead of time. Since you can move around in time in the receiver, then you should be able to tell the difference between a breif noise pulse and a real signal. Knowing this difference then one could use a different timing or threashold of clipping for depending on whether the signal is a noise pulse (low threashold of clipping) or a real signal (use a high threashold of clipping somewhat above the average level of the signal). In this way there is a floating clipping level that always apropriately clips noise but never clips a real signal and also does not run full gain right at the beginning of a transmission or at the rise time of a valid SSB signal. This would completely eliminate any signal clipping  when the AGC attacks due to the desirable slow attack time.
 
This fore knowlege of knowing in effect what the signal is going to do a few hundred milliseconds ahead of time allows one to design, for instance a squelch that always opens and closes at exactly the right time instead of evaluating the signal in real time delaying squelch action until that evaluation is completed. I propose that a similar thing could be done with AGC to give a more natural sound to the AGC action while maintaining optimal noise suppression due to AGC averaging. The resulting effect is that: 1) Noise pulses are always optimally supressed. and 2) Real voice audio is never clipped.
 
73, Jim Shaffer, WB9UWA.

Leif Asbrink

unread,
Sep 18, 2011, 8:28:22 PM9/18/11
to lin...@googlegroups.com
Hi Jim,

> I have been thinking about advanced ways AGC could work in an SDR.
> One thing I have been thinking is that a proper AGC could nearly replace a
> noise blanker
> since noise pulses can clip, reducing their level substantially.

Yes, but it would operate at the baseband bandwidth so it would
be useless to powerline noise and static rain.

> One advantage an SDR has over a conventional radio is that there is a delay
> in the processing which leads to an effect I like to call "time travel". It
> is in effect possible to know the nature of the signal ahead of time. Since
> you can move around in time in the receiver, then you should be able to tell
> the difference between a breif noise pulse and a real signal.

Hmmm, it is not quite as easy....

> Knowing this
> difference then one could use a different timing or threashold of clipping
> for depending on whether the signal is a noise pulse (low threashold of
> clipping) or a real signal (use a high threashold of clipping somewhat above
> the average level of the signal). In this way there is a floating clipping
> level that always apropriately clips noise but never clips a real signal and
> also does not run full gain right at the beginning of a transmission or at
> the rise time of a valid SSB signal. This would completely eliminate any
> signal clipping when the AGC attacks due to the desirable slow attack time.
>
> This fore knowlege of knowing in effect what the signal is going to do a few
> hundred milliseconds ahead of time allows one to design, for instance a
> squelch that always opens and closes at exactly the right time instead of
> evaluating the signal in real time delaying squelch action until that
> evaluation is completed. I propose that a similar thing could be done with
> AGC to give a more natural sound to the AGC action while maintaining optimal
> noise suppression due to AGC averaging. The resulting effect is that: 1)
> Noise pulses are always optimally supressed. and 2) Real voice audio is
> never clipped.

One could go a bit in this direction, but I am not interested since
I think the delay from antenna to loudspeaker should be kept below
30 ms or so. We can look ahead in time by perhaps 5 ms, but not more
and that is not enough to do something really clever.

What I do in Linrad is to apply a really fast AGC that works
as if it were a RF clipper in the IF (not exactly, but nearly.)
Everything is limited and a voice is not distorted. There is no
time constant however so the voice becomes compressed and background
noise amplified. If the fast AGC has been active for a while (attack
time constant) the slow AGC is activated and would keep the gain
low to fit the time characteristics of the voice signal.

Surely, by looking ahead a couple of hundred milliseconds one could have
perfect sound, but I think the advantage of avoiding compression for
maybe 300 ms is not worth the cost of having 300 ms from antenna to
loudspeaker.

For DX listeners it would be different...

73

Leif / SM5BSZ

Earl Shaffer

unread,
Sep 18, 2011, 9:43:46 PM9/18/11
to lin...@googlegroups.com
Hi Leif.
 
 
On Sun, Sep 18, 2011 at 7:28 PM, Leif Asbrink <le...@sm5bsz.com> wrote:
Hi Jim,

> I have been thinking about advanced ways AGC could work in an SDR.
> One thing I have been thinking is that a proper AGC could nearly replace a
> noise blanker
> since noise pulses can clip, reducing their level substantially.
Yes, but it would operate at the baseband bandwidth so it would
be useless to powerline noise and static rain.

> One advantage an SDR has over a conventional radio is that there is a delay
> in the processing which leads to an effect I like to call "time travel". It
> is in effect possible to know the nature of the signal ahead of time. Since
> you can move around in time in the receiver, then you should be able to tell
> the difference between a breif noise pulse and a real signal.
Hmmm, it is not quite as easy....
> AGC to give a more natural sound to the AGC action while maintaining optimal
> noise suppression due to AGC averaging. The resulting effect is that: 1)
> Noise pulses are always optimally supressed. and 2) Real voice audio is
> never clipped.
One could go a bit in this direction, but I am not interested since
I think the delay from antenna to loudspeaker should be kept below
30 ms or so.
 
Why? Is there a practical difference between 30ms and 200ms processing delay?
 
 
We can look ahead in time by perhaps 5 ms, but not more
and that is not enough to do something really clever.

What I do in Linrad is to apply a really fast AGC that works
as if it were a RF clipper in the IF (not exactly, but nearly.)
Everything is limited and a voice is not distorted. There is no
time constant however so the voice becomes compressed and background
noise amplified.
 
The loss of dynamic range is a form of distortion and it increases listening fatigue.
That is one reason I often reduce the RF gain control on conventional radios.
With a fast AGC this fatigue is much worse even if intelligability remains good.
I hear attack distortion as an AGC flaw much like ALC overshoot is in a transmitter
even if ALC overshoot is not readily heard on channel.
 
 
If the fast AGC has been active for a while (attack
time constant) the slow AGC is activated and would keep the gain
low to fit the time characteristics of the voice signal.

Surely, by looking ahead a couple of hundred milliseconds one could have
perfect sound, but I think the advantage of avoiding compression for
maybe 300 ms is not worth the cost of having 300 ms from antenna to
loudspeaker.
 
There may be other ways to tell the difference between a noise burst and desired signal.
For instance the frequency spectrum of the noise or signal should be different in each case
and should be able to suggest which it is and the AGC can act accordingly even if only
a few ms of delay is used to do this. As I recall, your squelch can tell the difference between
noise and a signal. Perhaps some of this code can be borrowed for AGC charactoristics.
Linrad could also remember a short term history and decide if noise pulses are generally
present or not and act accordingly. Linrad also has the advantage of being able to look
outside of the detected bandwidth at wideband noise which in the case of noise pulses
would certainly be present and detected very quickly.
 
In any case during AM reception a carrier is present and that alone should be enough information
(the carrier) to prevent AGC overshoot at the start of someones transmission.
 
I think some of the older radios like the Drake TR4 successfully clip noise pulses while maintaining
good AGC without AGC attack problems? Seems Linrad should be able to duplicate that success
and maybe even improve on it.
 
 
73, Jim Shaffer, WB9UWA.
 
 

Leif Asbrink

unread,
Sep 19, 2011, 5:20:54 AM9/19/11
to lin...@googlegroups.com
Hi Jim,

> Why? Is there a practical difference between 30ms and 200ms processing
> delay?

Yes, 30 ms allows QSK in CW.

> > We can look ahead in time by perhaps 5 ms, but not more
> > and that is not enough to do something really clever.
> >
> > What I do in Linrad is to apply a really fast AGC that works
> > as if it were a RF clipper in the IF (not exactly, but nearly.)
> > Everything is limited and a voice is not distorted. There is no
> > time constant however so the voice becomes compressed and background
> > noise amplified.
>
>
> The loss of dynamic range is a form of distortion and it increases listening
> fatigue.
> That is one reason I often reduce the RF gain control on conventional
> radios.
> With a fast AGC this fatigue is much worse even if intelligability remains
> good.
> I hear attack distortion as an AGC flaw much like ALC overshoot is in a
> transmitter
> even if ALC overshoot is not readily heard on channel.

Listen to Linrad and compare to other alternatives here:
http://www.sm5bsz.com/lir/agctest/agctest.htm

The test is a difficult case in which many receivers do not
perform well at all. Under normal circumstances one would set
a smaller attack time constant in Linrad.

It seems to me that you write about "increases listening fatigue."
based on a theoretical conclusion and not on practical experiences
with recent versions of Linrad.



> There may be other ways to tell the difference between a noise burst and
> desired signal.
> For instance the frequency spectrum of the noise or signal should be
> different in each case
> and should be able to suggest which it is and the AGC can act accordingly
> even if only
> a few ms of delay is used to do this. As I recall, your squelch can tell the
> difference between
> noise and a signal. Perhaps some of this code can be borrowed for AGC
> charactoristics.

Yes, but the squelch causes a delay. One would not use a squelch
while operating QSK....

> Linrad could also remember a short term history and decide if noise pulses
> are generally present or not and act accordingly.

I do not see any way to do that. An SSB transmission could
start like a noise burst. The letter s for example. (Narrowband white noise.)

> Linrad also has the advantage of being able to look
> outside of the detected bandwidth at wideband noise which in the case of
> noise pulses
> would certainly be present and detected very quickly.

Yes, but when looking outside the baseband I no longer call
it an AGC. Then it is a narrowband noise blanker. I have
allocated screen space for it a decade ago and you can find it
in the Linrad block diagram. Fig 1 here:
http://www.sm5bsz.com/linuxdsp/linroot.htm

The narrowband blanker is not yet implemented because of lack of
interest. It would be a function for HF operators who often
experience interference that can not be well eliminated with
a wideband blanker. I would need a library of typical problems.

Surely I can set up test signals in the lab. The AGC test is
one example. That file is set up to make sure that any "normal"
narrowband noise blanker would fail completely. It is an extreme
situation but it is not totally unrealistic. 160 meters with
some cow fences in the neighbourhood. With grass reaching the wires.

I am not going to set up a test signal for narrowband blankers
because I am not interested to solve problems that do not exist.


> In any case during AM reception a carrier is present and that alone should
> be enough information
> (the carrier) to prevent AGC overshoot at the start of someones
> transmission.

Did you really try the Linrad AGC on AM?

I tried your recording with blankers disabled and did not hear
any problems even when increasing the attack time parameter
from 5(=long) to 9 (16 times longer)

I did however find an error on the decay. In AM mode there is
a high pass filter to remove the DC voltage of the carrier.
It is just a subtraction of a low pass filtered signal which
was taken out before the AGC.
If you set a long decay time in AM mode, the output would saturate
from the DC voltage for a while. I will do something about that.

> I think some of the older radios like the Drake TR4 successfully clip noise
> pulses while maintaining
> good AGC without AGC attack problems? Seems Linrad should be able to
> duplicate that success
> and maybe even improve on it.

I think it already does. Someone is expected to bring a R4C here for
testing during the week. Also a FTdx5000. They should be examples of
good and bad conventional receiver AGC systems.

Dear Jim, it is clear that the Linrad noise blanker is not
designed for strong signals that require a high S/N. An AM
signal with very weak modulation can not be blanked because
one can not blank the carrier. Cutting a hole in the carrier
creates a much worse pulse than the one that one tries to remove.
The blanker is for weak signals of CW, SSB and digital modes.

The AGC is however for all types of strong signals. I would
be interested in feedback with recordings on which you
think it does not perform well. I would need a wideband
recording plus the loudspeaker output that you get from
Linrad when processing that recording as well as the
parameter files that you were using. If you give me a
real-world example of something that could work better
I will try to understand the problem. Right now I do not
understand what kind of problem you write about.


73

Leif / SM5BSZ

Reply all
Reply to author
Forward
0 new messages