DSPRelated.com

Instant CIC

Markus NentwigMarkus Nentwig May 8, 20124 comments

Modeling CIC decimators in floating point is simpler than you might think, Markus Nentwig shows, if you treat the filter as a finite FIR by sampling its impulse response. The post compares a naive float time-domain implementation, an FFT-based frequency-domain approach, and the recommended method of computing the impulse response and using an off-the-shelf FIR filter, with code and plots.


Accurate Measurement of a Sinusoid's Peak Amplitude Based on FFT Data

Rick LyonsRick Lyons December 14, 201112 comments

Measuring a sinewave's peak from FFT data can be severely biased by scalloping loss, producing errors up to 36.3 percent. Rick Lyons demonstrates how to apply a flat-top window via frequency-domain convolution to the FFT bins, cutting maximum amplitude error to about 0.02 dB compared with 3.9 dB for rectangular windows. The post includes Matlab code and practical caveats for reliable use.


Impulse Response Approximation

Christopher FeltonChristopher Felton August 5, 20113 comments

A stepped-triangular impulse approximation represents an FIR low-pass using a cascade of recursive running-sum filters, offering big savings in computation. Christopher Felton outlines the quantization step that maps a true impulse into three stepped-triangular types and shows how the approximation is built from recursive running-sum and sparse-sum blocks. Inspect the frequency tradeoffs and decide if the efficiency gain is worth the approximation error.


Multiplying Two Binary Numbers

Rick LyonsRick Lyons March 16, 20117 comments

Ancient math gives a modern trick for integer multiplication that uses only shifts, parity checks, and additions. Rick Lyons demonstrates the Russian peasant method, shows why it maps to binary right shifts and least-significant-bit tests, and supplies a MATLAB snippet to run the loop. The post also points out a practical tip: put the smaller operand in the halving register to reduce iterations.


Implementing a full-duplex UART using the TMS320VC33 serial port

Manuel HerreraManuel Herrera March 16, 20112 comments

You can convert the TMS320VC33's synchronous serial port into a full-duplex UART in software by using DR0/DX0, on-chip timers, and an external interrupt. Manuel Herrera walks through an interrupt-driven 9600 baud, 8N1 asynchronous receiver/transmitter, explains receiver gating by start bit detection, and includes a schematic plus a complete assembly listing with timer values tied to a 150 MHz clock. Adjust timing for different clock rates.


"Neat" Rectangular to Polar Conversion Algorithm

Rick LyonsRick Lyons November 15, 20105 comments

Rick Lyons revisits a clever slide-rule era trick for estimating the magnitude of a complex number without computing a square root. He highlights a neat identity, prompted by a Jerry Avins post, that converts the sqrt problem into forward and inverse trigonometric operations plus ratios. The post invites readers to derive Eq. (2) and see why a seemingly complex idea is actually simple and practical.


Improved Narrowband Lowpass IIR Filters

Rick LyonsRick Lyons November 6, 20101 comment

Rick Lyons presents a practical trick from his DSP book that makes narrowband lowpass IIR filters usable in fixed-point systems. By replacing unit delays with M-length delay lines to form an interpolated-IIR, pole radii and angles are transformed so desired poles fall into quantizer-friendly locations without wider coefficient words or extra multiplies. A following CIC image-reject stage removes replicated passbands to meet tight stopband specs.


Least-squares magic bullets? The Moore-Penrose Pseudoinverse

Markus NentwigMarkus Nentwig October 24, 20109 comments

Markus Nentwig walks through a practical way to remove power-line hum from measurements using the Moore-Penrose pseudoinverse. He builds a harmonic basis, computes pinv(basis) to get least-squares coefficients, and reconstructs and subtracts the hum, with a ready-to-run Matlab example. The post highlights limits and performance: basis-like signal components will be removed, and accuracy improves with the square root of sample count.


Computing FFT Twiddle Factors

Rick LyonsRick Lyons August 8, 201019 comments

Rick Lyons gives two compact algorithms to compute individual twiddle factors for radix-2 DIF and DIT FFTs, handy when you need only a subset of outputs such as in pruned FFTs. He explains stage indexing, provides closed-form formulas including the bit-reversal step for DIT, and walks through N=8 examples so you can implement the twiddle-angle calculations directly.


Hidden Linear Algebra in DSP

Sami AldalahmehSami Aldalahmeh June 17, 20105 comments

Linear algebra is hiding in plain sight inside many DSP techniques, not just abstract theory. By treating linear systems as matrix operators y = A x you reveal Toeplitz structure in LTI systems, connect to covariance matrices, and gain geometric intuition via eigenvalues and eigenvectors. This matrix viewpoint complements convolution-based thinking and offers practical tools for filter and channel analysis.


