Modulus and conjugate
Definition.
The length is a hypotenuse, not the parts added. Electronics writes for .
- real partno unit
- imaginary partno unit
- the complex number no unit
- conjugate, no unit
Formula sheet
Spectra, sampling, transforms and filters, by unit.
Definition.
The length is a hypotenuse, not the parts added. Electronics writes for .
Applies: Place the angle in the right quadrant; is at 120°, though arctan gives −60°.
Applies: Lengths multiply, angles add. Multiplying by turns 90°.
Careful: Angles never multiply.
Applies: The unit arrow at angle θ. turns at , and its shadow on the real axis is .
Applies: Waves of the same ω add by adding phasors. is ; is .
Careful: Different frequencies don't add this way.
Applies: Series parts add as complex numbers; is peak volts per peak amp, the angle is how far voltage leads current.
Careful: 100 Ω and 1 µF at 1 kHz is 188 Ω, not 259 Ω.
Applies: Proved by induction with angle addition. Gives .
Careful: Fails for non-integer n (try , ).
Applies: A minus phase is late, a plus early. is one whole period.
Applies: A product of two tones holds the difference and sum frequencies. Adding never makes a new frequency; multiplying always does.
Applies: Parts at different frequencies. A sine of peak A has mean square ; DC of value D has .
Careful: At one shared frequency, add phasors first.
Applies: Gains in series add in dB. Uncorrelated sources add powers, so two 40 dB sources make 43 dB.
| dB | Power ratio | Voltage ratio |
|---|---|---|
| +3 | ×2 | ×1.41 |
| +6 | ×4 | ×2 |
| +20 | ×100 | ×10 |
| −40 | ×10⁻⁴ | ×0.01 |
Applies: A full-scale sine; rounding noise is LSB RMS. 12 bits gives 74 dB. A signal 14 dB below full scale gets 14 dB less.
Careful: Real ADCs add noise; ENOB is .
Applies: A signal repeating every T. Harmonic n has amplitude . Half-wave symmetry leaves odd harmonics only.
The ±1 V square's fundamental is V, taller than the wave.
| Wave, height ±A | Lines |
|---|---|
| square | at odd n |
| triangle | at odd n |
| sawtooth | at every n |
Applies: . One-sided amplitude is ; DC is not halved.
Careful: The negative-frequency line can't be dropped; it keeps x real.
Applies: DC is . Harmonic n vanishes when nD is whole. The fundamental is largest at 50 %.
Applies: Powers of harmonics add. A ±1 V square keeps in its fundamental.
Careful: RMS values of harmonics don't add.
For a finite sum, expand and average term by term; every cross term averages to 0 over T because product to sum leaves whole cycles. Infinite series need the mean-square extension.
Careful: Cross terms are not 0 at each instant.
Applies: Any LTI filter; same lines out, new heights. RC low-pass .
Careful: The whole wave is not scaled by one gain, and no filter makes a frequency that isn't there.
Applies: Signals that don't repeat. is the area. A pulse train has lines .
Applies: Zeros at Narrower pulse, wider spectrum.
Applies: Delay leaves the magnitude and drops phase by . Modulation makes two half-height copies at .
Applies: So at every f. A real pulse of width w acts as an impulse well below .
Applies: Exact for one pole; scopes with a sharper roll-off use 0.35 to 0.45. Rise times in a chain add roughly as squares.
Applies: x differentiable, x and x′ absolutely integrable, and x → 0 at ±∞. Differentiating boosts noise and fast ripple.
Definition.
Linear means this, so zero in gives zero out. Time-invariant means ; a bare n outside usually breaks it.
Applies: Any LTI system. Lengths N and M give N + M − 1 samples.
Careful: Not the sample-by-sample product.
Applies: Flip h, slide it to t, multiply, take the area. Widths add.
Applies: Area 1. A pulse much shorter than τ acts as an impulse of its area.
Definition.
Causal never uses future input. Stable, for LTI systems, is an absolutely summable h.
Careful: A bounded h is not enough; turns a constant into a ramp.
Write . Time invariance maps each to ; linearity carries the sum and weights through. Lose either property and h isn't enough.
Applies: in gives out. is the DC gain.
For real taps, comes out as . Only is plotted, since is the conjugate.
| Filter | h | Nulls on [0, π] |
|---|---|---|
| Two-point average | π | |
| Three-point average | ||
| First difference | 0 | |
| N-point average | each |
Applies: At , −3 dB and −45°; at , −0.04 dB but −5.7°; at , −20 dB and −84.3°.
Careful: The passband is not phase-free.
is k times the product of distances to the zeros over the product of distances to the poles. A real pole at makes a corner at . Stable means every pole in the left half-plane.
Applies: Symmetric taps, . Every frequency is delayed samples, so the shape survives.
Careful: The delay is not N samples, and not N/2.
always is, when . is one only where is real; elsewhere it comes out shifted.
Applies: Every sampled tone. Only reaches the samples.
Every tone must sit strictly below , so . The inputs that land on are . At exactly the samples depend on the phase.
Applies: Images repeat around every multiple of . A 0 to B band's first copy starts at ; overlap is aliasing.
Applies: Before the ADC. It must be down by , not .
Careful: Nothing after the ADC can separate an alias from signal.
Applies: A DAC holding each sample. Gain 0.90 at , at , 0 at ; half a sample of delay. A reconstruction low-pass removes the images.
With , gives , and gives . For sine the second is inverted. This holds only at the sample times.
Applies: Above N/2, bin is frequency −k. A cosine of amplitude A on bin k gives at k and .
Applies: Tones δ apart need .
Careful: Zero-padding adds bins on the same curve; peaks stay wide.
Applies: Tones that don't fit a whole number of cycles. Leak falls like instead of , but the peak is twice as wide.
Applies: N a power of 2; multiplies against .
Careful: For one or two bins, a direct sum (N each) beats the whole FFT.
An FFT on each half of a -sample circular buffer gives a spectrum every , bins apart. Convert bins with the FFT length, not the buffer length.
Applies: For d a multiple of N the sum is N. So the inverse is .
Applies: A one-sample delay multiplies by . On , H is the frequency response; DC is and is .
Applies: An N-sample average, zeros at the N-th roots of 1 except 1. 50 Hz at 1,000 samples/s needs 20.
Applies: To copy an RC, . Stable exactly when .
Careful: A small input gain can't rescue a pole outside the circle.
Applies: Zeros on the circle, poles a little inside at the same angle; r closer to 1 makes it narrower. A pole pair at alone peaks about rad wide.
Careful: is unstable.
Cycles per sample is .
// x[n - k] lives in slot (head - k) mod N
int idx = (head - k + N) % N; // or & (N - 1) for a power of 2 Careful: (head - k) % N goes negative in C.
If , bounds the output. If , the bounded input (s the sign of a) makes .
Applies: Range −1 (0x8000) to 0.99997 (0x7FFF), step about 0.00003.
Careful: 1.0 doesn't fit.
Applies: Fraction bits add, so Q15 × Q15 is Q30. A plain >> 15 is the floor.
Careful: Storing the product in an int16_t keeps the wrong 16 bits.
int16_t arithmetic wraps; 0.75 + 0.5 becomes −0.75. Compute in 32 bits and clamp with , or use QADD16 / SSAT on a Cortex-M4. The only Q15 product that overflows is (−1) × (−1).
Careful: Testing s > 32767 on an int16_t never fires.
Since , the coefficient step must be much smaller than . in Q7 stores 127/128, a τ of 128 samples, not 1,000.
Applies: Add per-sample interrupt overhead; DMA blocks cut it.
Q14 (int16 ÷ 16,384, range ±2) holds every stable biquad coefficient, including for a 50 Hz notch at 1,000 samples/s, which Q15 can't. is exact, so the zeros stay on the circle.
Unfried · getunfried.com/formulas/dsp