DSPRelated.com

Evaluate Window Functions for the Discrete Fourier Transform

Neil RobertsonNeil Robertson December 18, 20184 comments

Spectral leakage makes DFTs of continuous sinewaves misleading, and windowing is the practical workaround. This post supplies Matlab code to plot spectra of windowed sinewaves and compute figures of merit, so you can compare windows such as flattop and Chebyshev. See how sidelobe level, mainlobe bandwidth, processing loss, noise bandwidth, and scallop loss trade off to guide your window choice.


Feedback Controllers - Making Hardware with Firmware. Part 10. DSP/FPGAs Behaving Irrationally

Steve MaslenSteve Maslen November 22, 2018

A practical approach to emulating lossy transmission lines in real time, using pole-zero approximations to replace irrational s-domain behaviors and enable FPGA implementation. The author shows 8-pole/zero fits for Zo(s) and a 6-pole/zero plus delay for P(s), validated against LTSpice and MATLAB. Conversion to sampled-data Zo(z) and biquad implementations is detailed, along with issues in single-precision arithmetic and mitigations such as mixed sample rates and partial-fraction decomposition.


Design a DAC sinx/x Corrector

Neil RobertsonNeil Robertson July 22, 20188 comments

Neil Robertson provides a compact Matlab function and coefficient tables for designing linear-phase FIR sinx/x correctors to undo the DAC sinc roll-off. The post explains the sinc_corr(ntaps,fmax,fs) call, shows worked examples with ntaps=5 and different fmax values, and demonstrates fixed-point quantization including a k=512 example and CSD digit guidance. Practical notes cover corrector gain and input back-off to avoid clipping.


Feedback Controllers - Making Hardware with Firmware. Part 9. Closing the low-latency loop

Steve MaslenSteve Maslen July 9, 2018

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.


Digital PLL’s, Part 3 – Phase Lock an NCO to an External Clock

Neil RobertsonNeil Robertson May 27, 201833 comments

Phase-locking a numerically controlled oscillator to an external clock that is unrelated to system clocks is practical and largely unexplored. Neil Robertson presents a time-domain digital PLL that converts the ADC-sampled clock into I/Q with a Hilbert transformer and measures phase error with a compact complex phase detector. The post shows loop-filter coefficient formulas and simulations that reveal how ADC quantization and Gaussian clock noise map into NCO phase noise and how loop bandwidth shapes the result.


ADC Clock Jitter Model, Part 2 – Random Jitter

Neil RobertsonNeil Robertson April 22, 20189 comments

Neil Robertson shows how to simulate ADC sample-clock random jitter in Matlab, moving from band-limited Gaussian noise to wideband and close-in phase noise. The post highlights practical artifacts such as aliasing of wideband clock noise, the 20*log10 dependence of jitter sidebands on input frequency, and why cubic interpolation plus a custom noise_filter produces accurate rms and spectral results engineers can trust.


ADC Clock Jitter Model, Part 1 – Deterministic Jitter

Neil RobertsonNeil Robertson April 16, 201819 comments

Clock jitter on ADC sample clocks corrupts high-frequency signals, and this post builds a practical MATLAB model to show exactly how deterministic (periodic) jitter maps into phase modulation and discrete sidebands. The author explains a parabolic-interpolation approach using twice-rate samples, demonstrates examples from single tones to pulses, and matches simulation spectra to closed-form sideband formulas so engineers can predict jitter effects.


Phase or Frequency Shifter Using a Hilbert Transformer

Neil RobertsonNeil Robertson March 25, 201821 comments

A Hilbert transformer converts a real input into an analytic I+jQ pair, enabling phase shifts and frequency shifts while keeping real inputs and outputs. This article shows Matlab implementations (31-tap FIR with Hamming or Blackman windows), derives y = I cosθ - Q sinθ for phase and frequency shifting, and highlights practical limits from finite taps and coefficient/NCO quantization.


Coefficients of Cascaded Discrete-Time Systems

Neil RobertsonNeil Robertson March 4, 2018

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.


Design IIR Filters Using Cascaded Biquads

Neil RobertsonNeil Robertson February 11, 201828 comments

