Project 10: SDR AM Demodulator (Listening to the Airwaves)

Build a basic AM demodulator that extracts audio from RF samples.


Project Overview

Attribute Value
Difficulty Level 3: Advanced
Time Estimate 2-3 weeks
Main Language C
Alternative Languages Python, Rust, C++
Knowledge Area Modulation and demodulation
Tools SDR sample files, audio player
Main Book “The Scientist and Engineer’s Guide to DSP” by Steven W. Smith

What you’ll build: A demodulator that reads IQ samples and outputs audio for AM radio signals.

Why it teaches DSP: It connects theory to real electromagnetic signals and shows how filtering and mixing recover information.

Core challenges you’ll face:

  • Understanding IQ samples and complex signals
  • Implementing envelope detection or synchronous demodulation
  • Filtering out noise and carrier remnants

Real World Outcome

You will input a recorded AM signal and output an audio file that contains the broadcast audio. You should hear clear speech or music.

Example Output:

$ ./am_demod --input am_iq.raw --rate 240000 --output am_audio.wav
Detected carrier at 1.0MHz
Wrote demodulated audio to am_audio.wav

Verification steps:

  • Play the output audio and verify intelligible content
  • Inspect the spectrum to see carrier removal

The Core Question You’re Answering

“How does a high-frequency carrier hide audio, and how do I retrieve it?”

This project turns radio theory into a working pipeline.


Concepts You Must Understand First

Stop and research these before coding:

  1. Amplitude modulation
    • How does the carrier amplitude encode audio?
    • Book Reference: “The Scientist and Engineer’s Guide to DSP” by Steven W. Smith, Ch. 5
  2. IQ sampling
    • Why are signals represented as I and Q components?
    • Book Reference: “Understanding Digital Signal Processing” by Richard G. Lyons, Ch. 7
  3. Low-pass filtering
    • Why do you need a low-pass after demodulation?
    • Book Reference: “The Scientist and Engineer’s Guide to DSP” by Steven W. Smith, Ch. 14

Questions to Guide Your Design

  1. Demodulation method
    • Will you use envelope detection or synchronous detection?
    • How will you handle DC offset and carrier leakage?
  2. Sample rates
    • How will you downsample RF rates to audio rates?
    • What anti-aliasing steps are required?

Thinking Exercise

Carrier Intuition

Imagine a 1kHz audio tone modulating a 1MHz carrier. Sketch what the spectrum should look like.

Questions while working:

  • Where are the sidebands located?
  • How wide is the signal compared to the audio bandwidth?

The Interview Questions They’ll Ask

Prepare to answer these:

  1. “What is IQ sampling and why is it useful?”
  2. “How does AM demodulation work?”
  3. “What is the role of the low-pass filter?”
  4. “Why do you need to downsample after demodulation?”
  5. “What is the difference between envelope and synchronous detection?”

Hints in Layers

Hint 1: Starting Point Start with envelope detection by computing the magnitude of IQ samples.

Hint 2: Next Level Apply a low-pass filter to remove the carrier ripple.

Hint 3: Technical Details Downsample in stages to avoid aliasing artifacts.

Hint 4: Tools/Debugging Plot the spectrum before and after demodulation to verify carrier removal.


Books That Will Help

Topic Book Chapter
AM modulation “The Scientist and Engineer’s Guide to DSP” by Steven W. Smith Ch. 5
IQ signals “Understanding Digital Signal Processing” by Richard G. Lyons Ch. 7
Filtering after demod “The Scientist and Engineer’s Guide to DSP” by Steven W. Smith Ch. 14

Implementation Hints

  • Use recorded IQ sample files to avoid hardware complexity.
  • Start with a strong signal before handling weak stations.
  • Keep each stage separate: demod, filter, resample.

Learning Milestones

  1. First milestone: You can demodulate a strong AM signal into audio.
  2. Second milestone: You can explain IQ sampling and sidebands.
  3. Final milestone: You can build a full AM pipeline with resampling.