MATLAB Scientific Academy
ADVANCED · 20 min

From sensor signal to measurement

Learn how an optical sensor converts light into a sampled signal that can be processed, calibrated and interpreted.

What you will learn

  • Understand sampling and baseline drift.
  • Separate raw signals from derived measurements.
  • Recognize the need for calibration and uncertainty estimates.

The concept

An optical instrument often contains a source, sample or target, collection optics, a photodetector, analogue electronics and a digitizer. The resulting array is not automatically a reliable measurement: background, noise, saturation and calibration must be considered.

In photoplethysmography (PPG), changes in detected light are related to pulsatile blood-volume changes. The waveform can support pulse-rate estimation, but motion, contact pressure, ambient light and physiology affect the signal. A simulated waveform is not a clinical measurement.

Scientific habit: Before running a program, predict what it will do. Then compare your prediction with the output and explain any difference.

Worked example

Create a synthetic pulse-like waveform with a baseline and noise for signal-processing practice.

example.mMATLAB CODE
fs = 100; t = (0:1/fs:10)';
pulse = sin(2*pi*1.2*t);
baseline = 0.15*sin(2*pi*0.15*t);
noise = 0.05*randn(size(t));
raw_signal = 1 + 0.25*pulse + baseline + noise;
plot(t, raw_signal);
xlabel('Time (s)'); ylabel('Detector output (a.u.)');
title('Synthetic optical sensor signal'); grid on;

This is synthetic data for learning only. Real sensor pipelines require appropriate filtering, validation and calibration against a reference instrument.

Try it yourself

Consider the difference between a raw signal and a measurement.

Quick check

Why is calibration needed before converting detector output to a physical quantity?

Reveal hint and answer
Hint: Detector output depends on the device and measurement setup.
Answer: Calibration establishes the relationship between instrument output and a known reference or physical quantity.

Where this is used

The concepts apply to spectroscopy, photodetectors, optical power meters, PPG, pulse oximetry research and OCT signal processing.

Academy homeNext: Scientific projects