The output filter and the equivalent noise bandwidth
How long do I have to wait before reading the value returned by the lock-in? If I shorten the observation time too much I still see the noise fluctuations; if I lengthen it, I risk losing the variations of the signal I want to measure. I want to understand how the filter placed after the detector determines both.
1. The first-order filter
I consider a linear low-pass network with unit DC gain. For an ideal RC network, the time constant is τ=RC. Calling u(t) the voltage at the input of the filter and y(t) the voltage at its output, the current balance at the capacitor node leads to:
\[ \tau\frac{dy}{dt} + y = u(t). \]
With zero initial conditions, the transfer function is H(s)=1/(1+sτ). If I apply a step of amplitude U at time zero, the output is y(t)=U(1−exp(−t/τ)) for t≥0. After one time constant it reaches 63.2% of the final value; after three about 95%; after five about 99.3%. For a relative tolerance ε, the time required is tε=−τ ln ε. The settling time within 1% is therefore about 4.605τ.
For the sinusoidal steady state I set s=j2πf. The amplitude and power responses are respectively:
\[ \begin{aligned}|H(f)| &= \frac{1}{\sqrt{1+(2\pi f\tau)^2}}\\ |H(f)|^2 &= \frac{1}{1+(2\pi f\tau)^2}\end{aligned} \]
The cut-off frequency at −3.0103 dB is fc=1/(2πτ): at this frequency the transmitted power is half of that at DC. A first-order filter does not abruptly stop transmission beyond fc.
2. The equivalent noise bandwidth
I assume at the input of the filter a stationary white noise with a one-sided power spectral density Su, constant and expressed in V²/Hz, for f≥0. For a stable linear system the output variance is Su multiplied by the integral of |H(f)|² from zero to infinity. I define the equivalent noise bandwidth (ENBW) as the area of the power response, normalized to the square of the DC gain.
\[ B_n = \int_0^\infty |H(f)|^2\,df = \left[\frac{\arctan(2\pi f\tau)}{2\pi\tau}\right]_0^\infty = \frac{1}{4\tau} = \frac{\pi}{2}\,f_c. \]
The ENBW is not the cut-off frequency
This bandwidth is that of an ideal rectangular filter with unit gain that would transmit the same white-noise power. It does not coincide with the cut-off frequency. For example, by quadrupling τ, the ENBW drops to a quarter and the standard deviation of the white noise at the output is halved; the characteristic times of the transient also quadruple. The assumption of a white density and the one-sided convention are essential for using these formulas.
3. I compare two time constants
I choose τ=20 ms and τ=100 ms, with a unit step and zero initial conditions. I want to represent the two analytical responses sampled in the Scientific Worksheet, from 0 to 500 ms in 5 ms steps, to observe the difference in speed. These curves describe the continuous model evaluated at the points of the grid, not the output of a digital filter or a measurement of the real circuit.
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 step and power responses and compare your results with mine. Then change something — the time constant, the number of stages, the upper limit of the frequency grid — and see how settling time and noise bandwidth trade against each other. It is the best way to really understand what the output filter of a lock-in does, and to have some fun too.
3.1. I build the two responses in the Worksheet
I create the independent session LockIn_10_filtro_uscita. I open Viewers (1), search for Worksheet in Search (2), choose Worksheet (3) and save the initial sheet.

In Functions (4) I search for and select numeric.uniform_grid (5). I set start=0 (6), stop=0.5 (7), spacing=101 (8), Options=mode="count" (9), Output cell=A1 (10). I press Preview fields (11), wait for the fields to be captured, select x (12) and press Apply result (13).

Column A contains the 101 instants in seconds, including both ends. In Cell & Formula I select B1 (14), enter (15) and apply (16) the formula of the first normalized response, using 1/τ=50 s⁻¹:
=numeric.add(1,numeric.multiply(-1,numeric.exp(numeric.multiply(A1:A101,-50))))

In C1 (17) I enter (18) and apply (19) the same expression, but with 1/τ=10 s⁻¹:
=numeric.add(1,numeric.multiply(-1,numeric.exp(numeric.multiply(A1:A101,-10))))

The formulas act on the whole grid. In column B I see that at 0.02 s the response is about 0.6321; column C reaches the same value only at 0.1 s. These are two normalized curves, so the value one corresponds to the final voltage regardless of the amplitude of the step.
3.2. I plot the curves on the same time axis
Procedure in GX-TXT: chart, publication and labels (Figures 5–7)
I initially select A1:C3 (20), open Chart (21) and choose Add selection (22). I do not limit the graph to the three initial rows: in the next panel I explicitly extend the range to all the samples.

