Sensitivity, uncertainty and the limits of the measurement
If a lock-in manages to detect a very small signal in the presence of noise, how far can I trust the number I read? I want to distinguish the reduction of random noise from the ability to measure the amplitude of the signal correctly. I start from an ideal model, so as to obtain a reference limit against which to compare more realistic measurements and simulations later.
1. From input noise to quadrature noise
I call A the peak amplitude of the sine wave and φ its phase with respect to the reference. I choose the convention of references 2 cos(ω₀t) and −2 sin(ω₀t), followed by low-pass filters with unit DC gain. The ideal outputs are X=A cos φ and Y=A sin φ. In the absence of systematic errors, each also contains a random component.
\[ \begin{aligned} v(t) &= A\cos(\omega_0 t+\varphi) + n(t)\\ X &= A\cos\varphi + n_X, \qquad Y = A\sin\varphi + n_Y\end{aligned} \]
Let en be the one-sided amplitude spectral density of the input noise, in V/√Hz, assumed constant in the bands around the reference frequency. The two-sided power density is en²/2. Multiplication by 2 cos(ω₀t) shifts the two symmetrical bands to DC, where the powers add. In the model with an output bandwidth narrow compared with f₀, the two-sided density of the demodulated noise is therefore en², i.e. 2en² in the one-sided convention. The same holds for Y.
\[ \sigma_X^2 = \sigma_Y^2 = 2\,e_n^2 B_n, \qquad \sigma_X = \sigma_Y = e_n\sqrt{2B_n}. \]
Do not count the factor √2 twice
The factor √2 depends on the peak-amplitude normalization and on the spectral convention. It must not be added a second time to a noise already expressed as a baseband density. In the ideal case of white Gaussian noise, the two orthogonal components are approximately independent in steady state, under the stated assumptions.
2. RC filter and averaging over a finite duration
For the single-stage RC filter, in the previous article I derived Bn=1/(4τ). A rectangular average of duration T has a frequency response of magnitude |sin(πfT)/(πfT)| and a one-sided equivalent bandwidth of 1/(2T). Substituting these two bandwidths gives:
\[ \begin{aligned}\sigma_{RC} &= \frac{e_n}{\sqrt{2\tau}}\\ \sigma_{mean} &= \frac{e_n}{\sqrt{T}}\\ T = 2\tau &\;\Rightarrow\; \sigma_{mean} = \sigma_{RC}\end{aligned} \]
This equivalence concerns the variance of white noise, not the step response, the latency or the settling. For averaging after demodulation it is also assumed that the double-frequency term is negligible or that the window contains an integer number of periods.
Try it yourself with GX-TXT
I carried out the experiments that follow with GX-TXT, free software you can install on Linux. There is no need to take my numbers on trust: follow the steps, rebuild the tables and the synthetic noise and compare your results with mine. Then change something — the noise density, the time constant, the seed, the amount of drift or coherent interference — and see how precision and accuracy part ways. It is the best way to really understand how far a lock-in reading can be trusted, and to have some fun too.
3. A reproducible example in the Scientific Worksheet
I choose en=10 nV/√Hz as a hypothetical value, not as the specification of a real amplifier. I compare seven time constants between 10 ms and 1 s. I create an independent session called LockIn_11_sensibilita_incertezza.
In Viewers (1), I search for Worksheet (2) and open the tool (3).

I select A1 (4), write the formula (5) and confirm with Apply (6). Time constants in seconds.
=vector(0.01,0.02,0.05,0.1,0.2,0.5,1)

I select B1 (7), write the formula (8) and confirm with Apply (9). ENBW of the RC filter in hertz.
=numeric.divide(0.25,A1:A7)

I select C1 (10), write the formula (11) and confirm with Apply (12). Standard deviation of the quadrature in nanovolts.
=numeric.multiply(10,numeric.sqrt(numeric.multiply(2,B1:B7)))

I select D1 (13), write the formula (14) and confirm with Apply (15). Equivalent averaging duration in seconds.
=numeric.multiply(2,A1:A7)

I select E1 (16), write the formula (17) and confirm with Apply (18). Standard deviation of the average in nanovolts.
=numeric.divide(10,numeric.sqrt(D1:D7))

I select F1 (19), write the formula (20) and confirm with Apply (21). Half-width of the 95% interval in nanovolts.
=numeric.multiply(1.96,C1:C7)

