mathematics//signal processing//sampling
Sampling is the reading of a continuous signal at discrete instants, usually every fixed **sampling period** \(T_s=1/f_s\), and it is what lets a computer hold a voltage, a pressure or an angular rate at all: a measurement chain ends in a stream of samples, and everything downstream (filters, estimators, controllers, logs) knows the world only at those instants. It is a different operation from drawing tokens out of a probability distribution in a language model (sampling in that sense), and from the rounding in amplitude that happens in the same converter (quantization).
Sampling is the reading of a continuous signal at discrete instants, usually every fixed sampling period Ts=1/fsT_s=1/f_sTs=1/fs, and it is what lets a computer hold a voltage, a pressure or an angular rate at all: a measurement chain ends in a stream of samples, and everything downstream (filters, estimators, controllers, logs) knows the world only at those instants. It is a different operation from drawing tokens out of a probability distribution in a language model (sampling in that sense), and from the rounding in amplitude that happens in the same converter (quantization).
What happens between two samples is lost, and two things decide whether that matters. The first is the fastest content of the signal: a sine that completes many cycles between readings leaves samples that also fit a much slower sine, so it reappears at a false low frequency (aliasing); below half the rate nothing is lost at all (sampling theorem). The second is the fastest time constant of the system being watched or controlled: the period has to be small against it, or a model stepped at that rate and a loop acting at that rate both see a coarse caricature of the dynamics (time constant, discretization).
Choose the rate from the bandwidth, then multiply.
In practice a signal is sampled at 5 to 10 times the bandwidth that matters, so that the anti-aliasing filter in front has room to roll off between the band kept and half the sampling rate. A control loop asks for more still, because a held sample is on average half a period old (sampling rate selection).
Sampling costs delay before it costs accuracy. A value held until the next reading is, on average, Ts/2T_s/2Ts/2 old: 0.5 ms at 1 kHz and 50 ms at 10 Hz, which a fast loop counts against its margin (zero-order hold, loop delay).
Oversampling and decimation move the hard work into the digital domain. The converter samples far faster than needed, so a cheap analog filter suffices, then a digital low-pass removes everything above the final band and only every MMM-th sample is kept. Many MEMS inertial units sample internally at several kilohertz and filter before handing over the data, and the sigma-delta converter takes the idea to the extreme (analog-to-digital converter); the internal filter is a delay the user may never have configured.
Uniform sampling is an assumption every discrete filter and controller makes. A period that wobbles (jitter) or a timestamp taken at message arrival instead of acquisition breaks it silently, which is why a sample without a reliable time is half a measurement (time synchronization).
More rate is not free. Data grow as channels times rate times bits, every sample has to cross a serial bus in its slot, and the processor has to finish its work within each period.