Few days ago I wrote about how I upgraded the simple double side band receiver implemented in the GNU Radio Companion to a simple single side band receiver. This initial implementation used some default values for the AGC attack and decay rates. These values were acceptable; however, I wanted to spend some time trying to find better values that would correspond to Fast, Medium and Slow AGC – just as we are used to in commercial radios.
First Iteration
The preliminary investigations took longer than expected and I found it difficult to get converging results. Whenever I found something that worked great for e.g. CW, it was rather useless for SSB. There are many parameters that can be adjusted:
- Attack rate – how fast the AGC decreases the gain when a loud signal appears
- Decay rate – how fast the AGC increases the gain when the loud signal is gone
- Reference – This is the level the AGC will try to maintain
- Gain – The overall gain of the AGC (set to 1.0)
- Max gain – The maximum gain the AGC can have (set to 1.0)
This AGC block does not have variable hang time.
After fooling around for a day or so I decided to use 1.0 for Gain and Max gain and 0.3 for Reference – this may sound very low but it’s only -12 dB below 1.0 and it appears to be a good limit with adequate margin to avoid distortion.
The first systematic iteration indicated that an attack rate of 0.1 is fast enough in most cases. It also showed that 100μ decay rate would be good for fast AGC, so the medium and slow would be below that. A decay rate of 40-50μ gives roughly 2 seconds decay time and 20μ gives 3 seconds of decay time (slow). 10μ gives more than 5 seconds of decay time (very slow).
Second Iteration
The second iteration consisted of recording the audio using different decay rates at the same! It’s rather trivial to implement in GNU Radio since all I needed was to add separate AGC, demodulator, and sink running in parallel and using the same signal source. The flow graph I used for this purpose is available here: ssb_rx_v05_LF_multi_agc.grc.
Daytime Recording on 40m
The first batch of recordings were made on 40 meters during mid day while the band is relatively quiet. If you are interested in the topic you would probably also want to download the MP3 files and load them into a sound editor such as Audacity. You can then actually see the amount of work the AGC is doing.
Recordings on 40m from 2010.04.08 14:43 CET – Band is quiet | |||
AGC Type | Decay Rate |
File | Listen |
Fast | 150μ | 3.6 MByte MP3 | |
Fast | 100μ | 3.6 MByte MP3 | |
Medium | 70μ | 3.6 MByte MP3 | |
Medium | 50μ | 3.6 MByte MP3 | |
Slow | 20μ | 3.6 MByte MP3 | |
Very slow | 10μ | 3.6 MByte MP3 |
Evening recording on 40m
The second batch was done in the evening just before sunset when 40 meters becomes more alive and noisy. I also added 500μ and 1m decay rate. Can you hear 3B8/SP2PMB at 1:55?
Recordings on 40m from 2010.04.08 19:20 CET – Signals become strong | |||
AGC Type | Decay Rate |
File | Listen |
Very fast | 1m | 5.6 MByte MP3 | |
Very fast | 500μ | 5.6 MByte MP3 | |
Fast | 150μ | 5.6 MByte MP3 | |
Fast | 100μ | 5.6 MByte MP3 | |
Medium | 70μ | 5.6 MByte MP3 | |
Medium | 50μ | 5.6 MByte MP3 | |
Slow | 20μ | 5.6 MByte MP3 | |
Very slow | 10μ | 5.6 MByte MP3 |
These recordings sound quite all right; however, we are not quite there yet. If we look at the recordings in a sound editor we see that the CW signals are not flat (100m attack rate, variable decay rate):
We can compare with the signals from my IC-765 (fast and slow AGC):
I tried several other combinations of attack and decay rates but I could not get anywhere near as flat as on my IC-765. I will have to look into the code to understand how it works. I suspect the lack of hang time may also have something to do with it.
Receiver V0.5
So, I guess this would make version 0.5 of the simple SSB receiver. I have uploaded the GRC file to the server, but note that the AGC is currently fixed at medium. For some reason the GRC generated code lacks the ability to set the AGC parameters.
Bonus Tracks
This exercise was interesting enough on its own, nevertheless, it was a rewarding bonus to hear stations like OY3QN and JA6GIJ on 80 meters while I was experimenting with my software defined radio code! Keep in mind that I was only using the USRP with the LFRX daughterboard – no additional preamps or filters, just a looong cable to my HF2V vertical antenna!
Recording on 80m, 2010.04.07, AGC: 100m / 30μ – you can hear JA6GIJ from around 1:18 (MP3 file)
Recording on 80m, 2010.04.07, AGC: 100m / 30μ – you can hear OY3QN from around 2:25 (MP3 file)