You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(analysis,control_analysis,math): resolve issues 251, 252, 253 and add coverage
- #251: rename DiscreteConsineTransform to DiscreteCosineTransform; fix forward
scale from 2/√N to √(2/N) and inverse scale from √N/2 to √N/√2 to produce
the orthonormal DCT-II; update doc and two reference-value tests; add Parseval
identity test; add OPTIMIZE_FOR_SPEED to Inverse
- #252: multiply interior bins (1..N/2-1) by 2 in PowerSpectralDensity::Calculate
to correct 3 dB under-read in one-sided PSD; add FftStubInteriorBin and
ratio test verifying the doubling factor
- #253: add missing D·charPoly[k] term in TransferFunctionStateSpace::ToTransferFunction
so systems with nonzero feedthrough return correct numerator coefficients;
add round-trip and DC-gain tests for improper transfer functions
- Add TestTolerance.cpp with five TEST_F cases covering float, Q31, Q15
- Add seven TYPED_TEST cases to TestQNumber covering zero construction, sign
rules, double negation, and compound-divide-by-zero death
- Add six TEST_F cases to TestFrequencyResponse covering size, phase, and
DC-gain properties across Biquad, Highpass, FirstOrderIir, PureDelay, and
Lowpass fixtures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This normalisation makes the transform matrix unitary, so Parseval's theorem holds exactly: $\sum_k X[k]^2 = \sum_n x[n]^2$. The inverse (orthonormal DCT-III) recovers $x[n]$:
Notice how most of the energy is in $X[0]$ (the DC component) — energy compaction in action.
70
+
Notice how most of the energy is in $X[0]$ (the DC component) — energy compaction in action. The orthonormal scale ensures $\sum_k X[k]^2 = 1^2+2^2+3^2+4^2 = 30$.
67
71
68
72
## Pitfalls & Edge Cases
69
73
70
74
-**Power-of-2 length required** — inherited from the underlying FFT constraint.
71
-
-**Normalization convention.**Different references use different scaling (some include $\sqrt{2/N}$). Verify which convention the consumer expects.
75
+
-**Normalization convention.**This library uses the **orthonormal** convention ($1/\sqrt{N}$ for $k=0$, $\sqrt{2/N}$ for $k \ge 1$), which satisfies Parseval's theorem and makes the transform matrix unitary. Other references may use the unnormalized form; scale accordingly when interfacing.
72
76
-**Fixed-point overflow.** The reordering and FFT steps must preserve range; apply the 0.9999 scaling factor used throughout this library.
73
77
-**Inverse accuracy.** Rounding errors accumulate in the forward-then-inverse round-trip, especially for Q15 types.
74
78
-**Real input only.** Complex inputs are not supported by the reordering trick.
0 commit comments