Matlab Code to Synthesize Multiplierless FIR Filters
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 coefficients having a lot of 1’s, e.g. decimal 31 = 11111. To reduce the number of non-zero...
Wavelets II - Vanishing Moments and Spectral Factorization
In the previous blog post I described the workings of the Fast Wavelet Transform (FWT) and how wavelets and filters are related. As promised, in this article we will see how to construct useful filters. Concretely, we will find a way to calculate the Daubechies filters, named after Ingrid Daubechies, who invented them and also laid much of the mathematical foundations for wavelet analysis.
Besides the content of the last post, you should be familiar with basic complex algebra, the...
Fibonacci trick
I'm working on a video, tying the Fibonacci sequence into the general subject of difference equations.
Here's a fun trick: take any two consecutive numbers in the Fibonacci sequence, say 34 and 55. Now negate one and use them as the seed for the Fibonacci sequence, larger magnitude first, i.e.
$-55, 34, \cdots$
Carry it out, and you'll eventually get the Fibonacci sequence, or it's negative:
$-55, 34, -21, 13, -8, 5, -3, 2, -1, 1, 0, 1, 1 \cdots$
This is NOT a general property of difference...
The Power Spectrum
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...
New Comments System (please help me test it)
I thought it would take me a day or two to implement, it took almost two weeks...
But here it is, the new comments systems for blogs, heavily inspired by the forum system I developed earlier this year.
Which means that:
- You can easily add images, either by drag and drop or through the 'Insert Image' button
- You can add MathML, TeX and ASCIImath equations and they will be rendered with Mathjax
- You can add code snippets and they will be highlighted with highlights.js
- You can edit...
Wavelets I - From Filter Banks to the Dilation Equation
This is the first in what I hope will be a series of posts about wavelets, particularly about the Fast Wavelet Transform (FWT). The FWT is extremely useful in practice and also very interesting from a theoretical point of view. Of course there are already plenty of resources, but I found them tending to be either simple implementation guides that do not touch on the many interesting and sometimes crucial connections. Or they are highly mathematical and definition-heavy, for a...
The Real Star of Star Trek
Unless you've been living under a rock recently, you're probably aware that this month is the 50-year anniversary of the original Star Trek show on American television. It's an anniversary worth noting, as did Time and Newsweek magazines with their special editions.
Over the years I've come to realize that a major star of the original Star Trek series wasn't an actor. It was a thing. The starship USS Enterprise! Before I explain my thinking, here's a little...
An s-Plane to z-Plane Mapping Example
While surfing around the Internet recently I encountered the 's-plane to z-plane mapping' diagram shown in Figure 1. At first I thought the diagram was neat because it's a good example of the old English idiom: "A picture is worth a thousand words." However, as I continued to look at Figure 1 I began to detect what I believe are errors in the diagram.
Reader, please take a few moments to see if you detect any errors in Figure 1.
...Should DSP Undergraduate Students Study z-Transform Regions of Convergence?
Not long ago I presented my 3-day DSP class to a group of engineers at Tektronix Inc. in Beaverton Oregon [1]. After I finished covering my material on IIR filters' z-plane pole locations and filter stability, one of the Tektronix engineers asked a question similar to:
"I noticed that you didn't discuss z-plane regions of convergence here. In my undergraduate DSP class we spent a lot of classroom and homework time on the ...
Implementing Impractical Digital Filters
This blog discusses a problematic situation that can arise when we try to implement certain digital filters. Occasionally in the literature of DSP we encounter impractical digital IIR filter block diagrams, and by impractical I mean block diagrams that cannot be implemented. This blog gives examples of impractical digital IIR filters and what can be done to make them practical.
Implementing an Impractical Filter: Example 1
Reference [1] presented the digital IIR bandpass filter...
How Discrete Signal Interpolation Improves D/A Conversion
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 dsprelated.com. Here's what I wrote:
We encounter the process of digital-to-analog...
Feedback Controllers - Making Hardware with Firmware. Part 3. Sampled Data Aspects
Some Design and Simulation Considerations for Sampled-Data ControllersThis article will continue to look at some aspects of the controllers and electronics needed to create emulated physical circuits with real-world connectivity and will look at the issues that arise in sampled-data controllers compared to continuous-domain controllers. As such, is not intended as an introduction to sampled-data systems.
- Part 1: Introduction
A Differentiator With a Difference
Some time ago I was studying various digital differentiating networks, i.e., networks that approximate the process of taking the derivative of a discrete time-domain sequence. By "studying" I mean that I was experimenting with various differentiating filter coefficients, and I discovered a computationally-efficient digital differentiator. A differentiator that, for low fequency signals, has the power of George Foreman's right hand! Before I describe this differentiator, let's review a few...
Feedback Controllers - Making Hardware with Firmware. Part I. Introduction
Introduction to the topicThis is the 1st in a series of articles looking at how we can use DSP and Feedback Control Sciences along with some mixed-signal electronics and number-crunching capability (e.g. FPGA), to create arbitrary (within reason) Electrical/Electronic Circuits with real-world connectivity. Of equal importance will be the evaluation of the functionality and performance of a practical design made from modestly-priced state of the art devices.
- Part 1:
Computing Translated Frequencies in Digitizing and Downsampling Analog Bandpass Signals
In digital signal processing (DSP) we're all familiar with the processes of bandpass sampling an analog bandpass signal and downsampling a digital bandpass signal. The overall spectral behavior of those operations are well-documented. However, mathematical expressions for computing the translated frequency of individual spectral components, after bandpass sampling or downsampling, are not available in the standard DSP textbooks. The following three sections explain how to compute the...
Pentagon Construction Using Complex Numbers
A method for constructing a pentagon using a straight edge and a compass is deduced from the complex values of the Fifth Roots of Unity. Analytic values for the points are also derived.
Simple Discrete-Time Modeling of Lossy LC Filters
There are many software applications that allow modeling LC filters in the frequency domain. But sometimes it is useful to have a time domain model, such as when you need to analyze a mixed analog and DSP system. For example, the system in Figure 1 includes an LC filter as well as a DSP portion. The LC filter could be an anti-alias filter, a channel filter, or some other LC network. For a design using undersampling, the filter would be bandpass [1]. By modeling...
Some Thoughts on Sampling
Some time ago, I came across an interesting problem. In the explanation of sampling process, a representation of impulse sampling shown in Figure 1 below is illustrated in almost every textbook on DSP and communications. The question is: how is it possible that during sampling, the frequency axis gets scaled by $1/T_s$ -- a very large number? For an ADC operating at 10 MHz for example, the amplitude of the desired spectrum and spectral replicas is $10^7$! I thought that there must be...
Coefficients of Cascaded Discrete-Time Systems
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 portion [1].
This article is available in PDF format for...
Waveforms that are their own Fourier Transform
Mea Culpa
There are many scary things about writing a technical book. Can I make the concepts clear? It is worth the effort? Will it sell? But all of these pale compared to the biggest fear: What if I'm just plain wrong? Not being able to help someone is one thing, but leading them astray is far worse.
My book on DSP has now been published for almost ten years. I've found lots of typos, a few misstatements, and many places where the explanations confuse even me. But I have been lucky;...
Premium Forum?
Chances are that by now, you have had a chance to browse the new design of the *related site that I published several weeks ago. I have been working for several months on this and I must admit that I am very happy with the results. This new design will serve as a base for many new exciting developments. I would love to hear your comments/suggestions if you have any, please use the comments system at the bottom of this page.
First on my list would be to build and launch a new forum...
Harmonic Notch Filter
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...
Specifying the Maximum Amplifier Noise When Driving an ADC
I recently learned an interesting rule of thumb regarding the use of an amplifier to drive the input of an analog to digital converter (ADC). The rule of thumb describes how to specify the maximum allowable noise power of the amplifier [1].
The Problem Here's the situation for an ADC whose maximum analog input voltage range is –VRef to +VRef. If we drive an ADC's analog input with an sine wave whose peak amplitude is VP = VRef, the ADC's output signal to noise ratio is maximized. We'll...
Going back to Germany!
A couple of blog posts ago, I wrote that the decision to go to ESC Boston ended up being a great one for many different reasons. I came back from the conference energized and really happy that I went.
These feelings were amplified a few days after my return when I received an email from Rolf Segger, the founder of SEGGER Microcontroller (check out their very new website), asking if I would be interested in visiting their headquarters...
60-Hz Noise and Baseline Drift Reduction in ECG Signal Processing
Electrocardiogram (ECG) signals are obtained by monitoring the electrical activity of the human heart for medical diagnostic purposes [1]. This blog describes a very efficient digital filter used to reduce both 60 Hz AC power line noise and unwanted signal baseline drift that often contaminate ECG signals.
PDF_HERE
We'll first describe the ECG noise reduction filter and then examine the filter's performance in a real-world ECG signal filtering example.Proposed ECG Noise Reduction Digital...
The 2021 DSP Online Conference
The 2021 DSP Online Conference is just around the corner and this year again, the program is packed with opportunities for DSP engineers to refresh their DSP skills and learn a few new tricks along the way.
By registering for the conference, not only will you have full access to all talks, workshops, and Q&A sessions at this year's event, but you'll also gain instant access to all talks from last year's...
Complex Down-Conversion Amplitude Loss
This blog illustrates the signal amplitude loss inherent in a traditional complex down-conversion system. (In the literature of signal processing, complex down-conversion is also called "quadrature demodulation.")
The general idea behind complex down-conversion is shown in Figure 1(a). And the traditional hardware block diagram of a complex down-converter is shown in Figure 1(b).
Let's assume the input to our down-conversion system is an analog radio frequency (RF) signal,...
Adaptive Beamforming is like Squeezing a Water Balloon
Adaptive beamforming was first developed in the 1960s for radar and sonar applications. The main idea is that signals can be captured using multiple sensors and the sensor outputs can be combined to enhance the signals propagating from specific directions and attenuate (null out) signals from other directions. It has grown immensely in recent years as processors have become faster and cheaper. Today, adaptive beamforming applications include smart speakers (like the Amazon Echo),...
Simple Concepts Explained: Fixed-Point
IntroductionMost signal processing intensive applications on FPGA are still implemented relying on integer or fixed-point arithmetic. It is not easy to find the key ideas on quantization, fixed-point and integer arithmetic. In a series of articles, I aim to clarify some concepts and add examples on how things are done in real life. The ideas covered are the result of my professional experience and hands-on projects.
In this article I will present the most fundamental question you...
Who else is going to Sensors Expo in San Jose? Looking for roommate(s)!
This will be my first time attending this show and I must say that I am excited. I am bringing with me my cameras and other video equipment with the intention to capture as much footage as possible and produce a (hopefully) fun to watch 'highlights' video. I will also try to film as many demos as possible and share them with you.
I enjoy going to shows like this one as it gives me the opportunity to get out of my home-office (from where I manage and run the *Related sites) and actually...