---
title: Optical measurements and phase-sensitive detection
heading: Phase-sensitive demodulators that keep the in-phase part of a carrier and reject the rest, lock-in detection of chopped light, light sources from lamps to lasers, fibers and their acceptance angle, optical filters, and photodetectors with their responsivity
eyebrow: S15 · Lesson 5 · Optical measurements and phase-sensitive detection
xp: 50
---

::: hook
An LVDT (lesson 4) and an AC-driven strain-gauge bridge (lesson 3) both put out a carrier whose amplitude carries the measurement and whose phase carries its sign. A plain rectifier keeps the amplitude and throws the sign away, and it passes every stray signal too. Optical sensors have the same problem in another form: a pulse oximeter's photodiode sees room light, sunlight and flickering lamps along with its own LEDs. Both are solved by the same idea: multiply the signal by a copy of what you sent, and average.
:::

::: play
- A carrier of amplitude A arrives with phase φ relative to the reference. The demodulator multiplies it by a square wave that is +1 when the reference is positive and −1 when it's negative, which a switch or a ring of diodes does.
- The solid curve is the signal, the second curve the demodulated output, and the dashed line its average, which a low-pass filter extracts.
- At φ = 0 the output is a positive full-wave-rectified wave averaging $(2/\pi)A$. At 180° it's negative. At 90°, a quadrature signal such as a capacitive pickup, the output averages to zero and is rejected.
:::

```sim plot
view: graph
x: t = 0..3 ms
y: v = -1.2..1.2
slider: A = 0..1 = 0.8
slider: phi = 0..360 = 30 °
plot: A*sin(2*pi*t + phi*pi/180) | samples: 600 | label: input
plot: A*sin(2*pi*t + phi*pi/180)*sign(sin(2*pi*t)) | samples: 600 | color: ch3 | label: demodulated
plot: 2/pi*A*cos(phi*pi/180) + 0*t | dashed | color: ch4 | label: average
readout: average output = 2/pi*A*cos(phi*pi/180) | digits: 3
```

::: predict
## A displacement sensor's output carrier is 40 mV in phase with the reference, plus 40 mV of stray signal 90° out of phase from cable capacitance. What does a phase-sensitive demodulator report, compared with a plain full-wave rectifier?

- [ ] Both report the same, about 36 mV
- [x] The demodulator gives (2/π) × 40 = 25 mV, from the in-phase part only; the rectifier gives (2/π) × 57 = 36 mV
- [ ] The demodulator gives zero because the phases cancel
- [ ] The rectifier gives 25 mV and the demodulator 36 mV

::: reveal
The two parts add to a 56.6 mV carrier at 45°, which a rectifier averages to 36 mV, wrong by 41%. The demodulator's output is $(2/\pi)A\cos\varphi$ = (2/π)(56.6)(cos 45°) = 25.5 mV, exactly the in-phase 40 mV's share. The quadrature part, the error, contributes nothing.
:::
:::

::: nameit
## Phase-sensitive demodulation

Multiplying an input $A\sin(\omega t + \varphi)$ by a ±1 square wave synchronized with the carrier and averaging gives

$$\bar v = \frac{2}{\pi}A\cos\varphi$$

So the output follows the in-phase component, with its sign. It rejects a quadrature component (φ = 90°), any DC offset (the square wave averages to zero), and anything at frequencies not locked to the carrier, which average out in the low-pass filter. Webster's practical circuit is a **ring demodulator**: four diodes switched by the carrier, which must be more than twice the input. Integrated double-balanced demodulators do the same without transformers.

The output filter sets the trade-off between noise and speed. A single RC section with corner $f_c$ gives the demodulator an equivalent noise bandwidth of $\pi f_c/2$, so a narrow filter rejects almost all broadband noise while still following a slowly changing measurement. Putting a tuned amplifier ahead of the demodulator gives a **lock-in amplifier**, which can recover signals far below the noise.

## Chopped light

Optical instruments modulate their light, switching an LED on and off or spinning a chopper wheel, and demodulate the detector's output at the same frequency. Steady ambient light becomes a DC offset and mains-frequency flicker an unrelated frequency, and both are rejected. Pulse oximeters alternate their red and infrared LEDs with dark intervals and subtract each dark reading.

