Is this reverse interpolation?

39 Views Asked by At

I have a large number (say 3000) of sensor data taken at equally spaced time intervals (concretely the reflectivity of a sensor passing over an EAN13 barcode).

I want to transform this vector (array) of length 3000 to an array of length 95 containing the numbers 1 or 0 (representing the 95 black and white lines in the barcode).

If the number of data was a multiple of 95 such as 950, I would average the first 10 data points and map the result to either 1 or 0 depending on a cut off. Then I'd do the same with points 11 to 20 etc.

How would I go about doing this for a number that is not a multiple of 95?

Naively I would average over 3000/95=31.5 data points, i.e., I would take 31 points and the 32nd with half weight.

Is this a good idea? Are there better ways? Does such transformation have a name?