Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes
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 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 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 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 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
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 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 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 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 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.
R1C1R2C2: The Two-Pole Passive RC Filter
Jason Sachs walks through the math and simulation for the common two-pole passive RC filter, turning repetitive algebra into a compact reference you can reuse. He derives the closed-form transfer function, extracts the natural frequency and damping ratio, and explains why the topology cannot be underdamped without inductors or active stages. The post finishes with a state-space simulation recipe and practical component guidance.
Lost Secrets of the H-Bridge, Part I: Ripple Current in Inductive Loads
Jason Sachs digs into what PWM switching actually does to current in an H-bridge with an inductive load, and why that ripple matters for motors and power converters. He derives closed-form ripple formulas, shows how to compute a reference current I_R0 = VDC·T/L, and uses Python and sympy to plot and verify results. Read it for practical rules to halve ripple and raise its frequency.
Breaking AES with an Oscilloscope
AES is a powerful encryption algorithm that protects some our most important secrets. But did you know that many devices are inadvertently leaking the value of their private key through their power pins?! Join me in this special preview of my upcoming workshop at the Embedded Systems Summit (14-16 October 2025 in San Jose, CA) as we explore the world of hardware security and discover just how easy it could be to break AES encryption with only an oscilloscope and some math.
Data Types for Control & DSP
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.
Lost Secrets of the H-Bridge, Part III: Practical Issues of Inductor and Capacitor Ripple Current
Jason Sachs cuts through the math to show what ripple current actually does to H-bridge hardware. He explains why peak current is the limiting factor for inductors, why capacitor ESR usually dominates DC-link voltage ripple, and how center-aligned PWM and duty selection reduce harmonics and ripple. Read this if you want practical rules of thumb and calculation templates for real power-electronics designs.
Ten Little Algorithms, Part 6: Green’s Theorem and Swept-Area Detection
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.
Slew Rate Limiters: Nonlinear and Proud of It!
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.
Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes
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 XII: Spread-Spectrum Fundamentals
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.
First-Order Systems: The Happy Family
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.
Tolerance Analysis
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!
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 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 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 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 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 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
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
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
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...










