A MATLAB and Simulink study of detection limits in acoustic, radio, optical and quantum sensing — and of the one inequality that governs all four.
Ontos Labs Ltd · MATLAB R2025b · MIT licensed
An FBAR weighing a protein, a 77 GHz radar ranging a car, a lidar counting photons off a wall, and an interferometer measuring optical phase are four entirely different pieces of physics. They share exactly one thing:
Each estimates a parameter θ from a noisy observation s, and so each is floored by
σθ ≥ 1 / √J(θ), where J = (∂s/∂θ)² / noise variance
Change the physics and you change the derivative. You do not change the law.
Plotted against the resource each one spends — integrated SNR, photons, samples — all four fall on the same slope of −1/2. Not approximately. The radar and lidar points below are Monte Carlo output from simulations in this repository, and the fitted exponents come out at −0.497 and −0.505.
Two things break the pattern, and they are the interesting ones. The radar points leave the line at low SNR — that is the estimator failing, not the bound failing. And the squeezed-light curve sits below the classical line while the Heisenberg curve has a different slope entirely. Those are the only two exits, and both require changing the probe's quantum statistics rather than the instrument's engineering.
The FBAR module makes a claim that runs against how thin-film acoustic biosensors are usually sold.
A film bulk acoustic resonator's Sauerbrey mass sensitivity grows as the square of its operating frequency:
Sm = −2 f₀² / Za
Every FBAR biosensor paper says so, usually in the abstract. A 2 GHz AlN device shifts 2,229 Hz per ng/cm² against a 5 MHz quartz microbalance's 0.057 Hz — a factor of thirty-nine thousand.
But the frequency noise referred to the same measurement grows too. From the resonator's phase slope dφ/df = 2Q/f₀ and the phase-estimation bound σφ = 1/√(2·SNR):
σf = f₀ / (2Q√(2·SNR))
Divide one by the other, and the f₀² cancels against the f₀:
In a thickness-mode acoustic resonator the Q·f product is pinned near a material constant by Akhiezer phonon damping — around 10¹³ Hz for AlN. So at fixed Q·f:
Raising the operating frequency does not lower the detection limit.
From 1 GHz to 10 GHz the sensitivity rises by a factor of 100 and the LOD does not move at all. tests/tOntos.m asserts this to a relative tolerance of 1e-9, so if the claim ever stops being true the build goes red.
The levers that do work are lower acoustic impedance, a better Q·f product, and more SNR. The material figure of merit is therefore M = Q·f / Za, and the ranking it produces is not the one the field's marketing implies: a 5 MHz AT-cut quartz crystal has roughly twenty times the intrinsic areal figure of merit of a 2 GHz AlN FBAR. The FBAR's real advantages lie elsewhere — sensor area, integration, array density, time-to-answer — and the bottom-right panel above separates areal LOD from absolute mass LOD to show exactly where each one wins.
There is also a 43 dB gap between the Cramér–Rao floor and what the same device achieves once flicker noise and thermal drift are in the model. That gap is not a rounding error; it is where the entire engineering discipline lives.
| Module | What it does | Toolboxes |
|---|---|---|
modules/fbar |
Thickness-mode acoustic resonators: physical parameters → mBVD circuit → impedance and S-parameters → Q and kt² extracted from the swept response the way a VNA would → Sauerbrey mass sensitivity → detection limit. Plus a three-stage ladder filter with the mass-loading layer computed in nanometres of molybdenum. | base MATLAB |
modules/radar |
77 GHz FMCW: a real Phased Array System Toolbox chain (waveform → transmitter → two-way free space → RCS target on a moving platform → receiver → dechirp → range-Doppler), plus an analytic Monte Carlo against the Cramér–Rao bound showing the Rife–Boorstyn threshold. | Phased Array, Signal Processing |
modules/lidar |
Photon-counting time-of-flight. A 1 ns pulse is 30 cm of light; with 10,000 photons the precision is 3 mm. Then background light, and the 1/R² photon budget that makes σR grow linearly with range. | Statistics & ML |
modules/quantum |
Quantum Fisher information for phase estimation: coherent, squeezed and NOON probes, with detection loss. Two results are derived symbolically, not asserted: that Poisson photon statistics give Var(n) = ⟨n⟩ and hence 1/√N, and that a lossy NOON state is optimal at exactly N = −2/ln η photons. | Symbolic Math |
modules/unified |
The capstone figure above. Fits the log-log exponent of every modality and measures how far each sits from its own bound. | — |
simulink/ |
The readout system, not the device. A phase-locked loop tracks the resonance while flicker noise pushes it around and an analyte binds at t = 2 s. The model is built by script, because an .slx cannot be diffed in a pull request. |
Simulink, Control System |
The MATLAB modules describe the device — an equivalent circuit, an impedance, a sensitivity, a bound. None of that is dynamic. The Simulink model describes the instrument around it, and it earns its place by producing a result the static analysis cannot:
With white noise, narrowing the loop bandwidth buys you √BW — the familiar trade, and the model reproduces it to within 6% over two decades. With 1/f noise it buys you almost nothing: a hundredfold reduction in bandwidth improves the noise by a factor of 1.57, while costing a hundredfold in response time.
That is the flat bottom of the Allan bathtub, expressed as a control system. It is also the reason resonant sensors are not improved by "just integrating for longer", and it is much harder to argue with when you can watch a 1 pg/cm² binding event arrive at SNR 6.
>> run_all % every figure, then the test suite (~90 s)
>> run_all('Tests', false) % figures only
>> run_all('Only', [3 7]) % just the two headline figures
>> runtests('tests/tOntos.m') % verification on its own (~2 s)Individual demos, if you would rather poke at one thing:
>> demo01_resonator % mBVD, impedance, Q extraction, S11 locus
>> demo02_ladder_filter % k_t^2 sets bandwidth, Q sets insertion loss
>> demo03_biosensor_lod % the central result
>> demo04_radar_fmcw % range-Doppler, CRLB, and the threshold cliff
>> demo05_lidar_tof % photon-limited ranging
>> demo06_quantum_limits % squeezing, NOON states, and what loss does to each
>> demo07_unified_limits % all four on one axis
>> demo08_pll_readout % Simulink readout loopOr use the library directly:
p = fbarParams('f_s', 2.4e9, 'kt2', 0.15, 'Q', 900); % a ScAlN device
m = fbarResonances(p); % f_s, f_p, Q and k_t^2 extracted from the sweep
L = fbarLOD(p, 'Pc_dBm', -20); % detection limit, with the Allan bathtub
F = fbarLadder(p, 'Stages', 4); % a four-stage ladder filter and its S-parametersTwenty-six tests, all of which assert a physical claim rather than a code path. If the prose in this README stops being true, CI goes red.
A few worth singling out:
| Test | Asserts |
|---|---|
couplingRoundTripIsExact |
fbarParams(k_t²) → f_s, f_p → fbarKeff recovers kt² to 1e-12 |
ieeeAndApproxBracketTheExactValue |
the IEEE Std 176 tangent form under-reads and the linearised form over-reads — they bracket the truth, so quoting one alone is a one-sided error bar |
extractedQMatchesInputWhenLossless |
Q recovered from the conductance half-power bandwidth equals the Q that went in, to 0.5% |
sauerbreyReproducesTheTextbookQCM |
the 5 MHz AT-cut constant comes out at 0.0566 Hz per ng/cm² |
lodIsFlatInFrequencyAtConstantQf |
sensitivity scales as f², LOD does not move — to 1e-9 |
ladderCascadeAgreesWithIndependentNodalSolution |
the ABCD cascade matches a hand-solved voltage divider to 1e-10 — two independent derivations, one answer |
reflectionAgreesWithRFToolbox |
S11 matches RF Toolbox's z2s to 1e-10 |
massLoadingThicknessIsPhysicallyPlausible |
the shunt-arm detune lands at 23 nm of Mo, which is what a real duplexer uses — a units error would show up here immediately |
radarEstimatorReachesItsBound |
Monte Carlo efficiency stays in [0.65, 1.5] above threshold |
lidarObeysInverseRootN |
fitted exponent = −0.5 ± 0.05 |
lossyNoonOptimumMatchesTheClosedForm |
the numerical minimum sits at −2/ln η, ±1 photon |
Running tOntos
.......... .......... ......
Done tOntos
26/26 passed in 1.2 s
MATLAB R2025b (the arguments blocks need R2021a or later; nothing else is version-fussy).
| Product | Needed for |
|---|---|
| MATLAB | everything |
| Simulink | demo08, buildFbarPLL |
| Control System Toolbox | the flicker-noise shaping filter (zpk, c2d) |
| Signal Processing Toolbox | windowing in demo04 |
| Statistics and Machine Learning Toolbox | Poisson photon arrivals in the lidar module |
| Symbolic Math Toolbox | the two derivations in demo06 |
| RF Toolbox | the z2s cross-check in the test suite |
| Phased Array System Toolbox | the FMCW radar chain in demo04 |
The FBAR module — the core of the repository — needs base MATLAB only. That is deliberate: the physics should not be behind a licence.
Stated plainly, because a showcase that oversells itself is worth less than one that doesn't.
- The mBVD model is lumped and one-dimensional. It has no spurious lateral modes, no thickness-field non-uniformity, no acoustic leakage into the substrate, and no temperature coefficient. Real FBARs have all four, and they are usually what limits the device. A Mason or KLM stack model, or a piezoelectric FEM, is the next step up.
- The Sauerbrey relation assumes a rigid, thin, non-slipping layer. In liquid, or with a viscoelastic film, it over-reads and you need Kanazawa–Gordon or a full viscoelastic treatment. High-frequency devices are worse off here, not better, because the acoustic decay length in liquid falls as 1/√f. Any FBAR biosensor LOD quoted from Sauerbrey alone, in liquid, has not been earned.
- The material values in
fbarMaterials.mare order-of-magnitude figures assembled to support a scaling argument, not a materials database. Q·f in particular varies by a factor of several between a research coupon and a production part. - The quantum module computes bounds, not experiments. No optical loss budget, no laser phase noise, no atmospheric turbulence. Real coherent lidar sits many tens of dB above the numbers in
demo06, for the same kind of reasons the FBAR sits 43 dB above its own floor. - No measured data. Everything here is simulation and closed-form theory. Where a number matches the literature — AlN at 35.9 MRayl, the 5 MHz QCM constant, 23 nm of Mo, a 0.6 dB / 4% BAW filter — that is a consistency check, not a validation.
MIT — see LICENCE.
Deliberately MIT rather than Apache-2.0: this grants no licence, express or implied, under any patent held by Ontos Labs Ltd or its principals. Everything in this repository is an implementation of published, textbook acoustic and estimation theory — the modified Butterworth–Van Dyke equivalent circuit, the Sauerbrey relation, the Cramér–Rao bound. Nothing here discloses or practises any proprietary method.
- Larson, Bradley, Wartenberg & Ruby, Modified Butterworth-Van Dyke circuit for FBAR resonators and automated measurement system, IEEE Ultrasonics Symposium, 2000.
- IEEE Standard on Piezoelectricity, ANSI/IEEE Std 176-1987, §6.
- Sauerbrey, G., Verwendung von Schwingquarzen zur Wägung dünner Schichten und zur Mikrowägung, Z. Phys. 155, 206–222, 1959.
- Rife, D. C. & Boorstyn, R. R., Single-tone parameter estimation from discrete-time observations, IEEE Trans. Inf. Theory IT-20(5), 591–598, 1974.
- Kay, S. M., Fundamentals of Statistical Signal Processing: Estimation Theory, Prentice-Hall, 1993, ch. 3 and 15.
- Caves, C. M., Quantum-mechanical noise in an interferometer, Phys. Rev. D 23, 1693, 1981.
- Demkowicz-Dobrzański, Kołodyński & Guţă, The elusive Heisenberg limit in quantum-enhanced metrology, Nature Communications 3, 1063, 2012.
Built with MATLAB R2025b. Figures regenerate from source with run_all; nothing in figures/ is hand-edited.


