EmbeddedRelated.com
The 2026 Embedded Online Conference

Quaternions and the spatial rotations in motion enabled wearable devices. Exploiting the potential of smart IMUs attitude estimation.

Pablo Perez GarciaPablo Perez Garcia August 10, 20238 comments

Have you always wondered what a quaternion is? this is your post. Attitude or spatial orientation analysis is a powerful element in wearable devices (and many other systems). Commercially available sensors can provide this information out-of-the-box without requiring complex additional implementation of sensor fusion algorithms. Since these are already on-chip solutions devices can serve as a way to explore and analyze motion in several use cases. Mathematical analysis for processing quaternion is presented along with a brief introduction to them, Although they are not really easy to visualise, a couple fairly simple examples are provided which may allow you to gain some intuition on what's the logic behind them.


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.


A Second Look at Slew Rate Limiters

Jason SachsJason Sachs January 14, 2022

Picking the right slew rate can cut overshoot dramatically while keeping delay reasonable, Jason shows. He numerically analyzes a feedforward slew-rate-limited step into a normalized second-order system and proposes a simple empirical rule R = Δx/(2π α τ) with α ≈ 1. The post includes Python/Scipy code and a 3→5 V example that demonstrates about a 3× overshoot reduction and a ≈5τ peak delay.


Shibboleths: The Perils of Voiceless Sibilant Fricatives, Idiot Lights, and Other Binary-Outcome Tests

Jason SachsJason Sachs September 29, 2019

Binary tests look simple until you try to pick a threshold, because false positives, false negatives, and base rate all collide. Jason Sachs uses a deliberately absurd detective story, then walks through the math of expected value, medical screening tradeoffs, idiot lights, and even a triage-style three-way decision. The payoff is a practical way to think about when a pass/fail signal helps, and when raw data or a second test is worth the extra complexity.


Wye Delta Tee Pi: Observations on Three-Terminal Networks

Jason SachsJason Sachs December 23, 2018

Three-terminal passive networks, wye, delta, tee, and pi, are more interchangeable than many engineers expect. Jason Sachs walks through Kennelly's wye-delta formulas, Z and Y matrix representations for tee and pi two-port networks, and worked examples ranging from balanced to highly skewed impedances. The post highlights practical payoffs, including using topology transforms to substitute hard-to-source capacitors with simpler, precision-friendly parts.


Linear Feedback Shift Registers for the Uninitiated, Part XVIII: Primitive Polynomial Generation

Jason SachsJason Sachs August 6, 20182 comments

Jason Sachs walks through how to find primitive polynomials for GF(2) LFSRs, moving from naive exhaustive checks to smarter synthetic constructions. The article compares sieve and constructive methods, shows practical optimizations like parity checks and companion-matrix updates, and demonstrates decimation plus Berlekamp-Massey to generate all primitives from one seed; it also teases a novel Falling Coyote Algorithm for additional speedups.


Linear Feedback Shift Registers for the Uninitiated, Part XVII: Reverse-Engineering the CRC

Jason SachsJason Sachs July 7, 20181 comment

Jason Sachs shows how to pry CRC parameters out of a black-box oracle and reimplement the checksum yourself. By canceling the affine offsets, probing single-bit basis messages, and treating per-bit outputs as LFSR sequences, you can recover the generator polynomial, bit and byte order, and init/final XOR values. The post includes working Python code, a 4-message shortcut, and real-world tests such as zlib CRC32.


Linear Feedback Shift Registers for the Uninitiated, Part XVI: Reed-Solomon Error Correction

Jason SachsJason Sachs June 19, 2018

Jason Sachs demystifies Reed-Solomon codes with hands-on examples and pragmatic tips for embedded engineers. The article shows why RS encoding is just polynomial division in GF(2^m), why decoding is mathematically heavier, and how to implement encoders in Python and in C-friendly form using LFSRs and table-driven methods. Read this for working code, generator-polynomial examples, and an embedded-minded view of RS practicalities.


Linear Feedback Shift Registers for the Uninitiated, Part XV: Error Detection and Correction

Jason SachsJason Sachs June 12, 2018

CRCs and Hamming codes look a lot less magical when you view them as redundancy with a purpose. Jason Sachs walks from parity bits and checksums into finite-field polynomial arithmetic, then shows how CRCs map cleanly onto LFSRs and how Hamming codes use syndromes to locate single-bit errors. It is a practical tour of error detection and correction, with enough worked examples to make the theory feel usable.


Linear Regression with Evenly-Spaced Abscissae

Jason SachsJason Sachs May 1, 20181 comment

