EmbeddedRelated.com
The 2026 Embedded Online Conference

Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes

Jason SachsJason Sachs April 18, 2018

Last time we looked at some techniques using LFSR output for system identification, making use of the peculiar autocorrelation properties of pseudorandom bit sequences (PRBS) derived from an LFSR.

This time we’re going to jump back to the field of communications, to look at an invention called Gold codes and why a single maximum-length PRBS isn’t enough to save the world using spread-spectrum technology. We have to cover two little side discussions before we can get into Gold...


Linear Feedback Shift Registers for the Uninitiated, Part XIII: System Identification

Jason SachsJason Sachs March 12, 20181 comment

Jason Sachs shows how the output of a linear feedback shift register can be used for active system identification, not just spread-spectrum testing. The article compares traditional sine-wave probing with LFSR-based PRBS methods, demonstrates a worked Ra-Rb-C example, and unpacks practical issues such as reflected pseudonoise, ADC quantization, sample counts, and noise-shaping tricks to improve estimates.


Linear Feedback Shift Registers for the Uninitiated, Part XII: Spread-Spectrum Fundamentals

Jason SachsJason Sachs December 29, 20171 comment

Jason Sachs shows why LFSR-generated pseudonoise is a natural fit for direct-sequence spread spectrum, then walks through Fourier basics, spectral plots, and runnable Python examples. The article demonstrates how DSSS multiplies a UART bitstream with a chipping sequence to spread energy, how despreading concentrates the desired signal while scrambling narrowband interference, and how multiple transmitters can share bandwidth when using uncorrelated sequences.


Ten Little Algorithms, Part 6: Green’s Theorem and Swept-Area Detection

Jason SachsJason Sachs June 18, 20173 comments

Jason shows how Green's Theorem becomes a practical, low-cost method to detect real-time rotation from two orthogonal sensors by accumulating swept area. The post derives a compact discrete integrator S[n] = S[n-1] + (x[n]*(y[n]-y[n-1]) - y[n]*(x[n]-x[n-1]))/2, compares integer and floating implementations, and analyzes noise scaling and sampling rate tradeoffs. Includes Python demos and threshold guidance.


Round Round Get Around: Why Fixed-Point Right-Shifts Are Just Fine

Jason SachsJason Sachs November 22, 20163 comments

Jason Sachs explains why, in most embedded systems, simple bitwise right-shifts are an acceptable way to do fixed-point division rather than paying the runtime cost to round. He shows the cheap trick of adding 2^(N-1) to implement round-to-nearest, explains unbiased "round-to-even" issues, and compares arithmetic error to much larger ADC and sensor errors. The takeaway: save cycles unless your algorithm or inputs require extra precision.


Data Types for Control & DSP

Tim WescottTim Wescott April 26, 20166 comments

Control engineers often default to double precision, but Tim Wescott shows that choice can waste CPU cycles on embedded targets. He separates numeric representation into floating point, integer, and fixed-point, then walks through the tradeoffs, including quantization, overflow, and performance. A concrete PID example highlights why integrator precision and ADC scaling should drive your choice of data type rather than habit.


Ten Little Algorithms, Part 3: Welford's Method (and Friends)

Jason SachsJason Sachs May 10, 20156 comments

Jason Sachs takes a practical look at Welford's method, a numerically stable online algorithm for computing mean and sample variance without storing large batches. He demonstrates Python implementations, shows why the naive sum and sum-of-squares approach suffers catastrophic cancellation, and why Welford is a better fit for memory- and CPU-constrained embedded systems. Jason then turns Welford into simple filters for tracking time-varying noise and discusses heuristic fixes and tradeoffs.


Ten Little Algorithms, Part 2: The Single-Pole Low-Pass Filter

Jason SachsJason Sachs April 27, 201517 comments

Jason Sachs shows how a single-pole IIR low-pass filter, implementable in one line y += alpha * (x - y), tames noise in embedded signals without floating point. The post explains how to compute alpha from tau and delta-t, practical tradeoffs like phase lag and oversampling, and fixed-point pitfalls including how many extra state bits you need to avoid quantization. Short, practical, and code-ready.


Two Capacitors Are Better Than One

Jason SachsJason Sachs February 15, 20155 comments

Jason Sachs revisits a simple stacked RC trick that dramatically reduces DC error from capacitor insulation leakage in long time-constant filters. Splitting one RC into two stages forces most of the DC drop onto the lower capacitor, squaring the remaining error while changing the effective pole locations. The post walks through the math, practical component tradeoffs, and when to prefer a digital approach.


Second-Order Systems, Part I: Boing!!

Jason SachsJason Sachs October 29, 20142 comments

Jason Sachs takes the spring 'boing' of a doorstop into the math of second-order systems, using the series LRC circuit as a concrete example. He shows two standard transfer-function forms, explains why ωn only scales time while ζ sets the response shape, and derives pole locations plus an exact overshoot formula that helps tune embedded-system responses.


