22  Signal Processing Essentials

22.1 Learning Objectives

After completing this chapter series, you will be able to:

  • Trace the signal processing pipeline from anti-aliasing filter through ADC conversion to digital filtering, identifying the role of each stage
  • Calculate appropriate sampling rates for IoT sensors by applying the Nyquist sampling theorem to real sensor specifications
  • Select ADC resolution options (8-bit through 16-bit) that match sensor accuracy requirements using the bits-to-resolution decision rule
  • Evaluate voice and audio compression codecs (Opus, Codec2, LPC) for bandwidth-constrained IoT applications
  • Diagnose non-linear sensor behaviour and apply piecewise linearization techniques to thermistors, LDRs, and other common IoT sensors
In 60 Seconds

Signal processing is the part of an IoT system that turns messy real-world sensor behavior into stable digital data that software can trust. This module starts with the analog-to-digital chain, then moves through sampling, filtering, compression, and sensor-specific behaviour. The practical design rule is simple: sample only as fast as the sensor and application require, clean the signal before you transmit it, and choose processing techniques that match the bandwidth, power, and accuracy limits of the device.

Key Concepts

  • Bandwidth defines the useful sampling rate: the sensor and the phenomenon set the maximum information content, not the ADC datasheet alone.
  • Anti-aliasing and sampling must be designed together: filtering before conversion prevents high-frequency content from folding into the measured band.
  • Resolution is only useful when it exceeds the noise floor by a sensible amount: more bits do not help if sensor noise or drift already dominates the measurement.
  • Digital filtering is application-specific: median filters remove spikes, moving averages smooth slowly varying signals, and spectral methods help with vibration or audio.
  • Compression and representation affect system feasibility: once audio or high-rate sensing enters the design, encoding choices determine whether the link and battery budget survive.
  • Real sensors are not ideal math objects: response time, hysteresis, non-linearity, and calibration drift all shape what the downstream software can trust.

This series of chapters covers how IoT devices turn raw sensor signals into reliable digital data. If you have ever wondered how a fitness tracker knows your heart rate from a tiny light on your wrist, or how a smart thermostat reads temperature accurately despite electrical noise – that is signal processing at work. Start with the overview chapter and work through the series in order, as each chapter builds on the previous one.

22.2 Overview

Signal processing is fundamental to IoT systems—it bridges the gap between continuous physical phenomena and discrete digital data that computers can process. This series covers the complete signal processing pipeline from analog sensor output to digital transmission.

Total Reading Time: ~60 minutes | Lab Time: 60-90 minutes

Roadmap diagram for the signal processing module showing a progression from analog signal understanding to ADC and sampling, then filtering and conditioning, then application-specific paths for audio compression, sensor dynamics, and hands-on labs
Figure 22.1

22.3 Chapter Series

22.3.1 1. Signal Processing Overview

⏱️ ~20 min | ⭐ Foundational

What You’ll Learn:

  • Why analog-to-digital conversion is necessary
  • The Nyquist sampling theorem
  • How to choose appropriate sampling rates
  • Common pitfalls: oversampling waste vs undersampling aliasing

Key Topics: Analog vs digital signals, ADC pipeline, Nyquist theorem, sampling strategy


22.3.2 2. Aliasing and ADC Resolution

⏱️ ~15 min | ⭐⭐ Intermediate

What You’ll Learn:

  • How undersampling causes aliasing distortion
  • Calculating required ADC resolution
  • Selecting ADC parameters (8-bit, 10-bit, 12-bit, 16-bit)
  • Implementing digital filters (median, moving average, low-pass)

Key Topics: Aliasing prevention, quantization levels, filter selection, ADC trade-offs


22.3.3 3. Voice and Audio Compression

⏱️ ~14 min | ⭐⭐⭐ Advanced

What You’ll Learn:

  • Toll quality baseline (64 kbps)
  • Companding (μ-law and A-law) for better SNR
  • Linear Predictive Coding (LPC) for 8-27× compression
  • Practical codec selection for IoT applications

Key Topics: Voice compression, companding, source-filter model, codec comparison


22.3.4 4. Sensor Dynamics and Linearization

⏱️ ~15 min | ⭐⭐⭐ Advanced

What You’ll Learn:

  • Why sensors don’t respond instantly (mass-spring-damper model)
  • Understanding step response and bandwidth
  • Matching sampling rate to sensor bandwidth
  • Linearizing non-linear sensors (thermistors, LDRs)

Key Topics: Sensor dynamics, step response, bandwidth matching, linearization methods


22.3.5 5. Signal Processing Labs

⏱️ 60-90 min | ⭐⭐ Practical

What You’ll Do:

  • Configure ESP32 ADC with different resolutions
  • Compare median vs moving average filters
  • Perform FFT frequency analysis
  • Design multi-stage filter pipelines

Key Topics: Hands-on ESP32 simulation, practical filtering, FFT analysis, pipeline design


22.4 Learning Path Recommendations

22.4.1 Beginner Path

  1. Start with Overview - understand the basics
  2. Read Aliasing and ADC - grasp quantization
  3. Do Labs Exercise 1-2 - hands-on ADC and filtering
  4. Skip voice compression and sensor dynamics until needed

22.4.2 Standard Path

  1. Read all chapters in order (1-4)
  2. Complete all labs (chapter 5)
  3. Total time: ~3 hours including hands-on

22.4.3 Advanced Path

  1. Skim chapters 1-2 (review basics)
  2. Deep dive into chapters 3-4 (voice, sensor dynamics)
  3. Complete all labs
  4. Extend labs with custom projects

Knowledge Check: Match the Concept to the Pipeline Stage

22.5 Prerequisites

Before starting this series, you should understand:

22.7 Quick Reference: Key Formulas

Nyquist Theorem: \[f_s > 2 \times f_{max}\]

ADC Resolution: \[\text{Step Size} = \frac{V_{ref}}{2^{bits} - 1}\]

Voltage from ADC: \[V = \text{ADC Value} \times \frac{V_{ref}}{2^{bits} - 1}\]

Companding (μ-law): \[F(x) = \text{sgn}(x) \cdot \frac{\ln(1 + \mu |x|)}{\ln(1 + \mu)}\]

Sensor Bandwidth: \[BW = \frac{1}{2\pi\tau}\]


22.8 Chapter Statistics

  • Overview: about 3,500 words, about 20 minutes, foundational.
  • Aliasing and ADC: about 2,800 words, about 15 minutes, intermediate.
  • Voice Compression: about 2,500 words, about 14 minutes, advanced.
  • Sensor Dynamics: about 2,000 words, about 15 minutes, advanced.
  • Labs: about 2,700 words, about 10 minutes of reading plus 60-90 minutes of hands-on work.
  • Total: about 13,500 words and about 74 minutes of reading, plus 60-90 minutes of lab time.

22.9 Start Learning

If you are new to this module, start here:

If your project is audio-heavy, jump to Voice and Audio Compression after the overview. If your challenge is slow or non-linear physical sensors, go to Sensor Dynamics and Linearization next.


22.10 What’s Next