DSPRelated.com

Compute Modulation Error Ratio (MER) for QAM

Neil RobertsonNeil Robertson November 5, 20192 comments

Neil Robertson shows how to define and compute Modulation Error Ratio (MER) for QAM using a simplified baseband model and decision-slice errors. The post derives per-symbol and averaged MER formulas, explains when MER tracks carrier-to-noise ratio under AWGN and matched root-Nyquist filters, and provides example Pav values for QAM-16 and QAM-64 plus a Matlab script and practical tips.


Plotting Discrete-Time Signals

Neil RobertsonNeil Robertson September 15, 20195 comments

Neil Robertson demonstrates a practical interpolate-by-8 FIR approach to make sampled signals look like their continuous-time counterparts when plotted. The post explains a 121-tap filter designed for signals up to 0.4*fs, shows Matlab examples for a sinusoid and a filtered pulse, and highlights the transient and design trade-offs so you can reproduce clean plots with the supplied interp_by_8.m code.


Interpolation Basics

Neil RobertsonNeil Robertson August 20, 201917 comments

Neil Robertson demonstrates interpolation by an integer factor using a frequency-domain approach, showing how zero-insertion followed by an FIR low-pass filter reconstructs a higher-rate signal. The article walks through spectra, passband and stopband selection, and a 41-tap Parks-McClellan filter example applied to a Chebyshev-window test signal. Matlab code and percent-error plots are included so engineers can reproduce and evaluate the method.


A Direct Digital Synthesizer with Arbitrary Modulus

Neil RobertsonNeil Robertson June 3, 20195 comments

Need exact sampled tones on a coarse grid without a huge sine table? This post shows how to build a Direct Digital Synthesizer with an arbitrary modulus so the output frequency is exactly k·fs/L, using a look-up table as small as 20 entries for the 10 MHz/0.5 MHz-step example. It also explains fixed-point LUT rounding, accumulator bit sizing, and how to produce quadrature outputs when L is multiple of 4.


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.


Demonstrating the Periodic Spectrum of a Sampled Signal Using the DFT

Neil RobertsonNeil Robertson March 9, 201920 comments

This post makes a basic DSP principle tangible by computing the DFT over an extended set of bins and plotting the results. It demonstrates that a sampled signal's spectrum repeats every sampling rate, explains the k-to-frequency mapping, and contrasts common bin ranges such as 0..N-1 and -N/2..N/2-1. The write-up also highlights symmetry for real sequences and recommends using the FFT for efficiency.


Compute the Frequency Response of a Multistage Decimator

Neil RobertsonNeil Robertson February 10, 20192 comments

This post shows a practical way to compute the full frequency response of a multistage decimator by representing every stage at the input sample rate. The author walks through upsampling lower-rate FIR coefficients, convolving to form the overall impulse response, and taking a DFT, then demonstrates how aliasing and stopband placement affect the aliased components. Example Matlab code and plots illustrate each step.


Use Matlab Function pwelch to Find Power Spectral Density -- or Do It Yourself

Neil RobertsonNeil Robertson January 13, 201938 comments

Neil Robertson walks through using Matlab's pwelch and shows how to implement PSD estimation yourself with fft. The post uses concrete examples and complete m-files to demonstrate window selection, converting pxx (W/Hz) to W/bin, Welch DFT averaging, and a worked C/N0 calculation. Readers get practical, runnable recipes for accurate spectrum units, variance reduction with averaging, and peak-power extraction.


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.


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.


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.


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.


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.


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.


Learn to Use the Discrete Fourier Transform

Neil RobertsonNeil Robertson September 28, 2024

Discrete-time sequences arise in many ways: a sequence could be a signal captured by an analog-to-digital converter; a series of measurements; a signal generated by a digital modulator; or simply the coefficients of a digital filter. We may wish to know the frequency spectrum of any of these sequences. The most-used tool to accomplish this is the Discrete Fourier Transform (DFT), which computes the discrete frequency spectrum of a discrete-time sequence. The DFT is easily calculated using software, but applying it successfully can be challenging. This article provides Matlab examples of some techniques you can use to obtain useful DFT’s.


Multiplierless Half-band Filters and Hilbert Transformers

Neil RobertsonNeil Robertson October 7, 20238 comments

This article provides coefficients of multiplierless Finite Impulse Response 7-tap, 11-tap, and 15-tap half-band filters and Hilbert Transformers. Since Hilbert transformer coefficients are simply related to half-band coefficients, multiplierless Hilbert transformers are easily derived from multiplierless half-bands.


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.


Model Signal Impairments at Complex Baseband

Neil RobertsonNeil Robertson December 11, 20197 comments

Neil Robertson presents compact complex-baseband channel models for common signal impairments, implemented as short Matlab functions of up to seven lines. Using QAM examples and constellation plots, he demonstrates how interfering carriers, two-path multipath, sinusoidal phase noise, and Gaussian noise distort constellations and affect MER. The examples are lightweight and practical, making it easy to test receiver diagnostics and prototype adaptive-equalizer scenarios.


Third-Order Distortion of a Digitally-Modulated Signal

Neil RobertsonNeil Robertson June 9, 2020

Amplifier third-order distortion is a common limiter in RF and communications chains, and Neil Robertson walks through why it matters using hands-on MATLAB simulations. He shows how a cubic nonlinearity creates IMD3 tones, causes spectral regrowth and degrades QAM constellations, and gives practical notes on estimating k3, computing ACPR from PSDs, and sampling considerations.