Tuesday, July 23, 2024

AM Demodulation - How?

 

Your first GNU Radio project was likely a FM Broadcast receiver. It is quick, an excellent test of your system and nearly everyone lives within range of a FM Broadcast station.

After this you may have ventured out on your own and started to make an AM receiver. Here you may have had some question on how to do it.

AM Demodulator Block Error?

You probably found the AM Demodulator Block in the GNURadio Companion Blocks Panel and saw that it encapsulates a decimator, a filter and a demodulator all in one simple block. You may have tried it and gotten the infamous “Insufficient Externals” error. At this point you probably looked around for another AM Radio Example and found that some people just use a Complex To Magnitude block and just been confused.

 Figure 1 - The usual failure mode of the standard GNURadio AM Demodulator Block is this somewhat cryptic message of “Insufficient Externals”, but the error message does give some indication that something went wrong with the filter definition as shown above. The root cause of the error is a decimation ratio of greater then 8.

Too Many Choices

Why do some examples use the AM Demodulator Block and some just use the Complex To Magnitude Block?

 
Figure 2 - Some AM Radio examples use the AM Demodulator Block (upper) and some just use the Complex To Magnitude block (lower) which can be confusing, but they do essentially the same thing which is to demodulate an AM signal.

If you look inside the AM Demodulator Block (figure 3) you will see that it is a Hierarchical Block made up of a Complex to Magnitude Block, an Add Constant Block, and a FIR Filter that includes the decimator functionality. 

Figure 3 - The GNURadio AM Demodulator Block is really a hierarchical block that is made up from a Complex to Magnitude Block, an Add Constant Block, and a FIR Filter that includes the decimator functionality.

The AM Demodulator Block usually fails at decimation rates greater than 8 because the program cannot generate the FIR filter coefficients given the other hard coded constraints (filter gain, passband ripple, and ultimate attenuation).

The solution is to use the Complex to Magnitude block as the heart of the AM demodulator, proceeded by a a decimator and perhaps follow it by your AM audio filtering. The Complex To Magnitude Block documentation (see below) gives a complete, but very "Complex" example of how this might work. Sorry for the "Pun" - but that example is "Overly Complex".  ;-)

Block Documentation

https://wiki.gnuradio.org/index.php/AM_Demod

https://wiki.gnuradio.org/index.php/Complex_to_Mag


No comments:

Post a Comment