## Sources and optics

- **Tungsten lamps** radiate nearly as black bodies. At a filament temperature of 2800 K, Wien's law $\lambda_m = 2898/T$ µm puts the peak at 1.03 µm, in the infrared, so most of their power is heat.
- **LEDs** emit a band tens of nanometers wide, can be switched in microseconds, and are efficient and cheap.
- **Lasers** give narrow, coherent, collimated beams for interferometry, Doppler measurements and surgery.

An **optical fiber** guides light by total internal reflection at the boundary between its core (index $n_1$) and cladding ($n_2 < n_1$), beyond the critical angle $\sin\theta_c = n_2/n_1$. It accepts light entering within a half-angle given by the **numerical aperture**

$$\text{NA} = \sin\theta_a = \sqrt{n_1^2 - n_2^2}$$

Bundles of fibers carry light into endoscopes and images back out of them.

**Filters** select wavelengths: colored glass absorbs, thin-film **interference filters** pass bands a few nanometers wide, and gratings in monochromators spread the spectrum.

## Detectors

**Thermal detectors** (thermopiles, bolometers) respond to any wavelength but slowly. **Photon detectors** respond to individual photons above a threshold energy: photomultipliers amplify each photoelectron millions of times; **photodiodes** produce a current proportional to power, with responsivity

$$\mathcal R = \frac{\eta q\lambda}{hc} = \eta\,\frac{\lambda\ [\mu\text{m}]}{1.24}\ \text{A/W}$$

for quantum efficiency η, and respond in microseconds or faster. A complete optical measurement multiplies the source's spectrum, the filter's transmission and the detector's responsivity, wavelength by wavelength, and the signal is the area under that product.
:::

::: example
## A 5 kHz carrier from an LVDT reaches a ring demodulator with an amplitude of 50 mV at 30° to the reference. What DC output results, and what output filter gives a 10 Hz corner with a 470 nF capacitor?

::: solution
1. **DC output.**
   $$\begin{aligned} V &= \frac{2}{\pi} \times 50 \times \cos 30° \\ &= 27.6\ \text{mV} \end{aligned}$$
2. **Only the in-phase part counts.** The in-phase part of the input gives the same average:
   $$\begin{aligned} 50 \cos 30° &= 43.3\ \text{mV} \\ \frac{2}{\pi} \times 43.3 &= 27.6\ \text{mV} \end{aligned}$$
3. **Output filter.** For a 10 Hz corner with 470 nF:
   $$\begin{aligned} R &= \frac{1}{2\pi \times 10 \times 470 \times 10^{-9}}\ \Omega \\ &= 33.9\ \text{k}\Omega \end{aligned}$$
4. **Ripple and response.** The corner is 500 times below the carrier, so the ripple at twice the carrier frequency is negligible, and the sensor's motion can still be followed up to about 10 Hz.

**Answer:** the DC output is 27.6 mV, and a 33.9 kΩ resistor with the 470 nF capacitor gives the 10 Hz corner.
:::
:::

::: example
## An endoscope's illumination fibers have a plastic core of index 1.49 and cladding of 1.41. What light do they accept, and what current does 10 µW at 660 nm produce in a photodiode with 80% quantum efficiency?

::: solution
1. **Numerical aperture.**
   $$\begin{aligned} \text{NA} &= \sqrt{1.49^2 - 1.41^2} \\ &= \sqrt{0.232} \\ &= 0.482 \end{aligned}$$
   so the fibers accept light within 28.8° of their axis in air.
2. **Trapping inside.** Rays strike the cladding at more than the critical angle and are trapped:
   $$\begin{aligned} \theta_c &= \arcsin\frac{1.41}{1.49} \\ &= 71.1° \end{aligned}$$
   from the normal.
3. **Photodiode responsivity.** At 0.66 µm:
   $$\begin{aligned} R_\lambda &= \frac{0.8 \times 0.66}{1.24} \\ &= 0.426\ \text{A/W} \end{aligned}$$
