Photons to Pulses: What a Telescope Taught Me About Reading Medical Signals
Listen to this post

Photons to Pulses: What a Telescope Taught Me About Reading Medical Signals
There’s a moment in astronomical imaging that every observer knows. You pull up a raw frame — fresh off the detector, completely unprocessed — and it looks wrong. There’s a gradient across the field where the illumination isn’t flat. Hot pixels glow where they have no business glowing. There’s a faint smudge in the lower-left quadrant that might be a galaxy, or might be a ghost reflection bouncing between optical surfaces, or might be noise that happens to line up in a particularly convincing way.
Your whole job, in that moment, is to figure out what’s real.
I spent three years building software for the Discovery Channel Telescope (DCT, now the Lowell Discovery Telescope) — acquisition pipelines, calibration routines, instrument control. Long before I ever touched a medical signal, I was spending my days asking a very specific question: of all the signal coming off this detector, what came from the sky, and what came from everything else?
That question never stopped. I just changed what I was pointing at.
The same physics, a different patient
A CCD at a telescope and the light sensor in a pulse oximeter clipped to a patient’s finger have something real in common. Both are trying to reconstruct something true from a measurement that is fundamentally corrupted, and at the level of the detector, they are corrupted in some of the same ways. Above that level the two problems diverge, and the divergence turns out to be as instructive as the overlap.
In astronomy, you’re collecting photons. They arrive from a distant source — a galaxy, a variable star, a faint near-Earth object — and land on a detector that has its own personality. Every measurement carries shot noise: the irreducible randomness in when photons arrive, because light is quantized and quantum mechanics doesn’t care about your science goals. The detector adds read noise: an electronic hiss introduced each time a pixel is read out, regardless of how much light hit it. And there is background, because the night sky itself glows: airglow from the upper atmosphere, moonlight and city light scattered by the air, sunlight scattered off the dust that fills the inner solar system.
The signal-to-noise ratio of a measurement, in a commonly used simplified form, is:
where is the number of photoelectrons collected from your source, is the number from the background over the same pixels, is the number of pixels you sum over, and is the read noise per pixel. (The full expression has more terms; there’s a note at the end.)
What this equation says, quietly but insistently, is that your ability to detect something real is always a contest between signal and noise, and the noise has multiple sources, each with its own character. It also says something about regimes. When the source is bright, dominates the denominator and the SNR grows as : you’re limited only by the statistics of the light itself. When a faint source sits on a bright sky, dominates and the SNR goes as . When almost no light arrives at all, read noise sets the floor. A great deal of observing strategy comes down to knowing which regime you’re in. You can’t eliminate the noise. You can only understand it well enough to separate it from what you’re after.
Now clip a sensor to a patient’s finger.
Photoplethysmography (PPG) — the technique inside every pulse oximeter and the optical heart-rate sensor on most smartwatches — shines light into tissue and measures how much reaches a photodetector, either on the far side of a fingertip or earlobe (transmission) or alongside the light source on the skin (reflectance), the way a watch does. That photodetector does what a CCD pixel does: absorbed photons free electrons, and the resulting photocurrent carries shot noise with the same statistics whether the light left a distant star or an LED a centimeter away.
What the PPG is trying to detect isn’t a galaxy. It’s the pulse: the small change in arterial blood volume with each heartbeat, which typically modulates the detected light by a few percent or less, riding on a much larger, slowly varying baseline set by skin, tissue, bone, and non-pulsatile blood.
Here some of the astronomy intuition carries over cleanly. A small modulation on a large steady signal is, in noise terms, the faint-source-on-bright-sky problem: shot noise comes from all the light you collect, not just the part you care about, so the pulse has to stand out against the square root of the whole baseline. And ambient room light — daylight, the flicker of overhead lighting — is a background term in the most literal sense. Many PPG front ends sample the detector with the LED switched off and subtract that reading: the same idea as sky subtraction, done in time instead of across an image.
Where the parallel breaks
The regimes, though, are different, and this is where the analogy needs care.
Faint-object astronomy is photon-starved. A faint target might contribute only hundreds or thousands of photoelectrons over an entire exposure, which is why shot noise and read noise dominate the error budget. A PPG sensor is awash in light by comparison: its photocurrent corresponds to billions of photoelectrons or more every second. For a patient lying still with good perfusion, photon statistics are rarely what limits the measurement.
There are conditions where they start to matter again. Wearables dim their LEDs to save battery, and at low perfusion, or through more strongly pigmented skin — melanin absorbs light, more so at the green wavelengths most wrist sensors use — the detected light can drop far enough that the noise floor of the detector and its electronics becomes part of the design problem. That trade-off between LED power and noise is the CCD equation’s logic applied directly.
But in the conditions that make PPG hard in practice, the dominant “noise” isn’t in the equation at all. It’s motion: a wrist that swings, a finger that shifts in the clip, tissue that deforms and changes the optical path with every step. Motion artifact isn’t random and independent from one sample to the next the way shot noise and read noise are. It’s structured and changes over time, and the rhythm of walking or running can land in the same frequency band as the heart rate itself, so filtering alone can’t separate the two — which is why wearables lean on accelerometers to estimate the motion and remove it. Add breathing and the slow oscillations of vascular tone, which push the baseline around, and a PPG trace is shaped far more by physiology and mechanics than by photon statistics.
There’s one more difference, and it’s the one I find most interesting. In astronomy, the background is pure nuisance: you estimate it, subtract it, and move on. In pulse oximetry, the steady baseline is part of the answer. Oxygen saturation is estimated from the ratio of the pulsatile component to the steady component at two wavelengths, typically red and infrared, and then from the ratio of those two ratios. The quantity that behaves like sky in the noise budget is the quantity you divide by to get the result.
Near-infrared spectroscopy (NIRS) sits closer to the astronomer’s world. Clinically, it’s used to monitor cerebral oxygenation, for example during cardiac surgery and in neonatal intensive care; in research, functional NIRS (fNIRS) tracks changes in blood oxygenation near the surface of the cortex. It works in the same red-to-near-infrared window that pulse oximeters use, but the source and detector sit a few centimeters apart on the head, so that some of the light can wander deep enough to sample the brain before coming back out. Very little of it makes the round trip. That pushes NIRS much closer to the photon-limited regime, and one variant, time-domain NIRS, counts individual returning photons and times their arrival — the same kind of single-photon timing used to range laser pulses off the retroreflectors left on the Moon.
NIRS also has its own background problem, and its solution would look familiar to any astronomer. Light that reaches the brain passes through scalp and skull on the way in and again on the way out, and blood flow in the scalp changes too, so the measured signal mixes the brain’s response with the skin’s. A common fix is a short-separation channel: an extra detector placed roughly a centimeter or less from the source, close enough that it sees mostly scalp. Its signal is regressed out of the long-distance channels, much as a photometrist measures blank sky beside a target and subtracts it.
The detector doesn’t know it’s looking at a brain. It’s counting photons and fighting noise, same as always — and here, more than in PPG, the photon budget is part of the fight.
What calibration actually teaches you
One of the unglamorous necessities of telescope operation is the calibration frame. Before you can trust a single science exposure, you take biases (the detector’s electronic zero point), darks (thermal electrons that accumulate even with the shutter closed), and flats (images of a uniformly illuminated source, so you can map out the non-uniformity in your detector’s response).
Flats were the ones that got under my skin. You’d image a featureless screen — or the twilight sky — and what came back was never flat. There were gradients. Vignetting from the optics. Individual pixels that were more or less sensitive than their neighbors by amounts that mattered. To trust any science frame, you first had to understand the instrument’s own idiosyncrasies, divide them out, and only then look at what remained.
Clinical signal processing has its own version of this step. Before a deep learning model ever sees a PPG recording, someone has made decisions about filtering, baseline correction, motion-artifact handling, and normalization. Those choices are the condition of possibility for everything downstream. You don’t get to skip them any more than you can skip flat-fielding and then complain that your photometry is wrong.
But the analogy has a gap, and the gap matters. A flat field is a measurement of the instrument against a known input, taken separately from the science. You can point a telescope at a uniformly lit screen; you can’t take a flat of a patient. In PPG, the patient’s own tissue is part of the optical path. Skin pigmentation, perfusion, tissue thickness, and how the sensor sits all change how much light comes back, and they change from one person to the next and from one minute to the next. It’s as if the telescope’s optics changed with every star you pointed at, with no twilight sky to calibrate against. Most PPG preprocessing is signal conditioning — filtering, detrending, rejecting bad segments — rather than calibration in the astronomer’s sense.
Where pulse oximetry does have true calibration, it’s revealing. Pulse oximeters are calibrated empirically: healthy volunteers breathe gas mixtures that lower their blood oxygen in controlled steps, arterial blood samples measure the true saturation, and the device’s ratio-to-saturation curve is fit to the result. A calibration is only as good as the conditions it spans. In 2020, a research letter in the New England Journal of Medicine compared pulse-oximeter readings with arterial blood measurements in hospitalized adults receiving supplemental oxygen. Among readings in the reassuring 92–96% range, those from Black patients were about three times as likely as those from White patients to conceal an arterial saturation below 88%. Commonly proposed explanations include how melanin interacts with the measurement and how few darkly pigmented volunteers were included in calibration studies. An astronomer would recognize the shape of the problem: a correction derived under one set of conditions, applied to data taken under another.
Detection as a discipline
Both fields lean on the same body of theory, and neither invented it. The statistics of deciding whether a signal is present were formalized by Neyman and Pearson in the 1930s and developed into modern detection theory for radar in the 1940s and ’50s. The ROC curve came out of that radar work and reached medicine by way of psychophysics and radiology.
In astronomy, detection theory shows up in matched filtering, in optimal extraction of spectra, and in the common convention of demanding something like a 5σ excess before calling a smudge a detection. You choose a threshold, and you accept that below it you’ll miss real things (false negatives) and above it you’ll occasionally flag noise as signal (false positives). The high bar is partly a response to scale. An image with millions of pixels offers millions of chances for noise to fluctuate upward, so a threshold that sounds strict for a single measurement still produces a crop of false detections across a full frame.
In clinical AI, the same trade-off lives in the ROC curve, in sensitivity and specificity, and in the clinical stakes that determine where you set the operating point. A model screening for atrial fibrillation from a PPG signal that errs toward missing real episodes carries different consequences than one that errs toward over-flagging. Screening adds a base-rate problem: when most people being screened don’t have the condition, even a quite specific test can produce a sizable fraction of false alarms among its alerts.
Modern astronomy has arrived at the same problem from the other side. Time-domain surveys like the Zwicky Transient Facility find new transients by subtracting reference images from new ones, and the resulting candidates are dominated by subtraction artifacts. Separating real events from “bogus” ones is now done with trained machine-learning classifiers — judged, as clinical models are, on the trade-off between what they miss and what they falsely flag.
Both fields learned this the hard way, by getting burned. Astronomy’s history includes the canals of Mars, which were never on the planet at all but in the human eye’s tendency to join faint, barely resolved features into lines; Percival Lowell, their most famous champion, founded Lowell Observatory in large part to study Mars. It includes planets reported around Barnard’s Star in the 1960s, later traced to changes made to the telescope itself, and a celebrated 2014 claim of primordial gravitational-wave signatures in the cosmic microwave background that a joint analysis the following year found was consistent with dust in our own galaxy. Clinical AI has its own growing catalog: image classifiers that learned which hospital or machine produced an image and leaned on that instead of the disease, models that perform well where they were built and quietly degrade everywhere else, and the steady reminder that a confident prediction is not the same thing as a correct one.
What I didn’t expect
I didn’t plan this. When I was writing instrument drivers for the DCT, I wasn’t thinking about what those calibration instincts would eventually be worth in a clinical AI context. The connection only became visible in retrospect, and even then only partially — I’m still finding the edges of it.
But here’s what I think the overlap actually gives you: a particular skepticism about signals that look clean.
A raw telescope frame keeps its problems in view. The noise is right there in the data, and a careful reduction pipeline doesn’t throw that information away: alongside the cleaned image, it carries an estimate of the uncertainty in every pixel and a mask flagging the pixels you shouldn’t trust. A deep learning model reading a PPG trace usually hands back a single number — a probability, a classification. Some devices report a signal-quality index alongside it, which helps, but often whatever uncertainty went in has been compressed away through filtering steps and model weights, and what comes out the other end looks authoritative.
The astronomer’s instinct, trained on years of staring at calibration frames and asking where did the noise go, is to be suspicious of that authority. The noise didn’t go anywhere. Some of it is still in the input, just no longer visible. And some of the uncertainty was never measurement noise to begin with: it’s the model’s ignorance of inputs unlike anything it learned from — the motion pattern the augmentation strategy didn’t cover, the patient whose skin tone or perfusion or sensor placement sits just outside the range the network has ever seen. No noise model of the detector will tell you about that kind of uncertainty. You have to go looking for it.
Both fields are fundamentally in the business of making claims about the world from imperfect measurements. The measurements will always be imperfect. The question is whether you’ve accounted for what you don’t know, or hidden it somewhere it can surprise you later.
A pipeline reducing images of a faint galaxy and a neural network reading a PPG trace are doing the same kind of epistemic work. The sky is noisy. The body is noisy. The signal is real and it’s in there — but you have to earn it.
A note on the SNR equation: the form above is a simplified version of what’s often called the CCD equation (see, for example, Steve Howell’s Handbook of CCD Astronomy). S and B are counted in detected photoelectrons, not raw photons or digital units, summed over the pixels in your measurement aperture. The full expression adds terms for dark current, digitization noise, and the uncertainty in estimating the background from a finite number of sky pixels. For a PPG photodiode, the shot-noise terms carry over directly; the read-noise term is replaced by the noise of the amplifier and analog-to-digital electronics, which behave differently but play the same role.