Neil Robertson Blog on DSPRelated.com
https://www.dsprelated.com/blogs-1/nf/Neil_Robertson.php
Neil Robertson Blog on DSPRelated.com
https://www.dsprelated.com/blogs-1/nf/Neil_Robertson.php
https://d23s79tivgl8me.cloudfront.net/user/profilepictures/113580.jpgen-USFri, 18 Jan 2019 10:13:55 +00001547806435Use Matlab Function pwelch to Find Power Spectral Density – or Do It Yourself
https://www.dsprelated.com/showarticle/1221.php
In my last post, we saw that finding the spectrum of a signal requires several steps beyond computing the discrete Fourier transform (DFT)[1]. These include windowing the signal, taking the magnitude-squared of the DFT, and computing the vector of frequencies. The Matlab function pwelch [2] performs all these steps, and it also has the option to use DFT averaging to compute the...]]>Sun, 13 Jan 2019 18:18:48 +0000Neil RobertsonEvaluate Window Functions for the Discrete Fourier Transform
https://www.dsprelated.com/showarticle/1211.php
The Discrete Fourier Transform (DFT) operates on a finite length time sequence to compute its spectrum. For a continuous signal like a sinewave, you need to capture a segment of the signal in order to perform the DFT. Usually, you also need to apply a window function to the captured signal before taking the DFT [1 - 3]. There are many different window functions and each...]]>Tue, 18 Dec 2018 20:43:38 +0000Neil RobertsonDesign a DAC sinx/x Corrector
https://www.dsprelated.com/showarticle/1191.php
This post provides a Matlab function that designs linear-phase FIR sinx/x correctors. It includes a table of fixed-point sinx/x corrector coefficients for different DAC frequency ranges.

A sinx/x corrector is a digital (or analog) filter used to compensate for the sinx/x roll-off inherent in the digital to analog conversion process. In DSP math, we treat the digital signal...]]>
Sun, 22 Jul 2018 17:22:49 +0000Neil RobertsonDigital PLL’s, Part 3 – Phase Lock an NCO to an External Clock
https://www.dsprelated.com/showarticle/1177.php
Sometimes you may need to phase-lock a numerically controlled oscillator (NCO) to an external clock that is not related to the system clocks of your ASIC or FPGA. This situation is shown in Figure 1. Assuming your system has an analog-to-digital converter (ADC) available, you can sync to the external clock using the scheme shown in Figure 2. This time-domain PLL model is...]]>Sun, 27 May 2018 18:06:07 +0000Neil RobertsonADC Clock Jitter Model, Part 2 – Random Jitter
https://www.dsprelated.com/showarticle/1160.php
In Part 1, I presented a Matlab function to model an ADC with jitter on the sample clock, and applied it to examples with deterministic jitter. Now we’ll investigate an ADC with random clock jitter, by using a filtered or unfiltered Gaussian sequence as the jitter source. What we are calling jitter can also be called time jitter, phase jitter, or phase noise. It’s...]]>Sun, 22 Apr 2018 17:30:15 +0000Neil RobertsonADC Clock Jitter Model, Part 1 – Deterministic Jitter
https://www.dsprelated.com/showarticle/1157.php
Analog to digital converters (ADC’s) have several imperfections that affect communications signals, including thermal noise, differential nonlinearity, and sample clock jitter [1, 2]. As shown in Figure 1, the ADC has a sample/hold function that is clocked by a sample clock. Jitter on the sample clock causes the sampling instants to vary from the ideal sample time. This...]]>Mon, 16 Apr 2018 17:29:19 +0000Neil RobertsonPhase or Frequency Shifter Using a Hilbert Transformer
https://www.dsprelated.com/showarticle/1147.php
In this article, we’ll describe how to use a Hilbert transformer to make a phase shifter or frequency shifter. In either case, the input is a real signal and the output is a real signal. We’ll use some simple Matlab code to simulate these systems. After that, we’ll go into a little more detail on Hilbert transformer theory and design.

