Preparing the input features for the model inference
As we know, the model’s input features are the scaled and quantized temperature and humidity of the last three hours.
In this recipe, we will see how to prepare this data on the microcontroller. In particular, this recipe will teach us how to acquire, scale, and quantize the sensor measurements and keep them in temporal order using a circular buffer.
Getting ready
Our application will acquire the temperature and humidity every hour to get the necessary input features for the model. However, how can we keep the last three measurements in temporal order to feed the network the correct input?
In this recipe, we will use a circular buffer, a fixed-sized data structure that implements a First-In-First-Out (FIFO) buffer.
This data structure is well suited to buffering data streams and can be implemented with an array and a pointer that indicates the location in memory where...