The vector formulas generate seven elements starting from the initial cell; the first row also represents the anchor of the vector. In this session the units are explicit conventions: A and D in s, B in Hz, C, E and F in nV. I have not assigned a new physical unit to the numbers through an automatic conversion of the program.
I save the Worksheet. The numerical comparison shows that columns C and E coincide, within the displayed precision: this is the numerical check of the bandwidth equivalence just derived.
4. Logarithmic representation
Procedure in GX-TXT: log-log chart, publication and labels (Figures 8–13)
I select A1:F7 (22), open the Chart panel (23), then Insert (24) and Native chart from selection (25).


The initial chart contains all the selected columns: I do not use it as a scientific result because s, Hz and nV are not homogeneous. Instead I set the title (26), X=A (27), Y=C F (28), rows 1–7 (29–30), Line (31), Overlay (32), Circle markers (33), X limits 0.008–1.2 s (34–35) and Y limits 5–200 nV (36–37). I choose Log for both axes (38–39) and confirm with Apply (40). I publish the immutable graph (41).

In Plots I select the graph just published (42), open Presentation (43) and Title and labels (44). I enter Time constant (s) (45) and Noise and interval half-width (nV) (46), then Save (47). Finally Render (48), Rerender selected (49).




The two sets of points follow parallel straight lines in the log-log graph, as predicted by σ∝τ−1/2. The red line is higher than the blue one by a factor of 1.96. The markers correspond to the seven calculated values, not to experimental measurements. The original CSV published by the Worksheet contains x=τ (s), y1=σ (nV), y2=1.96σ (nV).
| τ (s) | Bn (Hz) | T (s) | σ (nV) | 1.96σ (nV) |
|---|---|---|---|---|
| 0.01 | 25 | 0.02 | 70.711 | 138.593 |
| 0.02 | 12.5 | 0.04 | 50.000 | 98.000 |
| 0.05 | 5 | 0.10 | 31.623 | 61.981 |
| 0.10 | 2.5 | 0.20 | 22.361 | 43.827 |
| 0.20 | 1.25 | 0.40 | 15.811 | 30.990 |
| 0.50 | 0.5 | 1.00 | 10.000 | 19.600 |
| 1.00 | 0.25 | 2.00 | 7.071 | 13.859 |
5. How to interpret the uncertainty
If I consider a single reading of X in steady state, with Gaussian noise, an unbiased mean and a known standard deviation, the interval X±1.96σ has a coverage of about 95% for the true component X. With τ=100 ms its half-width is about 43.827 nV; with τ=1 s about 13.859 nV. I am not building an exact interval for the magnitude R=√(X²+Y²), which has a different distribution, especially with a weak signal. Nor am I guaranteeing a 95% probability of detection: a decision threshold requires specifying the false alarms and the power of the test.
Reducing σ tenfold requires a hundred times the equivalent duration, if the white model remains valid. An average of M truly independent readings reduces the standard deviation by √M; consecutive samples of an RC filter, instead, are correlated. I therefore cannot treat them as independent observations simply by increasing the acquisition rate.
Sensitivity, precision and accuracy
Sensitivity in the metrological sense is the change in the indication per change in the input; it does not coincide with the minimum detectable noise. Resolution and accuracy also depend on quantization, gain, offset, drift, interference coherent with the reference and calibration. A systematic error or a coherent component does not necessarily disappear by increasing τ. These limits require a model and further checks.
6. Statistical check with synthetic noise
The law just derived describes the expected spread, not the value I will obtain in a single reading. I want to check it numerically on two sets of averages with different durations. I directly simulate the noise of one quadrature in baseband, not the carrier signal or the analog circuit. I use independent Gaussian samples, with sampling frequency fs=500 Hz and one-sided power density 2en² up to fs/2. The variance per sample is 2en²·fs/2=en²fs; so for en=10 nV/√Hz I set σsamp=223.60679775 nV. I do not renormalize the generated noise.
I choose 100 disjoint blocks of 10 samples (T=20 ms) and another 100 of 50 samples (T=100 ms), for a total of 6000 samples. In this model the standard deviation of each average is σsamp/√N=en/√T, i.e. 70.711 and 31.623 nV. These durations correspond to the equivalent bandwidths of RC filters with τ=10 and 50 ms, not to their transients.
6.1. Grid and noise
In the Worksheet already saved I create a new sheet with the + button (50), assign the name Noise_trials in the Sheet name dialog (51), then Apply (52).

In Functions (53) I search for and select numeric.uniform_grid (54). I set start=0 (55), stop=11.998 (56), spacing=6000 (57), Options=mode="count" (58), Output cell=A1 (59). I press Preview fields (60), select x (61) and Apply result (62). A contains the 6000 instants from 0 to 11.998 s, with a 2 ms step (63). The graph remaining in the lower part of the window is the theoretical one of the first sheet, not a graph of the new samples.

