DSPRelated.com

Simple Discrete-Time Modeling of Lossy LC Filters

Neil RobertsonNeil Robertson April 19, 20231 comment

Converting a lossy LC filter into a discrete-time impulse response lets you analyze mixed analog and DSP systems in one time domain. This post walks through computing the LC frequency response via chain (ABCD) parameters including resistive losses, enforcing the Hermitian symmetry required for a real IDFT, and using the IDFT to produce an asymmetrical FIR impulse response. A 5th-order Butterworth example illustrates insertion loss and impulse-shape effects.


The Discrete Fourier Transform as a Frequency Response

Neil RobertsonNeil Robertson February 4, 20238 comments

Neil Robertson shows that the discrete frequency response H(k) of an FIR filter is exactly the DFT of its impulse response h(n). He derives the continuous H(ω) and discrete H(k) using complex exponentials for a four-tap FIR, then replaces h(n) with x(n) to recover the general DFT formula. The post keeps the math simple and calls out topics left for separate treatment, such as windowing and phase.


Add the Hilbert Transformer to Your DSP Toolkit, Part 2

Neil RobertsonNeil Robertson December 4, 20223 comments

This post shows a simple practical route to a Hilbert transformer by starting from a half-band FIR filter and tweaking its symmetry. It walks through a 19-tap example synthesized with Matlab's firpm (Parks-McClellan), explains the required frequency scaling, and shows how even-numbered taps become (or can be forced) zero through symmetry and coefficient quantization. Useful design rules are summarized for choosing ntaps.


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.


Book Recommendation "What is Mathematics?"

Neil RobertsonNeil Robertson June 20, 20227 comments

Richard Courant and Herbert Robbins' What is Mathematics? is a lucid, classic survey that still rewards engineers who want a concept-first refresher. The author praises the book's calculus chapters as concise and readable, recommending specific sections on complex numbers, functions and limits, and calculus for practical study. Note that linear algebra is not covered and the 1996 edition adds a short Ian Stewart chapter on recent developments.


Evaluate Noise Performance of Discrete-Time Differentiators

Neil RobertsonNeil Robertson March 28, 20228 comments

Differentiators can be wildly different at rejecting noise, even when they share the same usable bandwidth. Neil Robertson introduces the Differentiator Noise Power Ratio, a practical Gaussian-noise metric and a compact formula that uses the filter coefficients to quantify output noise and SNR loss. The post also gives MATLAB guidance for designing and comparing FIR differentiators so you can pick or build filters with much better noise performance.


Learn About Transmission Lines Using a Discrete-Time Model

Neil RobertsonNeil Robertson January 12, 20222 comments

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.


The Discrete Fourier Transform and the Need for Window Functions

Neil RobertsonNeil Robertson November 15, 20212 comments

The FFT alone can mislead: capturing a finite-length signal with a rectangular window smears energy across frequency, producing spectral leakage that hides real components. This post explains the origin of leakage, shows how tapered windows such as the Hanning window suppress sidelobes, and demonstrates the tradeoff between sidelobe suppression and mainlobe widening while covering practical tips on zero-padding and record length.


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.


Digital Filter Instructions from IKEA?

Neil RobertsonNeil Robertson June 18, 20215 comments

This is a wordless example of a folded FIR filter. Swedish “Bygglek” = build and play.


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.


Digital PLL's -- Part 2

Neil RobertsonNeil Robertson June 15, 20165 comments

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.


The Power Spectrum

Neil RobertsonNeil Robertson October 8, 2016

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.


Fractional Delay FIR Filters

Neil RobertsonNeil Robertson February 9, 202017 comments

You can realize arbitrary fractional-sample delays with standard FIR filters by shifting a sinc impulse response and removing symmetry, then windowing the result. This post shows a practical window-method implementation using Chebyshev windows, gives Matlab functions (frac_delay_fir.m and frac_delay_lpf.m) in the appendix, and walks through examples that demonstrate the delay, magnitude trade-offs, and how increasing taps widens the flat-delay bandwidth.


Design IIR Highpass Filters

Neil RobertsonNeil Robertson February 3, 20182 comments

Neil Robertson walks through a compact, six-step procedure to synthesize IIR Butterworth highpass filters using pre-warping and the bilinear transform. The post gives the pole transformations, the placement of N zeros at z=1, the scaling to unity gain at fs/2, and a ready-to-run MATLAB hp_synth implementation that reproduces MATLAB's butter results.


Peak to Average Power Ratio and CCDF

Neil RobertsonNeil Robertson May 17, 20164 comments

Setting digital modulator levels depends on peak-to-average power ratio, because random signals produce occasional high peaks that cause clipping. This post shows how to compute the CCDF of PAPR from a signal vector, with MATLAB code and examples for a sine wave and Gaussian noise. The examples reveal the fixed 3.01 dB PAPR of a sine and the need for large sample counts to capture rare AWGN peaks.


A Simplified Matlab Function for Power Spectral Density

Neil RobertsonNeil Robertson March 3, 20204 comments

Neil Robertson provides a tiny Matlab wrapper around pwelch that simplifies PSD computation by preselecting a Kaiser window, default overlap, and converting units from W/Hz to dBW/bin. Call psd_simple(x,nfft,fs) to get PdB and a frequency vector, with nfft controlling whether DFT averaging is used. The post includes examples showing the effect of averaging and explains the Kaiser window processing loss.


IIR Bandpass Filters Using Cascaded Biquads

Neil RobertsonNeil Robertson April 20, 201911 comments

This post provides a Matlab function that builds Butterworth bandpass IIR filters by cascading second-order biquad sections. The biquad approach, implemented in Direct Form II, reduces sensitivity to coefficient quantization, which matters most for narrowband filters. The included biquad_bp function computes each section's feedforward and feedback coefficients plus gains from a lowpass prototype order, center frequency, bandwidth, and sampling rate.


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.


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.