I set Title=First-order step responses (23), X column=A (24), Y columns=B C (25), First row=1 (26), Last row=101 (27), Kind=line (28), Panels=overlay (29), Marker=none (30). To compare the curves with the final value I choose X minimum=0, maximum=0.5 (31–32), Y minimum=0, maximum=1.05 (33–34). I press Apply (35), check that the two curves are complete and choose Publish immutable Graph to Plots (36).

In Plots I select the published graph (37), open Presentation (38) and Title and labels (39). I set X / bottom label to Time (s) (40) and Y Left label to Normalized step response (41). I save (42), open Render (43) and choose Rerender selected (44).


Curve B, blue, rises quickly towards one. Curve C, red, rises more slowly and at 100 ms is still at 63.2% of the final value. Both converge to the same value because the DC gain is unity. The lines connect the points of the sampled analytical response: they do not represent bench measurements or an independent solution of the differential equation. The original CSV keeps all 101 instants and the two ordinates (x in seconds, y1 and y2 dimensionless).
| Time (ms) | Response B, τ=20 ms | Response C, τ=100 ms |
|---|---|---|
| 0 | 0 | 0 |
| 20 | 0.632121 | 0.181269 |
| 60 | 0.950213 | 0.451188 |
| 100 | 0.993262 | 0.632121 |
| 300 | 0.999999694 | 0.950213 |
| 500 | 0.999999999986 | 0.993262 |
Now I also compare the two filters from the theoretical point of view, using the formulas of sections 1 and 2:
| Quantity | τ=20 ms | τ=100 ms |
|---|---|---|
| Cut-off frequency (Hz) | 7.958 | 1.592 |
| ENBW (Hz) | 12.5 | 2.5 |
| Settling time within 1% (ms) | 92.1 | 460.5 |
Speed against noise
For the same white spectral density at the input, increasing τ by a factor of five reduces the output noise variance five times and its standard deviation by √5. I pay for this advantage with a settling time five times longer. The ENBWs in this table are analytical values; the numerical integration of the power response and the comparison between filter orders are the next checks.
4. I check the equivalent noise bandwidth numerically
In section 2 I derived the ENBW by integrating the power response up to infinite frequency. Now I want to evaluate it also with a finite frequency grid. I choose an upper limit F=100 Hz and a step Δf=0.25 Hz, for a total of 401 points. This teaching choice makes it possible to distinguish the discretization error from the area of the tail that remains outside the grid.
4.1. I calculate the two power responses
I reopen the previous Worksheet. In Functions (45) I select numeric.uniform_grid (46), set start=0 (47), stop=100 (48), spacing=401 (49), Options=mode="count" (50), Output cell=D1 (51). I press Preview fields (52), choose the x field (53) and apply the result (54).

Column D contains the frequencies in Hz. I define k=2πτ, expressed in seconds, and calculate P(f)=1/[1+(kf)²]. In Cell & Formula I select E1 (55), enter (56) and apply (57) the formula for τ=20 ms:
=numeric.divide(1,numeric.add(1,numeric.multiply(numeric.multiply(D1:D401,0.12566370614359174),numeric.multiply(D1:D401,0.12566370614359174))))

In F1 (58) I enter (59) and apply (60) the formula for τ=100 ms:
=numeric.divide(1,numeric.add(1,numeric.multiply(numeric.multiply(D1:D401,0.6283185307179586),numeric.multiply(D1:D401,0.6283185307179586))))

E and F contain dimensionless power ratios, not amplitudes or values in decibels. The area I have to integrate is that of these linear quantities with respect to linear frequency.
4.2. I integrate with the trapezoidal rule
Calling Pj the power response at frequency jΔf, the composite trapezoidal rule gives:
\[ B_{0,F} \approx \frac{\Delta f}{2}\sum_{j=0}^{399}\left(P_j + P_{j+1}\right). \]
Instead of explicitly building all the trapezoids, I add the two 400-sample ranges offset by one row. The interior points contribute twice and the end points only once. I select G1 (61), enter (62) and apply (63) the vector of the two integrals, with Δf/2=0.125 Hz:
=vector(0.125*(numeric.sum(E1:E400)+numeric.sum(E2:E401)),0.125*(numeric.sum(F1:F400)+numeric.sum(F2:F401)))