I select signal.generate.white_noise (64); time=A1:A6000 (65), frequency=empty() (66), modulation=empty() (67), Options=amplitude=223.60679774997897 seed=53001 (68), Output cell=B1 (69). Preview fields (70), the value_real field (71) and Apply result (72) produce the noise sequence in column B (73). The amplitude is the nominal standard deviation of the generator, in nV in this example; the seed makes the test reproducible.

6.2. Averages over disjoint blocks
There is no need to create 200 sessions or repeat the average by hand. I use numeric.matrix_statistics (74): the constructor matrix(B1:B1000,100,10) (75) arranges the first thousand values in a hundred consecutive rows of ten elements. I set dimension=2 (76) to reduce each row and destination C1 (77). Preview fields (78), the mean field (79) and Apply result (80) return the hundred averages in C1:C100 (81).

I repeat the operation on the second interval with matrix(B1001:B6000,100,50) (82), keeping dimension=2 (83) and setting D1 (84). I press Preview fields (85), choose mean (86) and Apply result (87). D1:D100 now contains a hundred averages of fifty samples (88). The two sets use distinct segments: I do not reuse the same samples for the two durations.

6.3. Spread and coverage
I select E1 (89), open Cell & Formula and enter the vector formula (90), confirming with Apply (91). numeric.std returns the sample standard deviation (denominator M−1). E1:E4 (92) contains the mean and standard deviation for each duration, in this order.
=vector(numeric.mean(C1:C100),numeric.std(C1:C100),numeric.mean(D1:D100),numeric.std(D1:D100))

Finally I count how many of the hundred averages satisfy |x̄|≤1.96σ, using the theoretical σ already fixed (not the observed one). In F1 (93) I enter the formula (94) and Apply (95). F1:F2 (96) contains the number of averages within the limits for each duration. I save the Worksheet with Save (97).
=vector(numeric.count_true(numeric.less_equal(numeric.abs(C1:C100),138.59292911256333)),numeric.count_true(numeric.less_equal(numeric.abs(D1:D100),61.980642139300237)))

| T (ms) | N | M | Mean of the averages (nV) | Theoretical σ (nV) | Sample s (nV) | Within ±1.96σ |
|---|---|---|---|---|---|---|
| 20 | 10 | 100 | 7.4363 | 70.7107 | 72.5993 | 94/100 |
| 100 | 50 | 100 | 2.7858 | 31.6228 | 29.2917 | 96/100 |
The five times longer duration reduces the predicted spread by √5, about 2.236. The observed spreads are consistent with this law, taking sampling fluctuations into account: for M=100 independent Gaussian averages the approximate relative uncertainty of s is 1/√[2(M−1)], i.e. about 7%. The coverages of 94% and 96% are close to the theoretical 95%; with a hundred trials I expect a binomial spread of about √(100·0.95·0.05)=2.18 counts. This is not an experimental check of the accuracy of the circuit, nor a certification of the generator. I have checked the law of averaging and the coverage in the synthetic model with independent samples.
When the observations are correlated, this law is not enough: the effective number of independent observations can be lower than the number of samples. Correlation, drift and interference coherent with the reference remain to be examined.
7. Correlated samples: how many independent measurements do I really have?
If I read the output of a low-pass filter very quickly, values that are close in time are not independent. I consider a single-stage RC in steady state, driven by white baseband noise. Its autocovariance, normalized to the variance of a single reading, decreases exponentially: for two samples a distance kΔt apart it is ρk, with ρ=exp(−Δt/τ). The variance of the average of N readings is the sum of all N² covariances divided by N².
\[ \frac{\mathrm{Var}(\bar X)}{\sigma_X^2} = \frac{N + 2\sum_{k=1}^{N-1}(N-k)\rho^k}{N^2}. \]
The factor N−k counts the pairs of readings separated by k intervals. Expanding the geometric sum I obtain, for 0≤ρ<1:
\[ g(N,\rho) = \frac{1}{N^2}\left[\frac{N(1+\rho)}{1-\rho} – \frac{2\rho\,(1-\rho^N)}{(1-\rho)^2}\right]. \]
The standard deviation of the average is σX√g; the equivalent number of independent samples is Neff=1/g. For ρ=0 I recover g=1/N; for N=1 I recover g=1. If N is very large compared with the correlation time expressed in samples, Neff tends to N(1−ρ)/(1+ρ). I do not confuse this asymptotic approximation with the exact result for a short window.
For this test I open a second Worksheet in the same S11 session, so as to keep the sheet with the 200 synthetic averages separate. In H1:H4 I set τ=0.1 s, Δt=0.01 s, ρ and σX=10/√(2τ) in nV. I use H1 =vector(0.1,0.01), H3 =numeric.exp(-H2/H1) and H4 =10/numeric.sqrt(2*H1). As in the previous calculations, the units of the numbers are stated in the text and not inferred automatically by the Worksheet.
I select the parameter cells in H (98), enter the three formulas (99) and confirm each time with Apply (100). The figure shows the calculation of H4, with ρ≈0.904837 and σX≈22.36068 nV.