High-order IIR filters are numerically sensitive, especially at low cutoff frequencies. This article shows how to implement a Butterworth lowpass as a cascade of second-order biquads, deriving the per-section coefficient formulas and giving a Matlab biquad_synth example. It explains computing denominator coefficients from pole pairs, using b = [1 2 1] with K = sum(a)/4 for unity DC gain, and highlights reduced quantization sensitivity.


ADC Clock Jitter Model, Part 2 – Random Jitter

Neil RobertsonNeil Robertson April 22, 20189 comments

Neil Robertson shows how to simulate ADC sample-clock random jitter in Matlab, moving from band-limited Gaussian noise to wideband and close-in phase noise. The post highlights practical artifacts such as aliasing of wideband clock noise, the 20*log10 dependence of jitter sidebands on input frequency, and why cubic interpolation plus a custom noise_filter produces accurate rms and spectral results engineers can trust.


Matlab Code to Synthesize Multiplierless FIR Filters

Neil RobertsonNeil Robertson October 31, 20165 comments

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.


Feedback Controllers - Making Hardware with Firmware. Part I. Introduction

Steve MaslenSteve Maslen August 22, 2017

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.


Model a Sigma-Delta DAC Plus RC Filter

Neil RobertsonNeil Robertson March 16, 20246 comments

Sigma-delta digital-to-analog converters (SD DAC’s) are often used for discrete-time signals with sample rate much higher than their bandwidth. For the simplest case, the DAC output is a single bit, so the only interface hardware required is a standard digital output buffer. Because of the high sample rate relative to signal bandwidth, a very simple DAC reconstruction filter suffices, often just a one-pole RC lowpass. In this article, I present a simple Matlab function that models the combination of a basic SD DAC and one-pole RC filter. This model allows easy evaluation of the overall performance for a given input signal and choice of sample rate, R, and C.


Add the Hilbert Transformer to Your DSP Toolkit, Part 1

Neil RobertsonNeil Robertson November 22, 20224 comments

Learn how the Hilbert transformer creates a 90-degree phase-shifted quadrature component without down-conversion, and why it is simply a special FIR filter. Part 1 defines the transformer, derives its ideal frequency response H(ω)=j for ω<0 and -j for ω≥0, and walks through Matlab examples that demonstrate phase shifting and image attenuation for bandpass signals.


Discrete Wavelet Transform Filter Bank Implementation (part 2)

David David December 5, 20109 comments

David Valencia walks through practical differences between the discrete wavelet transform and the discrete wavelet packet transform, showing why DWPT yields symmetric frequency resolution while DWT favors a single high-pass branch. He explains how Noble identities let you collapse multi-branch filter banks into equivalent single convolutions, then compares block convolution matrices with chain-processing and links to MATLAB code for both approaches.


Feedback Controllers - Making Hardware with Firmware. Part 2. Ideal Model Examples

Steve MaslenSteve Maslen August 24, 2017

An engineer's guide to building ideal continuous-time models for hardware emulation, using TINA Spice, MATLAB and Simulink to validate controller and circuit behavior. The article shows how a passive R-C network can be emulated by an amplifier, a current measurement and a summer, with Spice, MATLAB and Simulink producing coincident Bode responses. Small phase differences between MATLAB and Simulink are noted, and sampled-data issues are slated for the next installment.


Modeling Anti-Alias Filters

Neil RobertsonNeil Robertson September 26, 2021

Modeling anti-alias filters brings textbook aliasing examples to life. This post shows how to build discrete-time models G(z) for analog Butterworth and Chebyshev lowpass anti-alias filters, compares bilinear transform and impulse invariance, and simulates ADC input/output including aliasing of sinusoids and Gaussian noise. It concludes that impulse invariance gives better stopband accuracy and includes Matlab helper functions.


Feedback Controllers - Making Hardware with Firmware. Part 3. Sampled Data Aspects

Steve MaslenSteve Maslen September 9, 2017

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.


Modeling a Continuous-Time System with Matlab

Neil RobertsonNeil Robertson June 6, 20172 comments

Neil Robertson demonstrates a practical workflow for converting a continuous-time transfer function H(s) into an exact discrete-time H(z) using Matlab's impinvar. He walks through a 3rd-order Butterworth example, shows how to match impulse and step responses, and compares frequency response and group delay so engineers can see where the discrete model stays accurate and when sampling-rate limits cause departure.