I get about 11.868074 Hz and 2.474672 Hz. Both are lower than the analytically calculated ENBW values. This does not necessarily mean that the step is too large: the whole contribution of frequencies above 100 Hz is missing.
4.3. I add the contribution of the tail
For this simple model the tail can still be calculated in closed form. With k=2πτ>0 and F>0, I use the identity π/2−arctan(kF)=arctan[1/(kF)]:
\[ B_{F,\infty} = \int_F^\infty \frac{df}{1+(kf)^2} = \frac{\arctan\left[1/(kF)\right]}{k}. \]
I use atan2(1,kF), equivalent to the arctangent above for these positive arguments. I select H1 (64), enter (65) and apply (66) the following vector formula; the two denominators are k and the two second arguments of atan2 are kF:
=numeric.divide(numeric.atan2(vector(1,1),vector(12.566370614359172,62.83185307179586)),vector(0.12566370614359174,0.6283185307179586))

In I1 (67) I enter (68) and apply (69) the sum of the two parts, for each time constant:
=numeric.add(G1:G2,H1:H2)


| Quantity (Hz) | τ=20 ms | τ=100 ms |
|---|---|---|
| Numerical integral 0–100 Hz | 11.868074 | 2.474672 |
| Analytical tail | 0.631926 | 0.025328 |
| Sum in I | 12.499999 | 2.500000 |
| Exact ENBW | 12.5 | 2.5 |
The values are rounded separately to six decimal places; the sum in I uses the unrounded values. The first ENBW differs from the exact result by about 6.5 × 10−7 Hz. For the second, the Worksheet display shows 2.5 Hz; I do not interpret the rounding as exact mathematical equality. The tail correction does not remove the error of the trapezoidal rule on the finite stretch. It is a partial numerical check with an analytical tail, not an independent measurement of the bandwidth or an entirely numerical quadrature over an infinite interval.
4.4. I visualize the power response
Procedure in GX-TXT: chart, publication and labels (Figures 16–18)
I select D1:F3 (70), open Chart (71) and press Add selection (72) to create a second graph. I set Title=First-order power responses (73), X column=D (74), Y columns=E F (75), rows 1–401 (76–77), Kind=line (78), Panels=overlay (79), Marker=none (80). I choose X minimum=0, maximum=100 (81–82), Y minimum=0, maximum=1.05 (83–84). I press Apply (85), wait for the regeneration and choose Publish immutable Graph to Plots (86).


In Plots I select the second graph (87), open Presentation (88) and Title and labels (89). I set Frequency (Hz) (90) and Normalized power response (91), save (92), then open Render (93) and choose Rerender selected (94).


The original CSV contains the 401 points (frequencies in Hz, dimensionless ordinates). Curve E, blue, corresponds to τ=20 ms and curve F, red, to τ=100 ms. The red one falls more quickly and encloses a smaller area. Although both curves approach zero, their tails keep contributing to the transmitted noise: beyond 100 Hz there remains about 5.06% of the bandwidth of the 20 ms filter and about 1.01% of that of the 100 ms filter. For a non-white noise spectrum the power response would have to be weighted by the actual spectral density.
Now I have two descriptions of the same filter: the transient in time and the noise attenuation in frequency. I therefore want to check what changes when moving to several low-pass stages in cascade, keeping the time constant of each stage clearly distinct from the overall cut-off frequency.
5. Several RC stages in cascade
I now consider n identical first-order stages, each with time constant τ and unit DC gain. I assume the stages are decoupled by ideal buffers: a cascade of passive RC networks without isolation does not necessarily have this transfer function, because the stages load each other.
\[ H_n(s) = (1+s\tau)^{-n}. \]
For zero initial conditions, the inverse Laplace transform is the impulse response hn(t)=tn−1 exp(−t/τ)/[τn(n−1)!] for t≥0. Integrating from zero to t I obtain the unit step response. I define u=t/τ, a dimensionless time:
\[ y_n(u) = 1 – e^{-u}\sum_{k=0}^{n-1}\frac{u^k}{k!}. \]
I can therefore compare different orders without fixing a particular value of RC. For n=1 I recover the response already discussed; for n=2 the polynomial 1+u appears; for n=4 the polynomial 1+u+u²/2+u³/6 appears. All the outputs tend to one, but with different transients.
5.1. Comparing the step responses in the Worksheet
I add a sheet to the Worksheet with the + button next to Sheet1 and call it Cascades, keeping the previous calculations. In Functions (95) I choose numeric.uniform_grid (96).