I select A1 (101), enter the following formula in Cell & Formula (102) and confirm with Apply (103). Seven averaging sizes.
=vector(1,5,10,20,50,100,200)

I select B1 (104), enter the following formula in Cell & Formula (105) and confirm with Apply (106). Standard deviation expected if the readings were independent.
=numeric.divide(H4,numeric.sqrt(A1:A7))

I select C1 (107), enter the following formula in Cell & Formula (108) and confirm with Apply (109). Normalized variance factor g(N,ρ).
=numeric.divide(numeric.subtract(numeric.multiply(A1:A7,(1+H3)/(1-H3)),numeric.multiply(2*H3/(1-H3)^2,numeric.subtract(1,numeric.power(H3,A1:A7)))),numeric.square(A1:A7))

I select D1 (110), enter the following formula in Cell & Formula (111) and confirm with Apply (112). Effective standard deviation of the correlated average.
=numeric.multiply(H4,numeric.sqrt(C1:C7))

I select E1 (113), enter the following formula in Cell & Formula (114) and confirm with Apply (115). Equivalent number of independent readings.
=numeric.divide(1,C1:C7)

Procedure in GX-TXT: log-log chart, publication and labels (Figures 28–30)
I select A1:D7 (116) and create the chart with Insert (117) → Native chart from selection (118).

I set the title Effect of sample correlation (119), X=A (120), Y=B D (121), rows 1–7 (122, 123), Circle marker (124), ranges X=0.8–250 and Y=1–30 (125–128), both scales Log (129, 130).
I confirm with Apply (131), save the Worksheet and publish with Publish immutable Graph to Plots (132). I exclude column C because it is a dimensionless factor and not a voltage.

In Plots I repeat the procedure of Figures 11–13: Presentation → Title and labels, I write Number of samples N (133) and Standard deviation of mean (nV) (134), save (135) and use Render → Rerender selected, confirming completion.


The two cases coincide for one reading; then the red curve departs from the blue one. For N=100, assuming independence I would get 2.236 nV, while the covariance leads to 9.492 nV: a factor of about 4.25. The hundred values acquired over an interval of about one second are equivalent to only 5.55 independent samples with the same individual variance. The native CSV contains N and the two standard deviations. Here I have calculated an analytical model of correlated noise in steady state; I have not simulated the initial transient of a filter or measured a real sequence. The statistical check of section 6, instead, concerns the case of independent samples.
8. Noise, coherent interference and drift: the optimal averaging time
What happens if a disturbance has exactly the same frequency as the reference? Peak-amplitude demodulation transfers its projection Xi=Aicosφi (and Yi=Aisinφi) to DC. The output filter cannot distinguish it from the useful signal. Reducing the bandwidth is therefore not enough. I also consider an output offset that varies linearly from the start of the measurement, b(t)=dt. The rectangular average over [0,T] contains a mean drift dT/2. This is a baseband offset, not a DC voltage at the input of the multiplier, which is ideally rejected by the demodulation.
For a quantitative example I choose en=10 nV/√Hz, an in-phase interference of 10 nV and d=40 nV/s. With reference to the true value at the initial instant, the error has a random component with standard deviation 10/√T, a constant bias of 10 nV or a total bias of 10+20T. For the RMS value of the error (RMSE, root mean square error):
\[ \begin{aligned}\mathrm{RMSE} &= \sqrt{\mathrm{Var} + \mathrm{bias}^2}\\ \text{Noise only: } &\; 10/\sqrt{T}\\ \text{With interference: } &\; \sqrt{100/T + 100}\\ \text{With interference and drift: } &\; \sqrt{100/T + (10+20T)^2}\end{aligned} \]
A bias does not average away
The bias is not a random standard deviation. In this model I know its value by construction; in a real measurement it would have to be estimated, corrected where possible and accompanied by the uncertainty of the correction. I do not add the two systematic components in quadrature: here they have the same sign and are deterministic. I use the rectangular average of white baseband noise, distinct from the average of the already filtered readings of section 7.
I use rows 10–18 of the second Worksheet, without altering the previous table. In the following cells I enter nine durations, from 20 ms to 2 s.
I select A10 (136), enter the following formula in Cell & Formula (137) and confirm with Apply (138). Durations T in seconds, formula before the result is displayed.
=vector(0.02,0.05,0.1,0.2,0.3,0.4,0.5,1,2)