How Not to Reduce DFT Leakage

Rick LyonsRick Lyons May 23, 201211 comments

Rick Lyons debunks a proposed 'data-flipping' fix for DFT spectral leakage, demonstrating with MATLAB that it can produce higher sidelobes and a troubling mainlobe dip for some input frequencies. He explains that windowing's goal is to reduce amplitude discontinuities in a periodic extension, not merely to force end samples to zero, and concludes the method is frequency-dependent and not recommended.


Computing Translated Frequencies in Digitizing and Downsampling Analog Bandpass Signals

Rick LyonsRick Lyons October 31, 20131 comment

Textbooks rarely give ready formulas for tracking where individual spectral lines land after bandpass sampling or decimation. Rick Lyons provides three concise equations, with Matlab code, that compute translated frequencies for analog bandpass sampling, real digital downsampling, and complex downsampling. Practical examples show how to place the sampled image at fs/4 and how to translate a complex bandpass to baseband for efficient demodulation.


Multimedia Processing with FFMPEG

Karthick Kumaran A S VKarthick Kumaran A S V 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.


Harmonic Notch Filter

Mike Mike March 28, 201615 comments

A practical, DSP-friendly recipe for scrubbing 60 Hz power-line hum and its harmonics from noisy ECG and EEG recordings is presented, using IIR notch filters built from second-order all-pass sections. The post derives how to set all-pass phase to place notches and compute biquad coefficients by solving a simple 2x2 system, then shows C code and precomputed coefficients for cascading the first eight odd harmonics at a 2 kHz sample rate. Engineers get a compact, editable implementation with explicit control over notch bandwidth.


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

Rick LyonsRick Lyons February 9, 20103 comments

Rick Lyons shows a compact trick to get an N-point complex FFT using only real-input FFT routines by transforming the real and imaginary parts separately and recombining their outputs. The post presents a one-line recombination formula, Xc(m) = real[Xr(m)] - imag[Xi(m)] + j{imag[Xr(m)] + real[Xi(m)]}, and an algebraic derivation based on the two-real-in-one-complex FFT identity. Useful for systems that only provide real-only FFTs.


Resolving 'Can't initialize target CPU' on TI C6000 DSPs - Part 2

Mike DunnMike Dunn November 12, 20073 comments

Mike Dunn walks through practical, low-level debugging to fix "Can't initialize target CPU" on TI C6000 DSPs using CCS 3.3, focusing on XDS510-class emulators. He demonstrates how to run xdsprobe to perform JTAG resets, read and interpret adapter and port error messages, and run JTAG IR/DR integrity tests. The article shows example outputs and a simple scope-based trace to locate signal faults.


A Remarkable Bit of DFT Trivia

Rick LyonsRick Lyons December 26, 20133 comments

Rick Lyons highlights a surprising equality: the DFT's worst-case scalloping loss equals 2/π, the same probability that a toothpick crosses a floorboard seam in Buffon's needle problem when the toothpick equals board width. The post sketches the DFT bin-intersection derivation and connects the math to the classic probability puzzle, offering a playful insight that sharpens intuition about bin responses.


Hidden Linear Algebra in DSP

Sami AldalahmehSami Aldalahmeh June 17, 20105 comments

Linear algebra is hiding in plain sight inside many DSP techniques, not just abstract theory. By treating linear systems as matrix operators y = A x you reveal Toeplitz structure in LTI systems, connect to covariance matrices, and gain geometric intuition via eigenvalues and eigenvectors. This matrix viewpoint complements convolution-based thinking and offers practical tools for filter and channel analysis.


Impulse Response Approximation

Christopher FeltonChristopher Felton August 5, 20113 comments

A stepped-triangular impulse approximation represents an FIR low-pass using a cascade of recursive running-sum filters, offering big savings in computation. Christopher Felton outlines the quantization step that maps a true impulse into three stepped-triangular types and shows how the approximation is built from recursive running-sum and sparse-sum blocks. Inspect the frequency tradeoffs and decide if the efficiency gain is worth the approximation error.


A brief look at multipath radio channels

Markus NentwigMarkus Nentwig October 31, 20078 comments

Markus Nentwig walks through a hands-on RF experiment that makes multipath and fading visible using a network analyzer and simple dipole antennas. He shows how reflections produce frequency-domain notches when path differences equal half wavelengths, and how doubling distance increases free-space path loss by roughly 6 dB. The post explains why narrowband signals often see flat fading while wideband links become frequency-selective, motivating OFDM and multi-tap channel models.