A field guide / signals from the physical world
Every sensor is a storyteller that can only say numbers, one at a time, forever. This is a plain-language tour of how those numbers become a time series, what hides inside them, and how machines learn to listen, all the way from a single sample to a remaining-useful-life estimate running on a chip.
Section 01
A time series is the simplest idea in data, dressed up in a fancy name: it is a list of measurements, written down in the order they happened. Your morning weight on a bathroom scale, the temperature outside each hour, the price of a stock each minute, the vibration of a spinning motor a few thousand times a second. Same shape every time: a value, and the moment it was taken.
What makes it special is the order. If you shuffle a spreadsheet of customer names, you lose nothing. If you shuffle a heartbeat trace, you destroy it. In a time series the position of each number is information. Tomorrow depends on today.
The sensor's point of view
A sensor cannot see, hear, or feel the way we do. It does exactly one trick: it converts some physical quantity into a number it can repeat over and over. A thermocouple turns heat into a voltage. An accelerometer turns motion into a charge. A current clamp turns magnetic field into amps. Sensory data is just the world translated into a stream of numbers in time. The whole craft of working with it is learning to translate back.
Once you see it this way, a surprising amount of the world is a time series waiting to be read. The strip chart at the top of this page is one: a vibration signal scrolling left as fresh samples arrive on the right, exactly how a condition-monitoring dashboard would show a bearing or a gearbox.
One single measurement: a value plus its timestamp. The atom of a time series.
How many samples per second. Written in hertz (Hz). 50 Hz means 50 numbers every second.
One stream from one sensor. A car logs hundreds of channels at once: speed, temperatures, currents, pressures.
A short slice of recent history, say the last 2 seconds, that we analyze as a unit.
Section 02
The physical world is smooth and continuous. A vibrating shaft does not move in steps; it sweeps through every position in between. But a computer can only store numbers it has actually looked at, at specific instants. The act of looking at fixed intervals is called sampling, and how often you look is the single most important decision you make about a signal.
Look often enough and the dots trace the true wave. Look too rarely and something strange happens: a fast wave can disguise itself as a slow one. The samples line up on a completely different, slower curve that was never really there. This illusion is called aliasing, and it is the classic trap of sensory data.
The rule that saves you has a name, the Nyquist criterion: to capture a wave honestly, you must sample at least twice as fast as the fastest frequency in it. Sample a 10 Hz vibration and you need at least 20 samples per second, and in practice quite a bit more. Drag the sliders below and watch the alias appear the moment you cross that line.
Practical note · pick your rate from the physics
Choose a sampling rate from what you are trying to see, not from what is convenient. For bearing fault frequencies in the kilohertz range you may sample at 20 to 50 kHz; for a slow thermal drift, once per second is plenty. When in doubt, oversample and an anti-alias filter (an analog low-pass filter before the converter) removes content above half the sampling rate so it cannot fold back and lie to you.
There is a second, quieter trade happening at the same instant. The converter does not store infinitely precise values; it rounds each one to the nearest rung on a ladder of allowed levels. This is quantization, and the number of rungs is set by the converter's bit depth. An 8-bit converter has 256 levels; a 12-bit one has 4096. The rounding error you cannot avoid sets the noise floor of everything downstream, and each extra bit buys you about 6 dB of headroom. Drop the bit depth below and watch the smooth wave turn into a staircase, with the leftover error shown as its own little signal.
Section 03
Before any clever analysis, real sensory data needs a wash. Samples almost never arrive on a perfect clock. Timestamps jitter, different channels run at slightly different rates, packets show up out of order, and sometimes the sensor simply goes quiet for a while. Most painful bugs in a monitoring system trace back not to the values but to time: two channels that look correlated only because they were silently misaligned, or a gap that a model quietly read as a run of zeros.
The fix is to put everything onto one even, shared time grid by resampling, and to decide on purpose what to do with the holes. The three common choices each tell a different small lie. Forward-fill repeats the last known value, which is honest for a setpoint but wrong for a fast signal. Linear interpolation draws a straight line across the gap, smooth but invented. Leaving the gap is the most honest, but every downstream step then has to cope with missing data. Toggle between them below over a stream with jittered timing and a dropout.
Practical note · keep the metadata with the data
A raw count is not a temperature. Carry the calibration, scale, zero-offset, units, and the true sampling rate alongside every channel, and sanity-check ranges before anything else. A pressure of negative one thousand is almost always a wiring or scaling error, not physics. And when you fill a gap, keep a flag marking which points were measured and which were invented, so later stages can choose to trust them or not.
Section 04
A raw sensor trace looks like a mess, but it is usually a mess made of a few simple ingredients stacked on top of each other. A useful first move is to imagine pulling them apart. Most signals are some combination of:
The slow drift up or down. A motor warming up over minutes, a battery discharging, a filter slowly clogging.
Anything that repeats: the rotation of a shaft, a daily cycle, the firing of an engine. Also called seasonality.
The fast, random jitter with no pattern. Electrical pickup, sensor grain, quantization, the world being busy.
This split is more than tidy bookkeeping. Each ingredient tells a different story to a diagnostic engineer. A rising trend may mean wear or fouling. A change in the periodic part often points to a specific rotating component. A jump in the noise level can mean a loose connection or a failing sensor. Below, build a synthetic signal by mixing the three and watch how the personality of the trace changes.
A signal whose ingredients stay put over time, the same average level, the same wobble, is called stationary. One whose character keeps shifting, a growing trend or a wobble that gets wider, is non-stationary. The distinction matters because many of the easiest tools assume stationarity, and a slow drift can quietly break them. A common fix is differencing: instead of the value itself, work with how much it changed since last time, which often flattens a trend away.
Section 05
So far we have watched signals as a line moving through time. There is a second, almost magical way to look at the same data. Any repeating signal, no matter how jagged, can be rebuilt by adding together pure sine waves of different speeds. List how much of each speed is present and you have the signal's spectrum: its recipe in terms of frequencies. The mathematical machine that computes this is the Fourier transform, and its fast computer version is the FFT.
Why bother? Because faults love to hide in the frequency view. A worn gear, an unbalanced fan, a cracked rotor bar each ring at their own characteristic frequency. In the time trace they all blur together into one wobble. In the spectrum they stand apart as separate spikes, each one a suspect with an address. Build a signal from a few tones below and watch the spectrum pick them out.
Practical note · the price of the spectrum
The FFT is not free of trade-offs. You compute it over a window, and a short window gives blurry frequency resolution while a long window blurs when things happened. Cutting a window also creates fake edges that smear energy across the spectrum, so we taper the ends with a window function (Hann, Hamming, and friends) before transforming.
A single FFT assumes the recipe holds still for the whole window. Real machines do not oblige: a motor runs up, a fan coasts down, a fault comes and goes. The spectrogram handles this by computing an FFT on a short window, sliding it forward a little, and stacking the results into an image, time across the bottom, frequency up the side, brightness showing how much energy is present. A steady tone draws a flat horizontal line; a run-up draws a rising diagonal ridge. Sweep the start and end frequency below and watch the ridge tilt.
Section 06
The frequency view assumes the machine holds a steady speed. Rotating machinery rarely obliges. During a run-up or under varying load the shaft speed sweeps, and so do all the vibration components tied to it: the once-per-rev imbalance, the gear-mesh tone, the bearing rates. A plain spectrum of such a record is a smear, because every fault frequency wandered across the bin while you were measuring.
The fix is to stop measuring in time and start measuring in angle. With a tachometer giving shaft position, you resample the signal onto a grid of equal shaft increments rather than equal time steps. In that angular domain a component locked to the shaft sits at a fixed order, an integer multiple of rotation, no matter how the speed varied. The smear collapses into sharp lines. The simulation runs a speed ramp with components at orders one, two and three; compare the blurred time-domain spectrum against the crisp order spectrum after angular resampling.
Section 07
Sensory data has memory. The temperature now is a good guess for the temperature a second from now; a heartbeat now hints at the next beat's timing. Autocorrelation measures exactly this: how much a signal resembles a time-shifted copy of itself. Shift the signal by a small lag, slide it over the original, and ask how well they match. Do this for every lag and you get a curve that reveals the signal's rhythm.
A purely random signal looks like nothing but itself, so its autocorrelation is a single spike at zero lag and flat everywhere else. A periodic signal, by contrast, lights up again at lags equal to its period, and at multiples of it. That makes autocorrelation a quiet, robust way to find a repeating beat even when it is buried in noise, which is why it underpins pitch detection, heart-rate estimation, and rotating-machinery diagnostics.
Section 08
Raw sensory data is rarely usable as it arrives. Noise hides the trend you care about; an occasional glitch throws off any average. Filtering is the family of techniques for keeping the part you want and suppressing the part you do not. The simplest and most common is the moving average: replace each point with the average of itself and its neighbours in a small window. Wider window, smoother result.
But smoothing always costs something. A wide moving average is sluggish; it lags behind sudden changes, so a real step in the signal arrives late and softened. An exponential moving average (EWMA) is a popular middle ground that weights recent samples more heavily, reacting faster while still calming the noise. Choosing how much to smooth is a permanent tug of war between a clean line and a responsive one.
Beyond the moving average
Moving averages are low-pass filters: they keep slow changes and drop fast ones. The same idea generalizes to high-pass filters (keep the fast, drop the slow, good for spotting sudden events), band-pass filters (keep only a chosen frequency band, good for isolating a known fault frequency), and median filters that excel at removing isolated spikes without smearing edges. Each is just a different rule for combining nearby samples.
Section 09
Smoothing was a blunt instrument; a real filter lets you keep exactly the band you want and reject the rest. The Butterworth design is the workhorse, prized for a magnitude response that is maximally flat in the passband with no ripple, rolling off ever more steeply as you raise the order. Pick a shape, lowpass to keep the slow trend, highpass to isolate the vibration, bandpass to zoom on a resonance, set the cutoff and the order, and you have shaped the spectrum deliberately.
The cost of a sharper roll-off is a longer filter and more phase distortion, which is why offline analysis often filters forward and backward to cancel the phase shift. The simulation draws the Butterworth magnitude response you design, then applies it to a test signal that mixes a slow component, a fast one and noise, so you can watch the unwanted parts vanish as you tune the filter.
Section 10
Envelope analysis, next, only works if you band-pass the signal around the right resonance before demodulating. Choose the wrong band and the bearing impacts stay buried. Spectral kurtosis answers the question of which band by measuring, frequency band by frequency band, how impulsive the signal is there. Kurtosis is the statistic that spikes when a signal has occasional large bursts against a quiet background, exactly the fingerprint of a bearing impact buried in noise.
Sweep a filter bank across the spectrum, compute the kurtosis of each band-filtered signal, and the band with the highest kurtosis is the one where the impacts ring loudest relative to the noise. The full method tiles a frequency-versus-bandwidth plane into the kurtogram; the simulation shows the essential one-dimensional version, scanning bands and crowning the most impulsive one as the band to hand to envelope analysis.
Section 11
Here is a technique that feels like a magic trick the first time you see it work, and it is the bread and butter of bearing diagnostics. A damaged bearing does not hum at the defect frequency directly. Instead, every time a rolling element strikes the tiny spall on the race, it rings the whole structure like a bell at a high resonance, thousands of hertz up. What carries the diagnosis is not that ringing but its rhythm: the bell gets struck once per defect period. The defect frequency rides as a slow modulation on a fast carrier.
Plain spectrum analysis often misses this, because the energy is smeared around the high resonance, far from the low defect frequency you actually want. Envelope analysis recovers it in three moves: band-pass around the resonance to isolate the ringing, take the envelope (the slow outline of the bursts, found by rectifying and smoothing), then run an FFT on that envelope. The defect frequency, invisible before, now stands up as a clean peak with harmonics.
Section 12
Some faults announce themselves not as a single tone but as a whole family of evenly spaced lines: a gear mesh ringing at its fundamental and a long train of harmonics, or a bearing tone flanked by sidebands from amplitude modulation. The spectrum shows a picket fence of peaks, and reading the spacing by eye is fiddly. The cepstrum turns that family into a single peak.
The trick is to take the spectrum of the log spectrum. A regular comb of harmonics spaced by some frequency is itself periodic along the frequency axis, and a second transform of the log magnitude finds that period, placing a peak at a quefrency equal to one over the spacing. Whole harmonic families collapse to one clear marker whose position reads off the spacing directly. The simulation builds a fundamental with many harmonics and sidebands, then shows the comb in the spectrum and the single rahmonic peak in the cepstrum.
Section 13
A machine learning model rarely eats a raw waveform. Thousands of wiggling samples are too many, too redundant, and too sensitive to exactly when you started recording. Instead we summarize each window of signal into a short list of meaningful numbers called features. Good features are compact, they survive small shifts in timing, and they change in a way that tracks the health of the thing being measured.
Features come in two big families. Time-domain features are statistics of the raw values: the mean, the spread (standard deviation), the peak, and shape numbers like root-mean-square, crest factor, and kurtosis that are sensitive to spiky impacts. Frequency-domain features come from the spectrum: the energy in specific bands, the location of the dominant peak, the total power. A typical condition-monitoring system computes a few dozen of these every window and lets a model watch them drift.
Figure 14. Windowing turns an endless stream into a steady drumbeat of fixed-length feature vectors, the format almost every downstream model expects.
Section 14
One sensor is a single point of failure. When it drifts or dies, a system that trusts it blindly will confidently act on a lie. The cure is redundancy: measure the same quantity with several sensors and combine them. Combining is called sensor fusion, and at its simplest it is just an average that beats down noise. The deeper payoff comes when one sensor goes bad.
With two sensors you can detect a problem, because their difference, the inter-channel residual, suddenly grows, but you cannot tell which one is wrong. With three you can vote: take the median, and a single faulty sensor is automatically outvoted by the two healthy ones while the others carry the estimate. This triple-redundant median trick is everywhere in safety-critical systems, from flight controls to brake pressure. Inject a fault into any of the three channels below and watch the median shrug it off.
Section 15
Once a window is boiled down to a feature vector, a model turns it into a decision. Three shapes of model cover most of monitoring, and which one you reach for depends entirely on what you already know about the failures you are looking for.
Learns only what healthy looks like, then flags anything far from it. Needs no fault examples, which is lucky, because real faults are rare. Answers: is this normal?
Learns to name the fault when you have labelled examples of each kind. Answers: which fault is this, inner-race, outer-race, imbalance?
Learns to predict a number, most usefully a health index or the remaining useful life. Answers: how bad, and how long left?
The honest order of preference in the field is usually anomaly detection first, because healthy data is abundant and faults are not. You graduate to classifiers and regressors only once you have collected enough real failures, or trustworthy simulations of them, to learn from. Whatever the choice, the model sits in the same slot of the pipeline.
Figure 16. The same feature vector can drive three different jobs. Most programs start at the top, where no fault examples are needed, and work down as failure data accumulates.
Section 16
An earlier section learned what healthy looks like from data. There is an older, complementary idea: if you have a physical model of how the system should behave, run it alongside the real one and watch where they disagree. That disagreement is the residual, and a model that maintains a running estimate while comparing it to each new measurement is an observer. The most famous observer is the Kalman filter.
The Kalman filter works in a loop of two steps. It predicts where the signal should go next from its model, then corrects that prediction using the new measurement, trusting each source in proportion to how noisy it believes them to be. The gap between prediction and measurement is the innovation, a residual that is small, white noise when the model fits and the sensor is healthy, and which jumps the moment either assumption breaks. Tune how much you trust the sensor against the model below and watch the estimate firm up or chase the noise.
Section 17
However you produce a residual, by subtracting a learned model, an observer, or a redundant sensor, the same final question remains: when is it big enough to act on? The simplest answer is a threshold, usually a few standard deviations away from the normal residual level. Cross it and raise an alarm. Set it too tight and you drown in false alarms that get ignored; too loose and you miss the real fault. That balance, false alarms against missed detections, is the central tension of every monitoring system. The simulation injects a slow drift fault so you can tune the threshold yourself.
A fixed threshold is deaf to small, slow drifts: each individual point stays inside the band even while the mean creeps upward. CUSUM, the cumulative sum, fixes this by adding up how far the signal sits above its expected level, sample after sample. A tiny persistent bias that never trips a threshold accumulates into a large running total that eventually does. CUSUM trades a little reaction time for the ability to catch drifts a threshold would sleep through. Shrink the shift below until the plain alarm above would miss it, and see CUSUM still fire.
Section 18
Detecting that something is wrong is diagnostics. The richer, more valuable goal is prognostics: estimating how much useful life is left so maintenance happens before the breakdown, not after. The trick is to distil the machine's condition into a single health indicator that trends steadily toward a known failure level, then fit that trend and project it forward. Where the projection crosses the failure line is the predicted end of life; the distance from now to there is the remaining useful life, or RUL.
The honesty of prognostics lives in its uncertainty. Early on, with little of the degradation curve observed, the projection is a wild guess and the confidence cone is wide. As more of the curve comes in, the fit tightens and the cone narrows, so the RUL estimate sharpens just as the decision becomes urgent. Slide the observation window below from early to late and watch the forecast and its cone converge on the truth.
Why the residual you built earlier matters here
The same residual that tripped an alarm today becomes, tracked over weeks, the degradation curve you extrapolate. Diagnostics and prognostics are not separate machines; they are the same signal read at two timescales. A good health indicator is monotonic, robust to operating conditions, and traceable to a physical wear mechanism, which is why feature engineering and domain knowledge matter as much as the forecasting math.
Section 19
Much of the time this whole pipeline does not run in a comfortable data centre. It runs on a microcontroller bolted to the machine, the edge, where every resource is rationed. There is rarely the bandwidth to ship raw high-rate vibration to the cloud, the power budget to run a large model, or the memory to hold more than a few seconds of history. So the pipeline is reshaped around three hard budgets.
Often a few hundred MHz and a fixed milliwatt budget. Heavy math like long FFTs is scheduled carefully or pushed to a hardware accelerator.
Kilobytes, not gigabytes. The signal lives in a small ring buffer that overwrites itself, and only features survive, not the raw stream.
Floating point is expensive. Models are quantized to 8-bit integers (INT8), shrinking size and energy roughly fourfold for a small accuracy cost.
The design pattern that falls out of these limits is to extract features as early and as cheaply as possible, so the expensive part of the system sees a trickle of small vectors rather than a torrent of samples. A compressed INT8 model then makes the call on-device, and only a decision, an alarm, a health index, the occasional snapshot, ever leaves over the network. This is why everything earlier in this guide, the windowing, the cheap statistics, the careful choice of sampling rate, is not academic: on the edge it is the difference between a system that fits and one that does not.
Figure 21. The edge pattern: keep the firehose of raw data local, send only the conclusion.
Section 20
Put the pieces together and a sensory-data system is a relay race. The physical quantity is handed off through conditioning, conversion, cleaning, and feature extraction before any model or human sees it. Each stage throws away some information on purpose, keeping only what the next stage needs. Here is the whole path on one diagram.
And a decision rarely ends the story; it feeds a control loop. The classic condition-monitoring loop reads the sensor, decides whether the health indicator has crossed a line, and routes to the right response. Drawn as a flowchart it looks like this.
Section 21
A handful of lessons recur across almost every project that turns sensory data into decisions. None of them are glamorous and all of them are expensive to learn the hard way.
The one-sentence summary
Treat a sensor as a translator that turns the physical world into ordered numbers, respect the limits of that translation (how fast you sampled, what you rounded away, what you filtered out), and most of working with sensory data becomes a careful, honest conversation between the signal and the question you are asking of it.
Section 22
References are pointers for further study; the explanations and simulations above are written from first principles rather than drawn from any single source.