Data Types for Control & DSP

Tim Wescott April 27, 20166 comments

There's a lot of information out there on what data types to use for digital signal processing, but there's also a lot of confusion, so the topic bears repeating.

I recently posted an entry on PID control. In that article I glossed over the data types used by showing "double" in all of my example code.  Numerically, this should work for most control problems, but it can be an extravagant use of processor resources.  There ought to be a better way to determine what precision you need...

PID Without a PhD

Tim Wescott April 26, 201611 comments

I both consult and teach in the area of digital control. Through both of these efforts, I have found that while there certainly are control problems that require all the expertise I can bring to bear, there are a great number of control problems that can be solved with the most basic knowledge of simple controllers, without resort to any formal control theory at all.

This article will tell you how to implement a simple controller in software and how to tune it without getting into heavy...

Digital Envelope Detection: The Good, the Bad, and the Ugly

Rick Lyons April 3, 20168 comments

Recently I've been thinking about the process of envelope detection. Tutorial information on this topic is readily available but that information is spread out over a number of DSP textbooks and many Internet web sites. The purpose of this blog is to summarize various digital envelope detection methods in one place.

Here I focus on envelope detection as it is applied to an amplitude-fluctuating sinusoidal signal where the positive-amplitude fluctuations (the sinusoid's envelope)...

Harmonic Notch Filter

Mike March 28, 201614 comments

My basement is covered with power lines and florescent lights which makes collecting ECG and EEG data  rather difficult due to the 60 cycle hum.  I found the following notch filter to work very well at eliminating the background signal without effecting the highly amplified signals I was looking for. 

The notch filter is based on the a transfer function with the form $$H(z)=\frac{1}{2}(1+A(z))$$ where A(z) is an all pass filter. The original paper [1] describes a method to...

A Useful Source of Signal Processing Information

Rick Lyons March 23, 20168 comments

I just discovered a useful web-based source of signal processing information that was new to me. I thought I'd share what I learned with the subscribers here on

The Home page of the web site that I found doesn't look at all like it would be useful to us DSP fanatics. But if you enter some signal processing topic of interest, say, "FM demodulation" (without the quotation marks) into the 'Search' box at the top of the web page

and click the red 'SEARCH...

3 Good News

Stephane Boucher March 9, 20161 comment
Good News #1

Last week, I announced a new and ambitious reward program that will be funded by the new Vendors Directory.

This week, I am happy to announce that we have our firsts two sponsors!  Quantum Leaps & Abelon Systems have agreed to pay the sponsorship fee to be listed in the new Vendors Directory.  Because of their support, there is now some money in the reward pool ($1,000) and enough to pay for the firsts 500 'beers' awarded.  Please...

Padé Delay is Okay Today

Jason Sachs March 1, 20164 comments

This article is going to be somewhat different in that I’m not really writing it for the typical embedded systems engineer. Rather it’s kind of a specialized topic, so don’t be surprised if you get bored and move on to something else. That’s fine by me.

Anyway, let’s just jump ahead to the punchline. Here’s a numerical simulation of a step response to a \( p=126, q=130 \) Padé approximation of a time delay:

Impressed? Maybe you should be. This...

Go Big or Go Home - Generating $500,000 for Contributors

Stephane Boucher February 18, 20168 comments
In a Nutshell
  • A new Vendors Directory has been created
  • Vendors will be invited to pay a sponsorship fee to be listed in the directory
  • 100% of the basic sponsorship fee will be distributed to the *Related Sites community through a novel reward system
  • The goal is for the directory to eventually generate - drum roll please -  $500,000 on a yearly basis for contributing members on the *Related Sites
  • Members will choose how the reward money gets distributed between...

The New Forum is LIVE!

Stephane Boucher February 18, 20161 comment

After months of hard word, I am very excited to introduce to you the new forum interface.  

Here are the key features:

1- Easily add images to a post by drag & dropping the images in the editor

2- Easily attach files to a post by drag & dropping the files in the editor

3- Add latex equations to a post and they will be rendered with Mathjax (tutorial)

4- Add a code snippet and surround the code with

Autocorrelation and the case of the missing fundamental

Allen January 21, 201610 comments

[UPDATED January 25, 2016:  One of the examples was broken, also the IPython notebook links now point to nbviewer, where you can hear the examples.]

For sounds with simple harmonic structure, the pitch we perceive is usually the fundamental frequency, even if it is not dominant.  For example, here's the spectrum of a half-second recording of a saxophone.

The first three peaks are at 464, 928, and 1392 Hz.  The pitch we perceive is the fundamental, 464 Hz, which is close to...

Curse you, iPython Notebook!

Christopher Felton May 2, 20124 comments


First, I think ipython is great. I use it daily and always have an ipython terminal open.  But just recently, I was showing off the ipython 0.12 notebook and in the process created a lengthy example while demonstrating the cool features of the ipython notebook.  The example included LaTeX equations, plots, etc.  Since the notebook session was on something of relevance I decided to clean up the session and use it for the beginning of a report.

Four Ways to Compute an Inverse FFT Using the Forward FFT Algorithm

Rick Lyons July 7, 20151 comment

If you need to compute inverse fast Fourier transforms (inverse FFTs) but you only have forward FFT software (or forward FFT FPGA cores) available to you, below are four ways to solve your problem.

Preliminaries To define what we're thinking about here, an N-point forward FFT and an N-point inverse FFT are described by:

$$ Forward \ FFT \rightarrow X(m) = \sum_{n=0}^{N-1} x(n)e^{-j2\pi nm/N} \tag{1} $$ $$ Inverse \ FFT \rightarrow x(n) = {1 \over N} \sum_{m=0}^{N-1}...

Signal Processing Contest in Python (PREVIEW): The Worst Encoder in the World

Jason Sachs September 7, 20136 comments

When I posted an article on estimating velocity from a position encoder, I got a number of responses. A few of them were of the form "Well, it's an interesting article, but at slow speeds why can't you just take the time between the encoder edges, and then...." My point was that there are lots of people out there which take this approach, and don't take into account that the time between encoder edges varies due to manufacturing errors in the encoder. For some reason this is a hard concept...

Noise shaping

Markus Nentwig December 9, 2012

Keywords: Quantization noise; noise shaping

A brief introduction to noise shaping, with firm resolve not to miss the forest for the trees. We may still stumble over some assorted roots. Matlab example code is included.


Fig. 1 shows a digital signal that is reduced to a lower bit width, for example a 16 bit signal being sent to a 12 bit digital-to-analog converter. Rounding to the nearest output value is obviously the best that can be done to minimize the error of each...

Understanding and Preventing Overflow (I Had Too Much to Add Last Night)

Jason Sachs December 4, 2013

Happy Thanksgiving! Maybe the memory of eating too much turkey is fresh in your mind. If so, this would be a good time to talk about overflow.

In the world of floating-point arithmetic, overflow is possible but not particularly common. You can get it when numbers become too large; IEEE double-precision floating-point numbers support a range of just under 21024, and if you go beyond that you have problems:

for k in [10, 100, 1000, 1020, 1023, 1023.9, 1023.9999, 1024]: try: ...

Recruiting New Bloggers!

Stephane Boucher October 16, 20157 comments

Previous calls for bloggers have been very successful in recruiting some great communicators - Rick LyonsJason Sachs, Victor Yurkovsky, Mike Silva, Markus NentwigGene BrenimanStephen Friederichs,

How Discrete Signal Interpolation Improves D/A Conversion

Rick Lyons May 28, 20121 comment
This blog post is also available in pdf format. Download here.

Earlier this year, for the Linear Audio magazine, published in the Netherlands whose subscribers are technically-skilled hi-fi audio enthusiasts, I wrote an article on the fundamentals of interpolation as it's used to improve the performance of analog-to-digital conversion. Perhaps that article will be of some value to the subscribers of Here's what I wrote:

We encounter the process of digital-to-analog...

The History of CIC Filters: The Untold Story

Rick Lyons February 20, 20124 comments

If you have ever studied or designed a cascaded integrator-comb (CIC) lowpass filter then surely you've read Eugene Hogenauer's seminal 1981 IEEE paper where he first introduced the CIC filter to the signal processing world [1]. As it turns out, Hogenauer's famous paper was not the first formal document describing and proposing CIC filters. Here's the story.

In the Fall of 1979 Eugene Hogenauer was finalizing his development of the CIC filter, the filter now used in so many multirate signal...

Instantaneous Frequency Measurement

Parth Vakil February 5, 200820 comments

I would like to talk about the oft used method of measuring the carrier frequency in the world of Signal Collection and Characterization world. It is an elegant technique because of its simplicity. But, of course, with simplicity, there come drawbacks (sometimes...especially with this one!).

In the world of Radar detection and characterization, one of the key characteristics of interest is the carrier frequency of the signal. If the radar is pulsed, you will have a very wide bandwidth, a...

Python scipy.signal IIR Filter Design Cont.

Christopher Felton June 19, 20127 comments

In the previous post the Python scipy.signal iirdesign function was disected.  We reviewed the basics of filter specification and reviewed how to use the iirdesign function to design IIR filters.  The previous post I only demonstrated low pass filter designs.  The following are examples how to use the iirdesign function for highpass, bandpass, and stopband filters designs.

Highpass Filter

The following is a highpass filter design for the different filter...