Canonic Signed Digit (CSD) Representation of Integers
Canonic Signed Digit (CSD) encoding slashes the number of nonzero bits in integer coefficients, enabling multiplierless FIR filters implemented with shifts and adds. This post uses MATLAB code to demonstrate CSD rules, show how negative values work, and plot the distribution of signed digits as bit width changes. It finishes with practical techniques to minimize signed digits per coefficient for area and power efficient filter designs.
Matlab Code to Synthesize Multiplierless FIR Filters
Learn how to build multiplierless FIR lowpass filters in Matlab using Canonic Signed-Digit coefficients. The post explains converting Parks-McClellan floating-point taps to scaled integers, then to exact CSD digits, and includes two m-files that search maintap scaling to minimize signed digits while preserving the filter response. Practical notes cover external gain compensation, the 2/3 full-scale CSD limit, and sensitivity to pass/stop edges.
The Power Spectrum
You can get absolute power from a DFT, not just relative spectra. In this post Neil Robertson shows how to convert FFT outputs into watts per bin using Parseval's theorem, how to form one-sided spectra, and how to normalize windows so power is preserved. Matlab examples demonstrate bin-centered and between-bin sinusoids, leakage, scalloping, and how to recover component power by summing bins.
Digital PLL's -- Part 2
Neil Robertson builds a Z-domain model of a second-order digital PLL with a proportional-plus-integral loop filter, then derives closed-form formulas for KL and KI from the desired loop natural frequency and damping. The post explains the s → (z - 1)/Ts approximation, shows how to form the closed-loop IIR CL(z) for step and frequency responses, and highlights when the linear Z-domain model falls short of nonlinear acquisition behavior.
Digital PLL's -- Part 1
A hands-on introduction to time-domain digital phase-locked loops, Neil Robertson builds a simple DPLL model in MATLAB and walks through the NCO, phase detector, and PI loop filter implementations. The post uses phase-in-cycles arithmetic to show how the phase accumulator, detector wrapping, and loop filter interact, and it contrasts linear steady-state behavior with the nonlinear acquisition seen when initial frequency error is large. Part 2 will cover frequency-domain tuning of the loop gains.
A poor man's Simulink
Markus Nentwig built a compact glue layer that embeds NGSPICE into Octave to cosimulate continuous-time circuits and digital control. The article walks through an RC lowpass example, the MEX-based Octave interface, and the breakpoint-driven cosimulation flow, showing how adaptive SPICE integration handles asynchronous and time-triggered events. It presents a practical, low-cost alternative to Simulink for tightly coupled analog-digital system design.
Spline interpolation
Markus Nentwig provides a cookbook for segmented cubic spline interpolation that turns scattered or noisy data into efficient fixed-point functions. The article shows how to build third-order polynomial segments with explicit value and slope control via basis functions, solve scaling factors by least-squares in Octave/Matlab, and export coefficients for Verilog RTL evaluation using the Horner scheme and practical fixed-point tips.
'z' as in 'Zorro': Frequency Masking FIR
Markus Nentwig shows an efficient way to build steep wideband FIR filters by combining upsampled and complementary stages, then masking their spectra. He provides a Matlab and Octave design program that uses a generic least-squares optimizer to place coefficients, letting you explore filter sizes and oversampling while cutting computational cost significantly compared to a conventional symmetric FIR.
FIR sideways (interpolator polyphase decomposition)
Markus Nentwig presents a compact way to implement a symmetric FIR interpolator by rethinking the usual tapped delay line. The 1:3 polyphase example uses separate delay lines per coefficient to skip multiplies on known zeros and exploit symmetry, cutting multiplications substantially; a Matlab/Octave demo and notes on ASIC-friendly implementation are included to help evaluate real-world cost tradeoffs.
Design of an anti-aliasing filter for a DAC
If you need a practical way to design an anti-aliasing filter for a DAC, this post delivers an Octave/Matlab script that numerically optimizes a Laplace-domain transfer function for linear phase and arbitrary magnitude. The routine models the DAC sample-and-hold sinc response, compensates group delay automatically, and can include an optional multiplierless FIR equalizer. An example shows a 5.4 dB objective improvement and reduced analog Q for easier implementation.
Radio Frequency Distortion Part II: A power spectrum model
Markus Nentwig presents a power-spectrum model that predicts RF nonlinear distortion from spectral power values instead of time-domain signals. The model computes distortion as repeated convolutions with a frequency-reversed replica and uses an FFT/IFFT trick with real-valued arithmetic for very high efficiency, making it suitable for system-level simulations and interference-aware radios. It is accurate for OFDM-like, Gaussian-amplitude signals when spectral binning is sufficiently fine; narrowband cases require denser bins.
Feedback Controllers - Making Hardware with Firmware. Part 3. Sampled Data Aspects
This article digs into practical sampled-data issues you must address when building feedback controllers for circuit emulation. It highlights a common MATLAB versus Simulink discrepancy caused by DAC holding, explains why FOH (ramp-invariant) c2d conversion matters, and surveys latency, bit depth, filter and precision trade-offs. It also lists candidate ADCs, DACs and FPGAs used in a real evaluation platform to guide hardware choices.
Compute Images/Aliases of CIC Interpolators/Decimators
CIC filters provide multiplier-free interpolation and decimation for large sample-rate changes, but their images and aliases can trip up designs. This post supplies two concise Matlab functions and hands-on examples to compute interpolator images and decimator aliases, showing spectra and freqz plots. Readers will learn how interpolation ratio and number of stages alter passband, stopband, and aliasing behavior.
Feedback Controllers - Making Hardware with Firmware. Part 9. Closing the low-latency loop
This article demonstrates combining DSP and feedback-control on an Intel Cyclone floating-point FPGA to build low-latency closed-loop circuit emulators and controllers. Using a single floating-point biquad at 1.6 Msps, an IFFT multi-tone 4.096 ms capture for wideband measurement, and MATLAB references for verification, the author achieves sub-nanosecond timing insight and applies DSP phase compensation to cancel about 100 pF of PCB parasitics.
The Phase Vocoder Transform
Treating the phase vocoder as a continuous transform, this post frames PV(x,α,β) as a bijection on signal space and derives the domain constraints needed for an inverse mapping. It uses geometric intuition and group-theory analogies to explain negative and zero scalings, then brings the idea back to DSP to show how aliasing and phase artifacts appear. The Laroche and Dolson consistency measure D_M plus MATLAB experiments are used to compare classic and identity phase-locking reconstructions.
FIR sideways (interpolator polyphase decomposition)
Markus Nentwig presents a compact way to implement a symmetric FIR interpolator by rethinking the usual tapped delay line. The 1:3 polyphase example uses separate delay lines per coefficient to skip multiplies on known zeros and exploit symmetry, cutting multiplications substantially; a Matlab/Octave demo and notes on ASIC-friendly implementation are included to help evaluate real-world cost tradeoffs.
Determination of the transfer function of passive networks with MATLAB Functions
Starting the calculation from the output makes deriving a passive network transfer function simple, and this post shows how to do it in MATLAB using a sixth-order low-pass example. The walkthrough uses tf('s') to build a symbolic H(s), extracts coefficients with tfdata, and shows numerical frequency-response plotting via freqs or direct j*omega evaluation, with code and component values to reproduce the results.
Weighted least-squares FIR with shared coefficients
Markus Nentwig demonstrates how to design FIR filters that share coefficients across delay taps, allowing multiplier reuse and reduced implementation cost. He reimplements Lawson's iterative reweighted least-squares for complex-valued FIRs and provides Matlab/Octave code you can adapt for nonstandard constraints. The post explains iteration weight logic, the Toeplitz special-case with Levinson-Durbin, and practical trade-offs between multiplier count and stopband performance.
Feedback Controllers - Making Hardware with Firmware. Part I. Introduction
This first post kicks off a series on using DSP and feedback control with mixed-signal electronics and FPGAs to emulate two-terminal circuits and create low latency controllers. It frames circuit emulation as a feedback problem, highlights latency as the key practical constraint, and outlines the planned evaluation hardware, target devices, and software tools that will be used in later MATLAB/Simulink and FPGA work.
Matlab Code to Synthesize Multiplierless FIR Filters
Learn how to build multiplierless FIR lowpass filters in Matlab using Canonic Signed-Digit coefficients. The post explains converting Parks-McClellan floating-point taps to scaled integers, then to exact CSD digits, and includes two m-files that search maintap scaling to minimize signed digits while preserving the filter response. Practical notes cover external gain compensation, the 2/3 full-scale CSD limit, and sensitivity to pass/stop edges.
Python number crunching faster? Part I
Christopher Felton walks through simple benchmarks comparing raw Python, numpy, and PyPy for numeric workloads, and shares what surprised him about performance. He shows that idiomatic Python optimizations such as list comprehensions and built-ins plus the PyPy JIT can sometimes beat a numpy approach for small tests, and explains why native PyPy numpy progress matters for scientific users.
Learn About Transmission Lines Using a Discrete-Time Model
A simple discrete-time approach makes lossless transmission-line behavior easy to simulate and visualize. The post introduces MATLAB functions tline and wave_movie to model uniform lossless lines with resistive terminations, compute time and frequency responses, and animate travelling waves. A microstrip pulse example shows how reflections produce ringing and how source matching nearly eliminates it, making this a practical learning tool.
Instant CIC
Modeling CIC decimators in floating point is simpler than you might think, Markus Nentwig shows, if you treat the filter as a finite FIR by sampling its impulse response. The post compares a naive float time-domain implementation, an FFT-based frequency-domain approach, and the recommended method of computing the impulse response and using an off-the-shelf FIR filter, with code and plots.
Coefficients of Cascaded Discrete-Time Systems
Multiplying discrete-time transfer functions is just polynomial multiplication, and polynomial multiplication is convolution. Neil Robertson shows that the numerator and denominator coefficients of cascaded systems come from convolving the individual coefficient vectors, then demonstrates the idea with MATLAB code and a 2nd-order IIR cascade that yields a 4th-order response. The approach makes computing time and frequency responses straightforward.
Modelling a Noisy Communication Signal in MATLAB for the Analog to Digital Conversion Process
Practical signal modeling treats receiver noise as a fixed power source, not something tied to the transmitted waveform. Parth demonstrates why using MATLAB's awgn(sig,SNR,'measured') can misrepresent an analog front end and provides a short function that scales your signal so the added AWGN produces the desired receiver noise variance. This prepares realistic inputs for upcoming ADC simulations.
Simulink-Simulation of SSB demodulation
This post walks through Simulink models that implement SSB demodulation and modulation, using Richard Lyons' phasing method as a foundation. It shows practical models for simple carrier multiplication and for the phasing method with cosine and -sin paths plus Hilbert filtering, and it highlights sampling, decimation, filter choices, and delay alignment to make the techniques work in simulation.
Decimators Using Cascaded Multiplierless Half-band Filters
In my last post, I provided coefficients for several multiplierless half-band FIR filters. In the comment section, Rick Lyons mentioned that such filters would be useful in a multi-stage decimator. For such an application, any subsequent multipliers save on resources, since they operate at a fraction of the maximum sample frequency. We’ll examine the frequency response and aliasing of a multiplierless decimate-by-8 cascade in this article, and we’ll also discuss an interpolator cascade using the same half-band filters.
A Matlab Function for FIR Half-Band Filter Design
FIR Half-band filters are not difficult to design. In an earlier post [1], I showed how to design them using the window method. Here, I provide a short Matlab function halfband_synth that uses the Parks-McClellan algorithm (Matlab function firpm [2]) to synthesize half-band filters. Compared to the window method, this method uses fewer taps to achieve a given performance.
The First-Order IIR Filter -- More than Meets the Eye
While we might be inclined to disdain the simple first-order infinite impulse response (IIR) filter, it is not so simple that we can’t learn something from it. Studying it can teach DSP math skills, and it is a very useful filter in its own right. In this article, we’ll examine the time response of the filter, compare the first-order IIR filter to the FIR moving average filter, use it to smooth a noisy signal, compute the functional form of the impulse response, and find the frequency response.
Radio Frequency Distortion Part II: A power spectrum model
Markus Nentwig presents a power-spectrum model that predicts RF nonlinear distortion from spectral power values instead of time-domain signals. The model computes distortion as repeated convolutions with a frequency-reversed replica and uses an FFT/IFFT trick with real-valued arithmetic for very high efficiency, making it suitable for system-level simulations and interference-aware radios. It is accurate for OFDM-like, Gaussian-amplitude signals when spectral binning is sufficiently fine; narrowband cases require denser bins.