I set start=0 (97), stop=12 (98), spacing=121 (99), Options=mode="count" (100) and Output cell=A1 (101). I press Preview fields (102), select the x field (103) when the result is available and press Apply result (104). Column A contains u from 0 to 12 in steps of 0.1.

In Cell & Formula I select E1 (105), enter (106) and apply (107) the factor exp(−u), which I will use for all three responses:
=numeric.exp(numeric.multiply(A1:A121,-1))

I select B1 (108), enter (109) and apply (110) the formula for n=1:
=numeric.add(1,numeric.multiply(-1,E1:E121))

In C1 (111) I enter (112) and apply (113) the formula for n=2:
=numeric.add(1,numeric.multiply(-1,numeric.multiply(E1:E121,numeric.add(1,A1:A121))))

In D1 (114) I enter (115) and apply (116) the formula for n=4. I write the polynomial in Horner form 1+u[1+u(1/2+u/6)], equivalent to the sum of the powers but more compact:
=numeric.add(1,numeric.multiply(-1,numeric.multiply(E1:E121,numeric.add(1,numeric.multiply(A1:A121,numeric.add(1,numeric.multiply(A1:A121,numeric.add(0.5,numeric.divide(A1:A121,6)))))))))

Columns B, C and D are the three normalized responses. Reading row 6, corresponding to u=0.5, I get:
| Number of stages | Response at t=0.5τ |
|---|---|
| 1 | 0.39346934 |
| 2 | 0.09020401 |
| 4 | 0.0017516226 |
For the same τ per stage, increasing the order delays the rise. In particular, for n greater than one the initial slope is zero, while for the first order it is 1/τ with respect to physical time. These are samples of analytical responses evaluated numerically, not experimental measurements. The graphical comparison now makes it possible to follow the whole transient.
5.2. Graphical comparison of the three responses
Procedure in GX-TXT: chart, publication and labels (Figures 26–28)
I select A1:D3 (117), open Chart (118) and press Add selection (119) only once, waiting for the new graph to appear. The initial selection identifies the columns, but contains only three rows. In the new graph I set Title=Cascaded RC step responses (120), X column=A (121), Y columns=B C D (122), First row=1 (123) and above all Last row=121 (124), so as to include the whole grid. I keep Kind=line (125), Panels=overlay (126) and Marker=none (127). Figure 26 shows the selection and the initial fields before the range is extended.

I set X minimum=0 (128), X maximum=12 (129), Y minimum=0 (130) and Y maximum=1.05 (131), leaving both axes linear. I press Apply (132), wait for the regeneration, then choose Publish immutable Graph to Plots (133).

In Plots I select the third graph (134), open Presentation (135), then Title and labels (136). I write Normalized time (t/tau) in the X field (137) and Normalized step response in the Y Left field (138); I save (139). I open Render (140) and choose Rerender selected (141).


