DSPRelated.com

Constrained Integer Behavior

Christopher Felton May 26, 2014
The wheels go round and round, round and round ...

Integer arithmetic is ubiquitous in digital hardware implementations, it's prolific in the control and data-paths.  When using fixed width (constrained) integers, overflow and underflow is business as usual.

Building with Integers

The subtitle of this post mentions a wheel - before I get to the wheel I want to look at an example.  The recursive-windowed-averager (rwa, a.k.a moving average)...


DSP Related Math: Nice Animated GIFs

Stephane Boucher April 24, 20143 comments

I was browsing the ECE subreddit lately and found that some of the most popular posts over the last few months have been animated GIFs helping understand some mathematical concepts.  I thought there would be some value in aggregating the DSP related gifs on one page.  

The relationship between sin, cos, and right triangles: Constructing a square wave with infinite series (see this...

Signed serial-/parallel multiplication

Markus Nentwig February 16, 2014

Keywords: Binary signed multiplication implementation, RTL, Verilog, algorithm

Summary
  • A detailed discussion of bit-level trickstery in signed-signed multiplication
  • Algorithm based on Wikipedia example
  • Includes a Verilog implementation with parametrized bit width
Signed serial-/parallel multiplication

A straightforward method to multiply two binary numbers is to repeatedly shift the first argument a, and add to a register if the corresponding bit in the other argument b is set. The...


Finding the Best Optimum

Tim Wescott November 4, 2013

When I was in school learning electrical engineering I owned a large mental pot, full of simmering resentment against the curriculum as it was being taught.

It really started in my junior year, when we took Semiconductor Devices, or more accurately "how to build circuits using transistors". I had been seduced by the pure mathematics of sophomore EE courses, where all the circuit elements (resistors, capacitors, coils and -- oh the joy -- dependent sources) are ideally modeled, and the labs...


Is It True That j is Equal to the Square Root of -1 ?

Rick Lyons September 16, 20137 comments

A few days ago, on the YouTube.com web site, I watched an interesting video concerning complex numbers and the j operator. The video's author claimed that the statement "j is equal to the square root of negative one" is incorrect. What he said was:

He justified his claim by going through the following exercise, starting with:

Based on the algebraic identity:

the author rewrites Eq. (1) as:

If we assume

Eq. (3) can be rewritten...


Python scipy.signal IIR Filtering: An Example

Christopher Felton May 19, 2013
Introduction

In the last posts I reviewed how to use the Python scipy.signal package to design digital infinite impulse response (IIR) filters, specifically, using the iirdesign function (IIR design I and IIR design II ).  In this post I am going to conclude the IIR filter design review with an example.

Previous posts:


A Quadrature Signals Tutorial: Complex, But Not Complicated

Rick Lyons April 12, 201365 comments

Introduction Quadrature signals are based on the notion of complex numbers and perhaps no other topic causes more heartache for newcomers to DSP than these numbers and their strange terminology of j operator, complex, imaginary, real, and orthogonal. If you're a little unsure of the physical meaning of complex numbers and the j = √-1 operator, don't feel bad because you're in good company. Why even Karl Gauss, one the world's greatest mathematicians, called the j-operator the "shadow of...


FIR sideways (interpolator polyphase decomposition)

Markus Nentwig September 12, 20129 comments

An efficient implementation of a symmetric-FIR polyphase 1:3 interpolator that doesn't follow the usual tapped delay line-paradigm. The example exploits the impulse response symmetry and avoids four multiplications out of 10. keywords: symmetric polyphase FIR filter implementation ASIC Matlab / Octave implementation

Introduction

An interpolating FIR filter can be implemented with a single tapped delay line, possibly going forwards and backwards for a symmetric impulse response. To...


Design of an anti-aliasing filter for a DAC

Markus Nentwig August 18, 2012
Overview
  • Octaveforge / Matlab design script. Download: here
  • weighted numerical optimization of Laplace-domain transfer function
  • linear-phase design, optimizes vector error (magnitude and phase)
  • design process calculates and corrects group delay internally
  • includes sinc() response of the sample-and-hold stage in the ADC
  • optionally includes multiplierless FIR filter
Problem Figure 1: Typical FIR-DAC-analog lowpass line-up

Digital-to-analog conversion connects digital...


Understanding the 'Phasing Method' of Single Sideband Demodulation

Rick Lyons August 8, 201230 comments

There are four ways to demodulate a transmitted single sideband (SSB) signal. Those four methods are:

  • synchronous detection,
  • phasing method,
  • Weaver method, and
  • filtering method.

Here we review synchronous detection in preparation for explaining, in detail, how the phasing method works. This blog contains lots of preliminary information, so if you're already familiar with SSB signals you might want to scroll down to the 'SSB DEMODULATION BY SYNCHRONOUS DETECTION'...


Least-squares magic bullets? The Moore-Penrose Pseudoinverse

Markus Nentwig October 24, 20109 comments

Hello,

the topic of this brief article is a tool that can be applied to a variety of problems: The Moore-Penrose Pseudoinverse.While maybe not exactly a magic bullet, it gives us least-squares optimal solutions, and that is under many circumstances the best we can reasonably expect.

I'll demonstrate its use on a short example. More details can be found for example on Wikipedia, or the Matlab documentation...


There's No End to It -- Matlab Code Plots Frequency Response above the Unit Circle

Neil Robertson October 23, 20179 comments
Reference [1] has some 3D plots of frequency response magnitude above the unit circle in the Z-plane.  I liked them enough that I wrote a Matlab function to plot the response of any digital filter this way.  I’m not sure how useful these plots are, but they’re fun to look at. The Matlab code is listed in the Appendix. 

This post is available in PDF format for easy...


Compute Images/Aliases of CIC Interpolators/Decimators

Neil Robertson November 1, 20202 comments

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...


Approximating the area of a chirp by fitting a polynomial

Alexandre de Siqueira November 15, 20158 comments

Once in a while we need to estimate the area of a dataset in which we are interested. This area could give us, for example, force (mass vs acceleration) or electric power (electric current vs charge).


Polar Coding Notes: Channel Combining and Channel Splitting

Lyons Zhang October 19, 20181 comment

Channel Combining  

Channel combining is a step that combines copies of a given B-DMC $W$ in a recursive manner to produce a vector channel $W_N : {\cal X}^N \to {\cal Y}^N$, where $N$ can be any power of two, $N=2^n, n\le0^{[1]}$.  

The notation $u_1^N$ as shorthand for denoting a row vector $(u_1, \dots , u_N)$.  

The vector channel $W_N$ is the virtual channel between the input sequence $u_1^N$ to a linear encoder and the output sequence $y^N_1$ of $N$...


The Zeroing Sine Family of Window Functions

Cedron Dawg August 16, 20202 comments
Introduction

This is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by introducing a class of well behaved window functions that the author believes to be previously unrecognized. The definition and some characteristics are displayed. The heavy math will come in later articles. This is an introduction to the family, and a very special member of it.

This is one of my longer articles. The bulk of the material is in the front half. The...


Simulink-Simulation of SSB demodulation

Josef Hoffmann June 13, 20211 comment
≥≥≥ Simulink-Simulation of SSB demodulation or modulation from the article “Understanding the ‘Phasing Method’ of Single Sideband Demodulation” by Richard Lyons Josef Hoffmann

The article “Understanding the ‘Phasing Method’ of Single Sideband Demodulation” by Richard Lyons is a very good description of this topic. The block representation from the figures are clear and easy to understand. They are predestined for a simulation in Simulink. The simulation can help...


Filtering Noise: The Basics (Part 1)

Aditya Dua September 17, 2022
Introduction

Finding signals in the presence of noise is one of the fundamental quests of the discipline of signal processing. Noise is inherently random by nature, so a probability oriented approach is needed to develop a mathematical framework for filtering (i.e. removing/suppressing) noise. This framework or discipline, formally referred to as stochastic signal processing, is often taught in graduate level engineering programs and is covered from different perspectives in excellent...


Determination of the transfer function of passive networks with MATLAB Functions

Josef Hoffmann December 7, 20212 comments

With MATLAB functions, the transfer function of passive networks can be determined relatively easily. The method is explained using the example of a passive low-pass filter of the sixth order, which is shown in Fig.1

Fig.1 Passive low-pass filter of the sixth order

If one tried, as would be logical, to calculate the transfer function starting from the input, it would be quite complicated. On the other hand, if you start from the output, the determination of this function is simple...


DFT Bin Value Formulas for Pure Complex Tones

Cedron Dawg March 17, 2017
Introduction

This is an article to hopefully give a better understanding to the Discrete Fourier Transform (DFT) by deriving an analytical formula for the DFT of pure complex tones and an alternative variation. It is basically a parallel treatment to the real case given in DFT Bin Value Formulas for Pure Real Tones. In order to understand how a multiple tone signal acts in a DFT it is necessary to first understand how a single pure tone acts. Since a DFT is a linear transform, the...