Tolerance Analysis

Jason SachsJason Sachs May 31, 2020

Jason Sachs walks through practical tolerance analysis by designing a 24V overvoltage detector from the ground up, combining resistor tolerances, temperature coefficients, reference and comparator errors, hysteresis, and dynamic RC behavior. He demonstrates worst-case stacking with real datasheet numbers, shows how solder and mechanical stress affect resistor choice, and sizes filtering so the comparator meets a microsecond-range trip requirement. The article is a hands-on guide full of worked examples and trade-offs for embedded hardware engineers.


Slew Rate Limiters: Nonlinear and Proud of It!

Jason SachsJason Sachs October 6, 2014

Slew-rate limits are a small nonlinear detail that often decides whether a controller behaves nicely or wrecks hardware. Jason Sachs walks through why slew limits appear in electronics and actuators, then shows two practical digital ways to impose limits: constraining input increments and constraining input around the output. He compares performance on underdamped second-order systems, gives closed-form intuition for overshoot, and demonstrates simulations with scipy and ODE solvers.


Second-Order Systems, Part I: Boing!!

Jason SachsJason Sachs October 29, 20142 comments

Jason Sachs takes the spring 'boing' of a doorstop into the math of second-order systems, using the series LRC circuit as a concrete example. He shows two standard transfer-function forms, explains why ωn only scales time while ζ sets the response shape, and derives pole locations plus an exact overshoot formula that helps tune embedded-system responses.


Return of the Delta-Sigma Modulators, Part 1: Modulation

Jason SachsJason Sachs May 28, 20232 comments

Jason Sachs returns to delta-sigma modulators with a hands-on, code-first treatment that focuses on the DAC side of things. Part 1 walks through first- and second-order kernels, linearized analysis, spectra, and practical coefficient choices while illustrating results with Python simulations. Expect clear rules of thumb for A, R, and B, a derivation of noise shaping behavior, and a useful error bound for RC filtering.


Signal Processing Contest in Python (PREVIEW): The Worst Encoder in the World

Jason SachsJason Sachs September 7, 20136 comments

Jason Sachs previews a hands-on Python contest to find the best velocity estimator for a noisy, low-cost quadrature encoder. The post explains the Estimator API, submission constraints, and a 5 second, 10 kHz evaluation harness that uses a simulated "Lucky Wheel" encoder with realistic manufacturing timing errors. Jason also includes a simple baseline estimator and discusses the practical tradeoff between noise reduction and phase lag in velocity estimation.


First-Order Systems: The Happy Family

Jason SachsJason Sachs May 3, 20141 comment

Jason Sachs takes the modest topic of first-order systems and makes it useful, showing how RC filters behave in both time and frequency domains and why they all share the same shape. He steps through step, ramp, and sinusoidal responses, explains poles, zeros, and Bode behavior, and uses Python plots to make tracking error and the role of tau easy to visualize.


Ten Little Algorithms, Part 6: Green’s Theorem and Swept-Area Detection

Jason SachsJason Sachs June 18, 20173 comments

Jason shows how Green's Theorem becomes a practical, low-cost method to detect real-time rotation from two orthogonal sensors by accumulating swept area. The post derives a compact discrete integrator S[n] = S[n-1] + (x[n]*(y[n]-y[n-1]) - y[n]*(x[n]-x[n-1]))/2, compares integer and floating implementations, and analyzes noise scaling and sampling rate tradeoffs. Includes Python demos and threshold guidance.


Lost Secrets of the H-Bridge, Part II: Ripple Current in the DC Link Capacitor

Jason SachsJason Sachs July 28, 2013

DC link capacitor ripple often determines capacitor life, yet the H-bridge waveform has a lot more structure than you might expect. Jason Sachs separates capacitor current into ramp and pulse components, derives closed-form peak and RMS expressions for edge and center PWM, and shows harmonic amplitudes. The post includes Python simulation so you can visualize the waveforms and apply the formulas to capacitor selection and EMI analysis.


Data Types for Control & DSP

Tim WescottTim Wescott April 26, 20166 comments

Control engineers often default to double precision, but Tim Wescott shows that choice can waste CPU cycles on embedded targets. He separates numeric representation into floating point, integer, and fixed-point, then walks through the tradeoffs, including quantization, overflow, and performance. A concrete PID example highlights why integrator precision and ADC scaling should drive your choice of data type rather than habit.


Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes

Jason SachsJason Sachs April 18, 2018

Last time we looked at some techniques using LFSR output for system identification, making use of the peculiar autocorrelation properties of pseudorandom bit sequences (PRBS) derived from an LFSR.

This time we’re going to jump back to the field of communications, to look at an invention called Gold codes and why a single maximum-length PRBS isn’t enough to save the world using spread-spectrum technology. We have to cover two little side discussions before we can get into Gold...


The 2026 Embedded Online Conference