## Implementing a full-duplex UART using the TMS320VC33 serial port

Although the TMS320VC33 serial port was designed to be used as a synchronous port, it can also be used as an asynchronous port under software control. This post describes the hardware and software needed to use a TMS320VC33 serial port as a full-duplex UART port. A schematic diagram and a lengthy code listing are provided to illustrate the solution. This note discusses the implementation of an interrupt-driven, full-duplex, asynchronous serial interface, 9600-baud UART with 8 data bits, 1...

## "Neat" Rectangular to Polar Conversion Algorithm

The subject of finding algorithms that estimate the magnitude of a complex number, without having to perform one of those pesky square root operations, has been discussed many times in the past on the comp.dsp newsgroup. That is, given the complex number R + jI in rectangular notation, we want to estimate the magnitude of that number represented by M as:

On August 25th, 2009, Jerry (Mr. Wizard) Avins posted an interesting message on this subject to the comp.dsp newsgroup (Subject: "Re:

## Improved Narrowband Lowpass IIR Filters

November 6, 20101 comment

Here's a neat IIR filter trick. It's excerpted from the "DSP Tricks" chapter of the new 3rd edition of my book "Understanding Digital Signal Processing". Perhaps this trick will be of some value to the subscribers of dsprelated.com.

Due to their resistance to quantized-coefficient errors, traditional 2nd-order infinite impulse response (IIR) filters are the fundamental building blocks in computationally-efficient high-order IIR digital filter implementations. However, when used in...

## Least-squares magic bullets? The Moore-Penrose Pseudoinverse

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

## Computing FFT Twiddle Factors

Some days ago I read a post on the comp.dsp newsgroup and, if I understood the poster's words, it seemed that the poster would benefit from knowing how to compute the twiddle factors of a radix-2 fast Fourier transform (FFT).

Then, later it occurred to me that it might be useful for this blog's readers to be aware of algorithms for computing FFT twiddle factors. So,... what follows are two algorithms showing how to compute the individual twiddle factors of an N-point decimation-in-frequency...

## Hidden Linear Algebra in DSP

Linear algebra (LA) is usually thought of as a blunt theoretical subject. However, LA is found hidden in many DSP algorithms used widely in practice.

An obvious clue in finding LA in DSP is the linearity assumption used in theoretical analysis of systems for modelling or design. A standard modelling example for this case would be linear time invariant (LTI) systems. LTI are usually used to model flat wireless communication channels. LTI systems are also used in the design of digital filter...

## Computing an FFT of Complex-Valued Data Using a Real-Only FFT Algorithm

Someone recently asked me if I knew of a way to compute a fast Fourier transform (FFT) of complex-valued input samples using an FFT algorithm that accepts only real-valued input data. Knowing of no way to do this, I rifled through my library of hardcopy FFT articles looking for help. I found nothing useful that could be applied to this problem.

After some thinking, I believe I have a solution to this problem. Here is my idea:

Let's say our original input data is the complex-valued sequence...

## Unit Testing for Embedded Algorithms

December 21, 2009

Happy Holidays! For my premier article, I am writing about my favorite technique to use when designing and developing software- unit testing. Unit testing is a best practice when designing software. It allows the designer to verify the behavior of the software units before the entire system is complete, and it facilitates the change and growth of the software system because the developer can verify that the changes will not affect the behavior of other parts of the system. I have used...

## Using Mason's Rule to Analyze DSP Networks

There have been times when I wanted to determine the z-domain transfer function of some discrete network, but my algebra skills failed me. Some time ago I learned Mason's Rule, which helped me solve my problems. If you're willing to learn the steps in using Mason's Rule, it has the power of George Foreman's right hand in solving network analysis problems.

This blog discusses a valuable analysis method (well known to our analog control system engineering brethren) to obtain the z-domain...

## The Nature of Circles

What do you mean?

When calculating the mean of a list of numbers, the obvious approach is to sum them and divide by how many there are.

Suppose I give you a list of two numbers:

• 0
• 359

What is their mean? The obvious answer is 179.5.

If I told you that the numbers were compass bearings in degrees, what would your answer be then? Does 179.5 seem correct?

In the case of compass bearings, 0 is the same direction as 360. When talking about angles in the DSP world, we often talk about...

## Multimedia Processing with FFMPEG

November 16, 2015

FFMPEG is a set of libraries and a command line tool for encoding and decoding audio and video in many different formats. It is a free software project for manipulating/processing multimedia data. Many open source media players are based on FFMPEG libraries.

FFMPEG is developed under Linux but it can be compiled under most operating systems including Mac OS, Microsoft Windows. For more details about FFMPEG please refer

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

## Computing Translated Frequencies in Digitizing and Downsampling Analog Bandpass Signals

October 31, 20131 comment

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

## A Remarkable Bit of DFT Trivia

I recently noticed a rather peculiar example of discrete Fourier transform (DFT) trivia; an unexpected coincidence regarding the scalloping loss of the DFT. Here's the story.

DFT SCALLOPING LOSS As you know, if we perform an N-point DFT on N real-valued time-domain samples of a discrete sine wave, whose frequency is an integer multiple of fs/N (fs is the sample rate in Hz), the peak magnitude of the sine wave's positive-frequency spectral component will be

where A is the peak amplitude...

## "Neat" Rectangular to Polar Conversion Algorithm

The subject of finding algorithms that estimate the magnitude of a complex number, without having to perform one of those pesky square root operations, has been discussed many times in the past on the comp.dsp newsgroup. That is, given the complex number R + jI in rectangular notation, we want to estimate the magnitude of that number represented by M as:

On August 25th, 2009, Jerry (Mr. Wizard) Avins posted an interesting message on this subject to the comp.dsp newsgroup (Subject: "Re:

## A brief look at multipath radio channels

Radio channels, their effects on communications links and how to model them are a popular topic on comp.dsp. Unfortunately, for many of us there is little or no opportunity to get any "hands-on" experience with radio-related issues, because the required RF measurement equipment is not that easily available.

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

## Instant CIC

Summary:

A floating point model for a CIC decimator, including the frequency response.

Description:

A CIC filter relies on a peculiarity of its fixed-point implementation: Normal operation involves repeated internal overflows that have no effect to the output signal, as they cancel in the following stage.

One way to put it intuitively is that only the speed (and rate of change) of every little "wheel" in the clockworks carries information, but its absolute position is...

## Computing an FFT of Complex-Valued Data Using a Real-Only FFT Algorithm

Someone recently asked me if I knew of a way to compute a fast Fourier transform (FFT) of complex-valued input samples using an FFT algorithm that accepts only real-valued input data. Knowing of no way to do this, I rifled through my library of hardcopy FFT articles looking for help. I found nothing useful that could be applied to this problem.

After some thinking, I believe I have a solution to this problem. Here is my idea:

Let's say our original input data is the complex-valued sequence...