DSPRelated.com

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.


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.


Determination of the transfer function of passive networks with MATLAB Functions

Josef HoffmannJosef Hoffmann December 7, 20212 comments

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.


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.


Sampling bandpass signals

Josef HoffmannJosef Hoffmann June 26, 20215 comments

Bandpass signals can be sampled at rates below the usual Nyquist limit, and this note shows how the band-limited spectrum appears in baseband after sampling. Using a simple example figure, it defines the center frequency fc = (fmax + fmin)/2 and bandwidth Δf = fmax - fmin, and highlights that choosing fs less than twice the signal's highest frequency violates the sampling theorem.


Simulink-Simulation of SSB demodulation

Josef HoffmannJosef Hoffmann June 13, 20211 comment

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.


Setting Carrier to Noise Ratio in Simulations

Neil RobertsonNeil Robertson April 11, 2021

Setting the right Gaussian noise level is easy once you know the math. This post derives simple, practical equations to compute noise density and the rms noise amplitude needed to achieve a target carrier to noise ratio at a receiver output. It shows how to get the noise-equivalent bandwidth from a discrete-time filter, how to compute N0 and sigma, and includes a MATLAB set_cnr function to generate the noise vector.


Update to a Narrow Bandpass Filter in Octave or Matlab

Paul LovellPaul Lovell March 29, 2021

Paul Lovell presents an updated, compact Octave/Matlab implementation of a narrow bandpass FIR that runs about four times faster and uses float32 to cut processing cost. The design combines a single matrix IFIR stage with three moving-sum (RRS) stages per baseband, auto-calculates the IFIR expansion factor, and adds easier parameter setup plus WAV I/O and FFT plots. A TensorFlow Colab demo is also provided.


Add a Power Marker to a Power Spectral Density (PSD) Plot

Neil RobertsonNeil Robertson February 7, 2021

Read absolute power directly from a PSD plot with a simple MATLAB helper. The author presents psd_mkr, a function that computes the PSD with pwelch and overlays a power marker in three modes: normal for narrowband tones, band-power for integrated power over a specified bandwidth, and 1 Hz for noise density readings. Examples show how bin summing, window loss, and scalloping are handled for accurate measurements.


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.


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.


Time Machine, Anyone?

Andor BariskaAndor Bariska March 7, 20086 comments

Causal filters can look like time machines, but they do not break physics. Andor Bariska reproduces a classic electronic experiment in MATLAB, showing how a minimum-phase peaking filter and its FDLS biquad approximation produce negative group delay bands that make predictable, bandlimited signals appear to emerge early. The post walks through group delay, discretization, pulse and random-signal tests, and why unpredictability restores causality.


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.


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.


A poor man's Simulink

Markus NentwigMarkus Nentwig January 24, 20153 comments

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.