The original CSV contains 121 samples: x is the normalized time u=t/τ, y1, y2 and y3 are the responses for n=1, 2 and 4 respectively. The three curves rise towards the same final value, but with different slopes and rise times. For the same τ per stage, a longer cascade takes more time to reach the same output level. I am not comparing filters with the same overall cut-off frequency: the next comparison in frequency will have to distinguish the two conditions explicitly.
5.3. Cut-off frequency and equivalent noise bandwidth
From the model Hn(s)=(1+sτ)−n, setting x=2πfτ, I obtain the normalized power response of the cascade:
\[ |H_n(f)|^2 = (1+x^2)^{-n}. \]
To find the overall half-power cut-off (−3.0103 dB) I impose (1+xc²)n=2. It follows that:
\[ x_c = 2\pi\tau f_{c,n} = \sqrt{2^{1/n}-1}. \]
The cut-off of the cascade does not coincide, for n>1, with the cut-off of a single stage. At high frequency the amplitude response is proportional to f−n: the asymptotic slope of the attenuation is −20n dB/decade.
Now I calculate the one-sided equivalent noise bandwidth of the cascade. With the same change of variable:
\[ B_n = \frac{I_n}{2\pi\tau}, \qquad I_n = \int_0^\infty \frac{dx}{(1+x^2)^n}. \]
The substitution x=tan θ transforms In into the integral of cos2n−2 θ from 0 to π/2. Integrating by parts gives I1=π/2 and, for n≥2, the recurrence In=[(2n−3)/(2n−2)]In−1. I can thus calculate exactly the coefficients for the three orders I compared in the transient:
| Stages n | 2πτ fc,n | τ Bn | Bn/B1 at constant τ |
|---|---|---|---|
| 1 | 1 | 1/4 | 1 |
| 2 | √(√2−1) | 1/8 | 1/2 |
| 4 | √(21/4−1) | 5/64 | 5/16 |
The bandwidth Bn is in Hz when τ is expressed in seconds. For the same τ per stage, two stages halve the variance of the white noise at the output compared with one; four stages reduce it to 5/16. The standard deviation, instead, is proportional to the square root of the bandwidth.
Compare at the same cut-off, not the same τ
If I want to compare filters at the same overall cut-off frequency I must vary τ with the order: τn=√(21/n−1)/(2πfc). In this case the ratio Bn/fc is π/2, π/[4√(√2−1)] and 5π/[32√(21/4−1)] for n=1, 2 and 4 respectively. The reduction of the bandwidth at constant τ therefore cannot be transferred directly to the comparison at constant cut-off.
The results in the table are analytical derivations; the numerical evaluation in the Worksheet is reported in the following section.
5.4. Numerical evaluation in the Worksheet
In a new sheet, Frequency, I select A1 (142), enter in the Cell & Formula tab (143) the vector of the three orders and press Apply (144):
=vector(1,2,4)

In B1 (145) I enter (146) and apply (147) the expression of the normalized cut-off:
=numeric.sqrt(numeric.add(numeric.power(2,numeric.divide(1,A1:A3)),-1))

In C1 (148) I enter (149) and apply (150) the three dimensionless coefficients τB obtained by analytical integration:
=vector(1/4,1/8,5/64)

Finally in D1 (151) I enter (152) and apply (153) the ratio B/fc = 2π(τB)/xc:
=numeric.divide(numeric.multiply(C1:C3,6.283185307179586),B1:B3)

The vector formulas produce three results each; the first cell also shows the vector, while the following rows display the single elements. I report the values read in the Worksheet, rounded:
| Stages | 2πτfc | τB | B/fc |
|---|---|---|---|
| 1 | 1.000000 | 0.250000 | 1.570796 |
| 2 | 0.643594 | 0.125000 | 1.220331 |
| 4 | 0.434979 | 0.078125 | 1.128499 |
This is a numerical evaluation of the analytical expressions, not a second independent numerical integration for orders two and four. If I fix the overall cut-off frequency, the ratio B/fc decreases with the order: with four stages the equivalent bandwidth comes closer to that of the ideal rectangular low-pass filter.
6. Conclusions
The time constant of the output filter sets the trade-off between speed of the measurement and noise reduction. A higher-order filter, made of identical decoupled stages, offers greater attenuation at high frequencies, but for the same τ per stage it lengthens the transient. If instead I keep the overall cut-off the same, the comparison must be made with the ENBW/cut-off frequency ratio: comparing time constants is not enough.
The results at a glance
- First order: fc = 1/(2πτ), ENBW = 1/(4τ) = (π/2)fc, settling within 1% in 4.605τ.
- τ = 20 ms: fc 7.958 Hz, ENBW 12.5 Hz, settling 92.1 ms. τ = 100 ms: fc 1.592 Hz, ENBW 2.5 Hz, settling 460.5 ms.
- Numerical check: trapezoids up to 100 Hz plus analytical tail give 12.499999 Hz and 2.500000 Hz; the tail beyond 100 Hz is 5.06% and 1.01% of the ENBW.
- n identical decoupled stages: τB = 1/4, 1/8, 5/64 for n = 1, 2, 4; at the same overall cut-off B/fc = 1.5708, 1.2203, 1.1285.
For white noise with one-sided spectral density S0, the variance at the output of the filter is S0B and the standard deviation √(S0B). For coloured noise the product of the actual spectral density and |H(f)|² must be integrated. Moreover, a passive RC cascade that is not decoupled can show interactions between the stages, so the formulas derived here are not automatically applicable. The lock-in filter acts on the signal after mixing: it reduces unwanted components and noise, but it must allow the time needed to reach steady state. In the next article, Sensitivity, uncertainty and the limits of the measurement, I will use these results to discuss the sensitivity and uncertainty of the measurement.