I select B10 (139), enter the following formula in Cell & Formula (140) and confirm with Apply (141). Standard deviation of the white noise; A contains the calculated durations.
=numeric.divide(10,numeric.sqrt(A10:A18))

I select C10 (142), enter the following formula in Cell & Formula (143) and confirm with Apply (144). Constant bias of the in-phase coherent interference.
=numeric.add(10,numeric.multiply(0,A10:A18))

I select D10 (145), enter the following formula in Cell & Formula (146) and confirm with Apply (147). Total bias with linear drift.
=numeric.add(10,numeric.multiply(20,A10:A18))

I select E10 (148), enter the following formula in Cell & Formula (149) and confirm with Apply (150). RMSE with noise and coherent interference, without drift.
=numeric.sqrt(numeric.add(numeric.square(B10:B18),numeric.square(C10:C18)))

I select F10 (151), enter the following formula in Cell & Formula (152) and confirm with Apply (153). RMSE with noise, interference and drift.
=numeric.sqrt(numeric.add(numeric.square(B10:B18),numeric.square(D10:D18)))

Procedure in GX-TXT: log-log chart, publication and labels (Figures 38–39)
I select A10:F18 (166) and repeat Insert → Native chart from selection. I configure the title Noise and systematic error (154), X=A (155), Y=B E F (156), rows 10–18 (157, 158), Circle marker (159), X=0.015–2.5 s and Y=5–100 nV (160–163), Log scales (164, 165). Apply (167), Save and Publish immutable Graph to Plots (168).

In Plots I repeat the procedure of Figures 11–13: Presentation → Title and labels, I write Averaging time (s) (169) and Root mean square error (nV) (170), save (171) and use Render → Rerender selected, confirming completion.


| T (s) | Noise only (nV) | With interference (nV) | With interference and drift (nV) |
|---|---|---|---|
| 0.02 | 70.711 | 71.414 | 71.471 |
| 0.05 | 44.721 | 45.826 | 46.054 |
| 0.1 | 31.623 | 33.166 | 33.823 |
| 0.2 | 22.361 | 24.495 | 26.382 |
| 0.3 | 18.257 | 20.817 | 24.276 |
| 0.4 | 15.811 | 18.708 | 23.958 |
| 0.5 | 14.142 | 17.321 | 24.495 |
| 1 | 10.000 | 14.142 | 31.623 |
| 2 | 7.071 | 12.247 | 50.498 |
The native CSV keeps the nine points. The blue curve keeps falling as T−1/2; the red one tends to the 10 nV limit set by the coherent component; the green one first falls and then rises again. The minimum among the values of T I calculated is at 0.4 s, with an RMSE of about 23.958 nV. It is not the exact minimum of a continuous search, nor a universal optimal time: it depends on the parameters of the model, the sign of the drift, the time reference of the true value and the measurement procedure.
9. Conclusions
The results at a glance
- Quadrature noise: σX = en√(2Bn); with en = 10 nV/√Hz it is 70.711 nV at τ = 10 ms and 7.071 nV at τ = 1 s; a rectangular average of T = 2τ gives the same σ.
- Synthetic noise, 100 + 100 disjoint blocks: s = 72.60 and 29.29 nV against 70.71 and 31.62 nV predicted; coverage within ±1.96σ 94/100 and 96/100.
- Correlated RC readings (τ = 0.1 s, Δt = 0.01 s): with N = 100 the standard deviation of the average is 9.492 nV instead of 2.236 nV, Neff ≈ 5.55.
- Noise, 10 nV coherent interference and 40 nV/s drift: among the durations calculated the minimum RMSE is 23.958 nV at T = 0.4 s.
The equivalent noise bandwidth lets me estimate the precision of a lock-in under ideal conditions, but it is not enough to determine its accuracy. I obtained a prediction of the spread, checked numerically the effect of averaging and the coverage of the Gaussian model on 200 disjoint blocks, and calculated the consequences of correlation, drift and coherent disturbances. Increasing the number of samples or narrowing the bandwidth does not automatically eliminate the systematic components. Calibration, offset control, shielding, study of synchronous disturbances, settling and comparison with independent measurements are needed. All the values in this article are results of the ideal model or of synthetic noise: real performance will be determined with the circuit and the laboratory instruments. The step from the ideal model to the circuit is the subject of the next article, From the ideal model to a real lock-in.