Jason Sachs cuts through the matrix algebra to show a tiny trick for linear regression when x values are evenly spaced. You can compute the intercept as the mean and the slope as a simple weighted sum with arithmetic weights, using q = 12/(m^3 - m). The post includes Python examples and a compact routine to get least-squares coefficients without matrix solvers.


Linear Feedback Shift Registers for the Uninitiated, Part XVIII: Primitive Polynomial Generation

Jason SachsJason Sachs August 6, 20182 comments

Jason Sachs walks through how to find primitive polynomials for GF(2) LFSRs, moving from naive exhaustive checks to smarter synthetic constructions. The article compares sieve and constructive methods, shows practical optimizations like parity checks and companion-matrix updates, and demonstrates decimation plus Berlekamp-Massey to generate all primitives from one seed; it also teases a novel Falling Coyote Algorithm for additional speedups.


Elliptic Curve Cryptography - Basic Math

Mike RosingMike Rosing October 10, 2023

An introduction to the math of elliptic curves for cryptography. Covers the basic equations of points on an elliptic curve and the concept of point addition as well as multiplication.


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.


Bad Hash Functions and Other Stories: Trapped in a Cage of Irresponsibility and Garden Rakes

Jason SachsJason Sachs January 28, 20141 comment

A tiny filename decision in MATLAB's publish() can silently swap rendered equations, and Jason Sachs shows why that matters. He reproduces the bug, walks through hash-function basics and collision math, and contrasts safe and unsafe caching strategies. The piece then broadens into practical lessons about software fringes, legacy constraints, and the usability traps that leave engineers repeatedly stumbling over avoidable design choices.


Fluxions for Fun and Profit: Euler, Trapezoidal, Verlet, or Runge-Kutta?

Jason SachsJason Sachs September 30, 20132 comments

Which ODE solver should you pick for resource‑constrained embedded simulations? Jason Sachs walks through practical numerical methods — Euler, trapezoidal, midpoint, 4th‑order Runge‑Kutta, semi‑implicit Euler, Verlet and the Forest–Ruth symplectic scheme — using hands‑on examples (damped bead, Kepler orbit, pendulum). He highlights accuracy vs. function‑evaluation cost, timestep guidance, and why symplectic methods beat general solvers for long‑term energy conservation.


Linear Feedback Shift Registers for the Uninitiated, Part VII: LFSR Implementations, Idiomatic C, and Compiler Explorer

Jason SachsJason Sachs November 13, 20171 comment

Jason Sachs takes LFSR theory back to real hardware, showing multiple C implementations and dsPIC33E assembly to squeeze cycles out of Galois LFSR updates. He digs into idiomatic C pitfalls like rotate idioms, demonstrates tricks using unions and 16/32-bit views, and shows when inline assembly with SL/RLC and conditional-skip instructions pays off. The article also uses Compiler Explorer and supplies an MPLAB X test harness for verification.


Linear Feedback Shift Registers for the Uninitiated, Part II: libgf2 and Primitive Polynomials

Jason SachsJason Sachs July 17, 2017

Jason Sachs digs into practical finite-field arithmetic for LFSRs, using his libgf2 Python library as the hands-on guide. He shows how to test whether a polynomial is primitive, why that matters for maximal-length sequences, and how the library implements addition, multiplication, exponentiation, and shifts over GF(2). The post is both a math refresher and a code walkthrough for engineers who want to compute with LFSRs instead of just talk about them.


Elliptic Curve Cryptography

Mike RosingMike Rosing November 16, 20156 comments

Secure online communications require encryption. One standard is AES (Advanced Encryption Standard) from NIST. But for this to work, both sides need the same key for encryption and decryption. This is called Private Key encryption.


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

Jason SachsJason Sachs April 18, 2018

Gold codes solve a practical spread-spectrum problem, sharing one PRBS across many transmitters eventually runs into ugly synchronization and correlation issues. Jason Sachs walks through why shifted copies of a single LFSR sequence are not enough, then shows how preferred pairs of m-sequences create a family of Gold codes with bounded cross-correlation. The post wraps with Python experiments and a UART DSSS demo that decodes multiple overlapping messages cleanly.


Linear Feedback Shift Registers for the Uninitiated, Part XVII: Reverse-Engineering the CRC

Jason SachsJason Sachs July 7, 20181 comment

Jason Sachs shows how to pry CRC parameters out of a black-box oracle and reimplement the checksum yourself. By canceling the affine offsets, probing single-bit basis messages, and treating per-bit outputs as LFSR sequences, you can recover the generator polynomial, bit and byte order, and init/final XOR values. The post includes working Python code, a 4-message shortcut, and real-world tests such as zlib CRC32.


The 2026 Embedded Online Conference