Sun, 25 Mar 2018 16:43:41 +0000Neil RobertsonCoefficients of Cascaded Discrete-Time Systems
https://www.dsprelated.com/showarticle/1141.php
In this article, we’ll show how to compute the coefficients that result when you cascade discrete-time systems. With the coefficients in hand, it’s then easy to compute the time or frequency response. The computation presented here can also be used to find coefficients of mixed discrete-time and continuous-time systems, by using a discrete time model of the continuous-time...]]>Sun, 04 Mar 2018 16:08:17 +0000Neil RobertsonDesign IIR Filters Using Cascaded Biquads
https://www.dsprelated.com/showarticle/1137.php
Sun, 11 Feb 2018 21:08:34 +0000Neil RobertsonDesign IIR Highpass Filters
https://www.dsprelated.com/showarticle/1135.php
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,...]]>
Sat, 03 Feb 2018 16:09:47 +0000Neil RobertsonDesign IIR Band-Reject Filters
https://www.dsprelated.com/showarticle/1131.php
In this post, I show how to design IIR Butterworth band-reject filters, and provide two Matlab functions for band-reject filter synthesis. Earlier posts covered IIR Butterworth lowpass [1] and bandpass [2] filters. Here, the function br_synth1.m designs band-reject filters based on null frequency and upper -3 dB frequency, while br_synth2.m designs them based on lower and upper -3...]]>Wed, 17 Jan 2018 23:54:49 +0000Neil RobertsonDesign IIR Bandpass Filters
https://www.dsprelated.com/showarticle/1128.php
In this post, I present a method to design Butterworth IIR bandpass filters. My previous post [1] covered lowpass IIR filter design, and provided a Matlab function to design them. Here, we’ll do the same thing for IIR bandpass filters, with a Matlab function bp_synth.m. Here is an example function call for a bandpass filter based on a 3rd order lowpass prototype:
N=...]]>Sat, 06 Jan 2018 18:35:44 +0000Neil RobertsonDesign IIR Butterworth Filters Using 12 Lines of Code
https://www.dsprelated.com/showarticle/1119.php
While there are plenty of canned functions to design Butterworth IIR filters [1], it’s instructive and not that complicated to design them from scratch. You can do it in 12 lines of Matlab code. In this article, we’ll create a Matlab function butter_synth.m to design lowpass Butterworth filters of any order. Here is an example function call for a 5th order...]]>Sun, 10 Dec 2017 19:20:56 +0000Neil RobertsonSimplest Calculation of Half-band Filter Coefficients
https://www.dsprelated.com/showarticle/1113.php
Half-band filters are lowpass FIR filters with cut-off frequency of one-quarter of sampling frequency fs and odd symmetry about fs/4 [1]*. And it so happens that almost half of the coefficients are zero. The passband and stopband bandwiths are equal, making these filters useful for decimation-by-2 and interpolation-by-2. Since the zero coefficients make them...]]>Mon, 20 Nov 2017 18:26:41 +0000Neil RobertsonThere's No End to It -- Matlab Code Plots Frequency Response above the Unit Circle
https://www.dsprelated.com/showarticle/1102.php

post I presented Matlab code to synthesize multiplierless FIR filters using Canonic Signed Digit (CSD) coefficients. I included a function dec2csd1.m (repeated here in Appendix A) to convert decimal integers to binary CSD values. Here I want to use that function to illustrate a few properties of CSD numbers.

In a binary signed-digit number system, we allow...]]>
Sat, 18 Feb 2017 16:23:36 +0000Neil RobertsonMatlab Code to Synthesize Multiplierless FIR Filters
https://www.dsprelated.com/showarticle/1011.php
This article presents Matlab code to synthesize multiplierless Finite Impulse Response (FIR) lowpass filters.

A filter coefficient can be represented as a sum of powers of 2. For example, if a coefficient = decimal 5 multiplies input x, the output is $y= 2^2*x + 2^0*x$. The factor of $2^2$ is then implemented with a shift of 2 bits. This method is not efficient for...]]>
Mon, 31 Oct 2016 16:54:27 +0000Neil RobertsonThe Power Spectrum
https://www.dsprelated.com/showarticle/1004.php
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...]]>Sat, 08 Oct 2016 21:47:09 +0000Neil RobertsonDigital PLL's -- Part 2
https://www.dsprelated.com/showarticle/973.php
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...]]>
Wed, 15 Jun 2016 11:18:41 +0000Neil RobertsonDigital PLL's -- Part 1
https://www.dsprelated.com/showarticle/967.php
Figure 1.1 is a block diagram of a digital PLL (DPLL). The purpose of the DPLL is to lock the phase of a numerically controlled oscillator (NCO) to a reference signal. The loop includes a phase detector to compute phase error and a loop filter to set loop dynamic performance. The output of the loop filter controls the frequency and phase of the NCO,...]]>Tue, 07 Jun 2016 14:34:38 +0000Neil RobertsonDecimator Image Response
https://www.dsprelated.com/showarticle/965.php
Note: this is an improved version of a post I made to the dsp forum a few weeks ago.

This article presents a way to compute and plot the image response of a decimator. I’m defining the image response as the unwanted spectrum of the impulse response after downsampling, relative to the desired passband response.

Consider a decimate-by-4 filter with fs= 4 Hz, to...]]>
Tue, 24 May 2016 13:56:24 +0000Neil RobertsonPeak to Average Power Ratio and CCDF
https://www.dsprelated.com/showarticle/962.php
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...]]>
Tue, 17 May 2016 18:55:24 +0000Neil RobertsonFilter a Rectangular Pulse with no Ringing
https://www.dsprelated.com/showarticle/956.php
To filter a rectangular pulse without any ringing, there is only one requirement on the filter coefficients: they must all be positive. However, if we want the leading and trailing edge of the pulse to be symmetrical, then the coefficients must be symmetrical. What we are describing is basically a window function.

Consider a rectangular pulse 32 samples long with fs ...]]>
Thu, 12 May 2016 13:53:11 +0000Neil Robertson