Prototyping DSP algorithms on real-world signals using MATLAB
DSP engineers across Industry and Academia have long been familiar with writing MATLAB code for early algorithm exploration and signal analysis. In many situations, signal processing algorithms also need validation using real-world signals, which in turn often drives the need for real-time implementations.
In this talk, we discuss practical coding advice for creating real-time DSP prototypes directly using MATLAB programs. The goal is to process real-world signals, such as signals streaming from audio devices or software-defined radios, but remove the complexity of hardware and real-time programming. Throughout the session, we use practical code examples, including digital filtering and other common signal processing tasks. Some programming experience will be beneficial, but it is not required.
What this presentation is about and why it matters
This talk shows how to go from DSP ideas to live, real‑time prototypes using MATLAB. The speaker demonstrates simple but practical patterns for acquiring streaming signals (audio and RF), processing them block‑by‑block, visualizing results, and packaging working code for use outside MATLAB (plugins, C/C++, single‑board computers). The emphasis is on removing the usual friction: efficient I/O, state management, parameter tuning while the system runs, choosing the right algorithmic implementation (time vs frequency domain), and measuring whether your code meets the timing budget.
Why this matters: turning an algorithm into a working demo or validation prototype is a common and important step in both research and product development. Prototypes convince stakeholders, reveal edge cases, expose real‑world performance limits, and provide a realistic baseline for embedded implementation. The talk focuses on patterns and tools that make that step faster and less error prone.
Who will benefit the most from this presentation
- DSP engineers and researchers who want to test algorithms on live signals before committing to embedded code.
- Students learning how to move from offline analysis to real‑time systems and demos.
- Developers evaluating tradeoffs between algorithmic implementations (e.g., long FIR via frequency‑domain convolution vs time‑domain FIR).
- Anyone using MATLAB who wants practical guidance on streaming I/O, stateful processing, and automated deployment (audio plugins, C/C++ codegen, Raspberry Pi, etc.).
What you need to know
This talk is practical rather than theoretical; a modest background will help you follow the examples quickly:
- Basic digital filtering: know what FIR and IIR filters are and how filtering is normally applied to a full signal vector in MATLAB using filter or convolution.
- Block (frame) processing: instead of processing a whole file at once, you will repeatedly process short buffers (frames) of samples inside a loop. Keep in mind the notion of a timing budget: if your frame period is $T_s$, processing must finish before the next frame arrives.
- States and continuity: when processing blocks you must preserve filter internal states between blocks. In other words, filter state must be stored outside the per‑block function so the filter response is continuous across frame boundaries.
- Complexity vs latency tradeoffs: long impulse responses are expensive in the time domain; frequency‑domain convolution (overlap‑add/overlap‑save) reduces cost for long filters but introduces algorithmic latency. Partitioned convolution trades latency vs cost by splitting the impulse response into blocks.
- Object‑oriented patterns: wrapping processing in an object (System object or class) that holds properties (parameters) and state makes it straightforward to separate one‑time initialization from per‑block work, and to expose tunable parameters safely to a UI while the loop runs.
- Profiling and drivers: understand how to measure per‑block processing time (simple tic/toc or a loop timer) and be aware of audio driver choices (ASIO, etc.) or SDR interfaces when working with non‑audio hardware.
- Deployment basics: the talk shows automated paths from MATLAB to VST/AU plugins and to C/C++ code suitable for embedded targets; you do not need deep knowledge of code generation to appreciate the workflow, but knowing where your deployment constraints (latency, CPU budget, memory) lie will help.
Glossary
- audioDeviceReader / audioDeviceWriter — MATLAB objects that stream audio from and to the system sound card with small, repeated buffers.
- System object — a MATLAB class pattern for streaming algorithms that preserves state and provides a clear process interface for block processing.
- IIR (Infinite Impulse Response) — recursive filter type implemented with feedback; compact for a given response but requires state tracking.
- FIR (Finite Impulse Response) — non‑recursive filter implemented by convolution with a finite impulse response vector.
- Convolution — the operation $y[n]=\sum_k x[k]h[n-k]$ used for FIR filtering and reverb; can be done in time or frequency domain.
- Overlap‑add / overlap‑save — frequency‑domain convolution techniques that use FFTs to accelerate long FIR filtering.
- Partitioned convolution — splitting a long impulse response into smaller blocks to reduce latency and enable efficient block processing.
- State — the internal memory of a block algorithm (e.g., filter delays) that must persist between blocks to maintain continuity.
- Timing budget / latency — the maximum time available to process one block before the next arrives; exceeding it causes glitches or dropped frames.
- SDR (Software‑Defined Radio) — hardware that streams complex IQ baseband samples to/from MATLAB for wireless signal experiments.
A few encouraging words about the presentation
The presenter combines practical, hands‑on demos with clear software design patterns that are directly usable the next time you need a demo or prototype. The examples balance accessibility (simple high‑pass filter and UI tuning) with memorable demonstrations of harder problems (long impulse responses and algorithm selection). If you want concrete techniques to make MATLAB code real‑time friendly, and to move from experiments to deployable prototypes, this talk is a concise, constructive guide that respects both algorithmic correctness and engineering constraints.
This overview is AI-generated from the session transcript. Spot an issue? Let us know.
Great talk and love the examples, very practical. Also thank you for providing the code.
You can download the MATLAB code used using the URL and credentials below (note that the files will be automatically deleted after 30 days):
https://sft.mathworks.com/human.aspx?r=&Arg07=706857496&Arg12=fileview
Username: customer
Password: MathWorks
Thanks, Gabriele.
You can download the MATLAB code used using the URL and credentials below (note that the files will be automatically deleted after 30 days):
https://sft.mathworks.com/human.aspx?r=&Arg07=706857496&Arg12=fileview
Username: customer
Password: MathWorks
Thanks, Gabriele.
Basically it was just about implementation details.
Not so interesting for me.
Welcome everyone and happy second day at the DSP Online Conference! I'll aim to answer most questions for this session live during the Q&A slot from 8:30-9am ET but feel free to also drop your questions here below as they come up.
Thank you for the excellent presentation and the examples; a real time saver.