4. **Photocurrent.**
   $$\begin{aligned} I &= 0.426\ \text{A/W} \times 10\ \mu\text{W} \\ &= 4.26\ \mu\text{A} \end{aligned}$$

**Answer:** the fibers accept light within 28.8° of their axis (NA = 0.482), and 10 µW at 660 nm produces 4.26 µA.
:::
:::

::: example
## A lock-in amplifier must detect a 1 µV in-phase signal in noise of 1 µV/√Hz. What output signal-to-noise ratio do output time constants of 1 s and 10 s give, and what does each cost in response time?

::: solution
1. **Noise bandwidth.** A single RC section with time constant τ has an equivalent noise bandwidth of
   $$B = \frac{1}{4\tau}$$
   0.25 Hz for 1 s and 0.025 Hz for 10 s.
2. **Output noise.** The noise is 1 µV/√Hz times $\sqrt{B}$:
   $$\begin{aligned} v_1 &= 0.5\ \mu\text{V rms} \\ v_{10} &= 0.16\ \mu\text{V rms} \end{aligned}$$
3. **Signal-to-noise ratio.** The 1 µV signal gives amplitude ratios of
   $$\begin{aligned} \text{SNR}_1 &= 2 \\ \text{SNR}_{10} &= 6.3 \end{aligned}$$
4. **Response time.** Settling to 5% takes 3τ: 3 s or 30 s.
5. **The trade.** Every tenfold gain in noise power is paid for with a tenfold slower answer.

**Answer:** a 1 s time constant gives a signal-to-noise ratio of 2 and settles in 3 s; a 10 s one gives 6.3 and takes 30 s.
:::
:::

::: check
given: A = 20 | 50 | 100; f = 20 | 45 | 60 | 120 | 150
answer: 2/pi*A*cos(f*pi/180)
unit: mV
tolerance: 0.5%

## A {A} mV carrier arrives at {f}° to the reference of a phase-sensitive demodulator. What's the average output?

::: right
Right. $(2/\pi)A\cos\varphi$ = {answer} mV.
:::

::: misses
- [2/pi*A] That's what a plain rectifier gives. The demodulator keeps only the in-phase part.
- [A*cos(f*pi/180)] Averaging the full-wave-rectified wave gives a factor of 2/π.
- [any] Not yet. Average the input times the ±1 switching function.
:::
:::

::: check
given: f = 5 | 10 | 20; C = 100 | 220 | 470
answer: 1/(2*pi*f*C*1e-9)/1000
unit: kΩ
tolerance: 0.5%

## A demodulator's RC output filter must have its corner at {f} Hz with a {C} nF capacitor. What resistor?

::: right
Right. $R = 1/(2\pi f_c C)$ = {answer} kΩ.
:::

::: misses
- [1/(f*C*1e-9)/1000] Include the 2π.
- [any] Not yet. Solve $f_c = 1/(2\pi RC)$ for R.
:::
:::

::: check
given: a = 1.46 | 1.48 | 1.5; b = 1.40 | 1.42 | 1.44
answer: sqrt(a^2 - b^2)
tolerance: 0.5%

## A fiber's core has index {a} and its cladding {b}. What's its numerical aperture?

::: right
Right. $\sqrt{n_1^2 - n_2^2}$ = {answer}.
:::

::: misses
- [a - b] Use the difference of the squares, under a square root.
- [b/a] That's the sine of the critical angle inside the fiber.
- [any] Not yet. NA = $\sqrt{n_1^2 - n_2^2}$.
:::
:::

::: check
given: a = 1.46 | 1.48 | 1.5; b = 1.40 | 1.42 | 1.44
answer: asin(sqrt(a^2 - b^2))*180/pi
unit: °
tolerance: 0.5%

## For the same fiber (core {a}, cladding {b}), what's the acceptance half-angle in air?

::: right
Right. $\arcsin(\text{NA})$ = {answer}°.
:::

::: misses
- [asin(b/a)*180/pi] That's the critical angle at the core–cladding boundary.
- [any] Not yet. The acceptance angle's sine is the NA.
:::
:::

