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

February 7, 2021

Perhaps we should call most Power Spectral Density (PSD) calculations relative PSD, because usually we don’t have to worry about absolute power levels.  However, for cases (e.g., measurements or simulations) where we are concerned with absolute power, it would be nice to be able to display it on a PSD plot.  Unfortunately, you can’t read the power directly from the plot.  For example, the plotted spectral peak of a narrowband signal, such as a sinewave, is lower than the...

## Find Aliased ADC or DAC Harmonics (with animation)

When a sinewave is applied to a data converter (ADC or DAC), device nonlinearities produce harmonics.  If a harmonic frequency is greater than the Nyquist frequency, the harmonic appears as an alias.  In this case, it is not at once obvious if a given spur is a harmonic, and if so, its order.  In this article, we’ll present Matlab code to simulate the data converter nonlinearities and find the harmonic alias frequencies.  Note that Analog Devices has an online tool for...

## Compute Images/Aliases of CIC Interpolators/Decimators

Cascade-Integrator-Comb (CIC) filters are efficient fixed-point interpolators or decimators.  For these filters, all coefficients are equal to 1, and there are no multipliers.  They are typically used when a large change in sample rate is needed.  This article provides two very simple Matlab functions that can be used to compute the spectral images of CIC interpolators and the aliases of CIC decimators.

1.  CIC Interpolators

Figure 1 shows three interpolate-by-M...

## Design Square-Root Nyquist Filters

July 13, 2020

In his book on multirate signal processing, harris presents a nifty technique for designing square-root Nyquist FIR filters with good stopband attenuation [1].  In this post, I describe the method and provide a Matlab function for designing the filters.  You can find a Matlab function by harris for designing the filters at [2].

Background

Single-carrier modulation, such as QAM, uses filters to limit the bandwidth of the signal.  Figure 1 shows a simplified QAM system block...

## Third-Order Distortion of a Digitally-Modulated Signal

June 9, 2020
Analog designers are always harping about amplifier third-order distortion.  Why?  In this article, we’ll look at why third-order distortion is important, and simulate a QAM signal with third-order distortion.

In the following analysis, we assume that signal phase at the amplifier output is not a function of amplitude.  With this assumption, the output y of a non-ideal amplifier can be written as a power series of the input signal x:

y=...

## Second Order Discrete-Time System Demonstration

Discrete-time systems are remarkable:  the time response can be computed from mere difference equations, and the coefficients ai, bi of these equations are also the coefficients of H(z).  Here, I try to illustrate this remarkableness by converting a continuous-time second-order system to an approximately equivalent discrete-time system.  With a discrete-time model, we can then easily compute the time response to any input.  But note that the goal here is as much to...

## A Simplified Matlab Function for Power Spectral Density

In an earlier post [1], I showed how to compute power spectral density (PSD) of a discrete-time signal using the Matlab function pwelch [2].  Pwelch is a useful function because it gives the correct output, and it has the option to average multiple Discrete Fourier Transforms (DFTs).  However, a typical function call has five arguments, and it can be hard to remember how to set them all and how they default.

In this post, I create a simplified PSD function by putting a...

## Fractional Delay FIR Filters

Consider the following Finite Impulse Response (FIR) coefficients:

b = [b0 b1 b2 b1 b0]

These coefficients form a 5-tap symmetrical FIR filter having constant group delay [1,2] over 0 to fs/2 of:

D = (ntaps – 1)/2 = 2      samples

For a symmetrical filter with an odd number of taps, the group delay is always an integer number of samples, while for one with an even number of taps, the group delay is always an integer + 0.5 samples.  Can we design a filter...

## Model Signal Impairments at Complex Baseband

In this article, we develop complex-baseband models for several signal impairments: interfering carrier, multipath, phase noise, and Gaussian noise.  To provide concrete examples, we’ll apply the impairments to a QAM system. The impairment models are Matlab functions that each use at most seven lines of code.  Although our example system is QAM, the models can be used for any complex-baseband signal.

I used a very simple complex-baseband model of a QAM system in my last

