Time series data shows up at all sorts of intervals from all sorts of sources. A meter might report every minute, a setpoint every five, a daily total once a day. To chart, calculate, or compare any of it side by side, you almost always need to align it to a common grid.
Two techniques do most of that work. Folding collapses many points into one (downsampling). Interpolation stretches a few points into many (filling gaps). They're common enough that most time series databases ship them as first-class operations on history queries.
Folding
Folding (also called aggregating or rolling up) takes many values in a time range and reduces them to a single representative value for that range. The fold function decides what "representative" means: a sum, an average, a minimum, a maximum, and so on.
Below are ten 1-minute energy readings folded into two 5-minute windows. The same raw data produces very different folded values depending on the function chosen.
Ten 1-minute readings folded into two 5-minute windows. Switch the fold function and watch the dashed line redraw.
Add every value in the window.
Which function to use depends on the data type. Sums make sense for consumption (kWh used over the window); averages for sampled quantities (mean temperature); min and max for envelope analysis (peak demand, lowest pressure). Booleans don't average meaningfully, so for those you'd typically fold by first, last, or whichever value held the longest.
Interpolation
Interpolation is the inverse: a handful of known values stretched into many. It's how you fill gaps between sparse readings, or upsample a coarse trend onto a finer grid.
There are three common approaches, and the right one depends entirely on what the data represents:
Three known points at minutes 0, 5 and 10 (5 kWh, 10 kWh, 5 kWh) give visibly different shapes under each method. Linear draws a sawtooth between them, change-of-value steps up and back down, and apportion redistributes the totals into per-minute portions:
Three known points (yellow) at minutes 0, 5 and 10. Switch methods to see how the gaps get filled.
Why it matters
Picking the wrong fold or interpolation silently distorts every downstream calculation. Average a meter reading you should have summed, or linearly interpolate a setpoint that should have held, and the numbers further down the pipeline are simply wrong, often without warning. Aligning data to a common interval is the quiet pre-step that decides whether the chart on the dashboard tells the truth.