::: check
given: e = 0.6 | 0.75 | 0.9; l = 530 | 660 | 940; P = 1 | 10 | 50
answer: e*(l/1000)/1.23984*P
unit: µA
tolerance: 0.5%

## A photodiode with quantum efficiency {e} receives {P} µW at {l} nm. What current does it produce?

::: right
Right. $\eta\lambda/1.24$ A/W times the power: {answer} µA.
:::

::: misses
- [e*1.23984/(l/1000)*P] Responsivity grows with wavelength: each photon carries less energy, so a watt has more of them.
- [any] Not yet. Responsivity is $\eta\lambda[\mu\text{m}]/1.24$ A/W.
:::
:::

::: check
given: T = 2400 | 2800 | 3200
answer: 2898/T
unit: µm
tolerance: 0.5%

## At what wavelength does a tungsten filament at {T} K radiate most strongly?

::: right
Right. Wien: $\lambda_m = 2898/T$ µm = {answer} µm, in the infrared.
:::

::: misses
- [2898/(T - 273)] The temperature is already in kelvin.
- [any] Not yet. Wien's displacement law.
:::
:::

::: check
kind: parts
given: n = 0.1 | 1 | 10; t = 0.1 | 1 | 30; s = 0.5 | 5

## A lock-in amplifier with an output time constant of {t} s sees noise of {n} µV/√Hz and an in-phase signal of {s} µV.

::: part
answer: n*sqrt(1/(4*t))
unit: µV
tolerance: 0.5%

### What RMS noise remains at its output?

::: misses
- [n*sqrt(1/(2*pi*t))] The noise bandwidth of an RC filter is $1/(4\tau)$, not its corner frequency.
- [any] $n\sqrt{1/(4\tau)}$.
:::
:::

::: part
answer: s/(n*sqrt(1/(4*t)))
tolerance: 0.5%

### What signal-to-noise ratio (amplitude) results?

::: misses
- [any] Signal over output noise.
:::
:::
:::

::: check
kind: derivation
vars: a = 1.45..1.7, b = 1.3..1.44

## An optical fiber has core index a and cladding index b.

::: step
answer: sqrt(a^2 - b^2)

### What is its numerical aperture?
:::

::: step
answer: asin(sqrt(a^2 - b^2))

### What is its acceptance half-angle in air, in radians?
:::

::: right
Right. Plastic fibers with large index differences accept light over wide angles, easing coupling from LEDs.
:::
:::

::: explain
## Why does a phase-sensitive demodulator reject interference that a plain rectifier passes?

::: model
A rectifier responds to the size of whatever arrives, so a quadrature pickup, a DC offset or noise at other frequencies all add to its output. A phase-sensitive demodulator multiplies the input by a switching function locked to the carrier and then averages. Only a component at the carrier frequency and in phase with the reference produces a product with a nonzero average; a component 90° out of phase spends equal time positive and negative within each half of the switching cycle and averages to zero, a DC offset is multiplied by a square wave that averages to zero, and components at other frequencies produce products at the difference frequency, which the low-pass filter removes. The narrower the filter, the more thoroughly everything but the wanted signal is rejected, which is why the same idea, as a lock-in amplifier, recovers optical signals buried in room light.
:::
:::

::: practice

::: check
given: A = 5..200; f = 5..80
answer: 2/pi*A*cos(f*pi/180)
unit: mV
tolerance: 0.5%

## PSD average: {A} mV at {f}°?

::: misses
- [any] $(2/\pi)A\cos\varphi$.
:::
:::

::: check
given: a = 1.45..1.6 step 0.01; b = 1.35..1.44 step 0.01
answer: sqrt(a^2 - b^2)
tolerance: 0.5%

## NA for $n_1$ = {a}, $n_2$ = {b}?

::: misses
- [any] $\sqrt{n_1^2 - n_2^2}$.
:::
:::

::: check
given: e = 0.4..0.95; l = 400..1000; P = 0.5..100
answer: e*(l/1000)/1.23984*P
unit: µA
tolerance: 0.5%

## Photocurrent: η = {e}, {l} nm, {P} µW?

::: misses
- [any] $\eta\lambda/1.24$ A/W × P.
:::
:::
:::
