DSPRelated.com

The DFT Magnitude of a Real-valued Cosine Sequence

Rick LyonsRick Lyons June 17, 201410 comments

Rick Lyons proves a simple but often-missing result: the N-point DFT peak magnitude of a real cosine with an integer number of cycles equals A·N/2. He uses Euler's formula and geometric-series summation, shows a neat shortcut that avoids l'Hôpital's rule, and connects the math to practical fixed-point FFT sizing and overflow prevention on two's-complement hardware. The post also notes conjugate symmetry and the same result for sine inputs.


Specifying the Maximum Amplifier Noise When Driving an ADC

Rick LyonsRick Lyons June 9, 20148 comments

You can quantify how much amplifier noise is acceptable before adding gain actually hurts an ADC's output SNR. Rick Lyons presents a compact rule showing the amplifier input-referred noise power must be less than (1 - 1/α^2) times the ADC's q^2/12 quantization noise power, with Eq. (8) and a pair of figures that make it easy to pick or specify the right amplifier for a given gain α.


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.


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.


Goertzel Algorithm for a Non-integer Frequency Index

Rick LyonsRick Lyons October 7, 201325 comments

Rick Lyons demonstrates how to run the Goertzel algorithm with a non-integer frequency index k, letting you target DTFT frequencies that do not align with DFT bin centers. He interprets Rajmic and Sysel's generalization, provides a simple implementation, and presents a real-valued reformulation that reduces the final multiplies for real inputs. Example Matlab code is included to reproduce and adapt the technique.


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

Rick LyonsRick Lyons September 16, 20136 comments

A viral YouTube video claimed that saying j equals the square root of negative one is wrong. Rick Lyons shows the apparent paradox comes from misusing square-root identities with negative arguments, not from the usual definition of j. He argues it is safer to define j by j^2 = -1 and illustrates how careless root operations produce contradictions in two appendices.


A Table of Digital Frequency Notation

Rick LyonsRick Lyons August 5, 2013

Rick Lyons compiles a compact, practical table that untangles the many algebraic frequency notations used in DSP. The reference lines up continuous and discrete sinusoid forms, shows the frequency variable names and units, and lists valid ranges and conversions like Ω = 2πf and normalized forms with fs. A printable PDF of the table is available for easy desk reference.


A Quadrature Signals Tutorial: Complex, But Not Complicated

Rick LyonsRick Lyons April 12, 201366 comments

Quadrature signals are essential in modern communications, yet complex numbers and the j operator intimidate many engineers. In this tutorial Rick Lyons uses phasor geometry, three-dimensional time and frequency plots, and practical I/Q sampling examples to demystify complex exponentials, negative frequency, and how to generate baseband complex signals. Read to get physical intuition and hands-on rules you can apply to modulation, demodulation, and DSP implementations.


Beat Notes: An Interesting Observation

Rick LyonsRick Lyons March 13, 20137 comments

Rick Lyons overturns a common intuition about beat notes, showing that adding two nearby audio tones yields an average-frequency tone whose amplitude fluctuates, rather than a separate low-frequency sinusoid. He contrasts multiplication and summation of sines, provides simple trigonometric insight, and includes Matlab audio demos to explain why aircraft engine "whump" sounds are amplitude fluctuations of the average engine frequency.


Using the DFT as a Filter: Correcting a Misconception

Rick LyonsRick Lyons February 18, 201316 comments

Some sources claim the DFT, when used as a filter, shifts spectral energy down to DC. Rick Lyons shows that this is not true for consecutive DFT-bin outputs and explains the cause of the confusion: the FIR interpretation requires reversing the usual twiddle-factor order. He derives the DFT-bin frequency response, shows the bandpass center at 2πm/N, and explains when decimation does produce a translation to zero Hz.


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.


Somewhat Off Topic: Deciphering Transistor Terminology

Rick LyonsRick Lyons May 28, 20194 comments

Rick Lyons unpacks a small linguistic mystery in electronics, revealing why the transistor's middle terminal is called the "base". He traces the name to the 1949 Bell Labs "semiconductor triode", where the device sat on a metal base plate described as a large-area low-resistance contact, and notes that later transistor sandwich designs kept the name for historical reasons. The post includes original references and a few trivia nuggets.


Two Easy Ways To Test Multistage CIC Decimation Filters

Rick LyonsRick Lyons May 22, 20182 comments

Rick Lyons shows that you can validate multistage CIC decimation filters with just two obvious tests, no elaborate spectral setup required. Apply a unit-sample impulse to check a combinatorial yout(1) value when D ≥ S, or feed an all-ones step to confirm an S-sample transient followed by a DS steady state; the Appendix ties both checks to Pascal's triangle and binomial math.


Computing Chebyshev Window Sequences

Rick LyonsRick Lyons January 8, 200811 comments

Rick Lyons gives a compact, practical recipe for building M-sample Chebyshev (Dolph) windows with user-set sidelobe levels, not just theory. The post walks through computing α and A(m), evaluating the Nth-degree Chebyshev polynomial, doing an inverse DFT, and the simple postprocessing needed to form a symmetric time-domain window. A worked 9-sample example and an implementation caveat for even-length windows make this immediately usable.


Multiplierless Exponential Averaging

Rick LyonsRick Lyons December 5, 200811 comments

Rick Lyons shows how to implement exponential averaging without multiplies by exploiting a rearranged leaky-integrator form and binary shifts. He demonstrates reducing the standard two-multiply averager to a single-multiply form, then eliminating the multiply entirely when the weighting α equals reciprocals or differences of reciprocals of powers of two. The post catalogs practical α choices for fixed-point filters and flags quantization as an open issue.


A Fast Guaranteed-Stable Sliding DFT Algorithm

Rick LyonsRick Lyons June 15, 202342 comments

Rick Lyons presents a compact, computationally efficient sliding DFT that computes a single N-point DFT bin output for each input sample in real time. The design replaces the traditional complex resonator with a 2nd-order real resonator and uses pole/zero cancellation to match the DFT bin response. Crucially, the resonator poles remain on the z-plane unit circle even with quantized coefficients, guaranteeing numerical stability.


A Brief Introduction To Romberg Integration

Rick LyonsRick Lyons January 16, 201911 comments

Romberg integration delivers dramatic accuracy gains for definite integrals by combining multiple trapezoidal approximations into a single highly accurate result. Rick Lyons demonstrates how just five samples can achieve 0.0038% error versus a trapezoidal rule needing 100 samples, and a 17-sample example hits 3.6×10−4% error. The post outlines the N-segment procedure, cost scaling, and links to MATLAB code.


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.


A Simpler Goertzel Algorithm

Rick LyonsRick Lyons February 4, 2021

Rick Lyons presents a streamlined Goertzel algorithm that simplifies computing a single DFT bin by removing the textbook method's extra shift and zero-input steps. The proposed network changes the numerator so you run the main stage N times then perform one final output stage, making the implementation cleaner and slightly cheaper computationally. Rick also points out that common textbook forms differ from Gerald Goertzel's 1958 original.


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.