## Compute Modulation Error Ratio (MER) for QAM

This post defines the Modulation Error Ratio (MER) for QAM signals, and shows how to compute it.  As we’ll see, in the absence of impairments other than noise, the MER tracks the signal’s Carrier-to-Noise Ratio (over a limited range).  A Matlab script at the end of the PDF version of this post computes MER for a simplified QAM-64 system.

Figure 1 is a simplified block diagram of a QAM system.  The transmitter includes a source of QAM symbols, a root-Nyquist...

## The Power Spectrum

October 8, 2016

Often, when calculating the spectrum of a sampled signal, we are interested in relative powers, and we don’t care about the absolute accuracy of the y axis.  However, when the sampled signal represents an analog signal, we sometimes need an accurate picture of the analog signal’s power in the frequency domain.  This post shows how to calculate an accurate power spectrum.

Parseval’s theorem [1,2] is a property of the Discrete Fourier Transform (DFT) that...

## Second Order Discrete-Time System Demonstration

Discrete-time systems are remarkable:  the time response can be computed from mere difference equations, and the coefficients ai, bi of these equations are also the coefficients of H(z).  Here, I try to illustrate this remarkableness by converting a continuous-time second-order system to an approximately equivalent discrete-time system.  With a discrete-time model, we can then easily compute the time response to any input.  But note that the goal here is as much to...

## Design IIR Highpass Filters

This post is the fourth in a series of tutorials on IIR Butterworth filter design.  So far we covered lowpass [1], bandpass [2], and band-reject [3] filters; now we’ll design highpass filters.  The general approach, as before, has six steps:

Find the poles of a lowpass analog prototype filter with Ωc = 1 rad/s. Given the -3 dB frequency of the digital highpass filter, find the corresponding frequency of the analog highpass filter (pre-warping). Transform the...

## Peak to Average Power Ratio and CCDF

Peak to Average Power Ratio (PAPR) is often used to characterize digitally modulated signals.  One example application is setting the level of the signal in a digital modulator.  Knowing PAPR allows setting the average power to a level that is just low enough to minimize clipping.

However, for a random signal, PAPR is a statistical quantity.  We have to ask, what is the probability of a given peak power?  Then we can decide where to set the average...

In an earlier post [1], we implemented lowpass IIR filters using a cascade of second-order IIR filters, or biquads.

This post provides a Matlab function to do the same for Butterworth bandpass IIR filters.  Compared to conventional implementations, bandpass filters based on biquads are less sensitive to coefficient quantization [2].  This becomes important when designing narrowband filters.

A biquad section block diagram using the Direct Form II structure [3,4] is...

## A Simplified Matlab Function for Power Spectral Density

In an earlier post [1], I showed how to compute power spectral density (PSD) of a discrete-time signal using the Matlab function pwelch [2].  Pwelch is a useful function because it gives the correct output, and it has the option to average multiple Discrete Fourier Transforms (DFTs).  However, a typical function call has five arguments, and it can be hard to remember how to set them all and how they default.

In this post, I create a simplified PSD function by putting a...

## Digital PLL's -- Part 2

In Part 1, we found the time response of a 2nd order PLL with a proportional + integral (lead-lag) loop filter.  Now let’s look at this PLL in the Z-domain [1, 2].  We will find that the response is characterized by a loop natural frequency ωn and damping coefficient ζ.

Having a Z-domain model of the DPLL will allow us to do three things:

Compute the values of loop filter proportional gain KL and integrator gain KI that give the desired loop natural...

## Fractional Delay FIR Filters

Consider the following Finite Impulse Response (FIR) coefficients:

b = [b0 b1 b2 b1 b0]

These coefficients form a 5-tap symmetrical FIR filter having constant group delay [1,2] over 0 to fs/2 of:

D = (ntaps – 1)/2 = 2      samples

For a symmetrical filter with an odd number of taps, the group delay is always an integer number of samples, while for one with an even number of taps, the group delay is always an integer + 0.5 samples.  Can we design a filter...