How can I increase the number of samples in the raw input inside the variable below?
static const float features[] = { }
I would like to create a kind of “local database”, where my input has 16 values and the microcontroller would test all these features, showing the result generated from “run_classifier( )”. I am not using a sensor, so I would like to emulate a sensor behaviour in this case.
For example, I would like to have this kind of entry:
static const float features[] = {
// LABEL A
1383.6400, 1380.6800, 1376.6900, 1375.4900, 1374.0100, 1373.7300, 1372.4500, 1370.8200, 1370.8500, 1370.8400, 1371.6800, 1373.7300, 1374.6255, 1383.6400, 1370.8200, 4.2495,
// LABEL B
299.8100, 497.9900, 686.2500, 844.8600, 821.4100, 818.4800, 664.6500, 460.3900, 256.3200, 52.4600, 20.4300, 497.9900, 493.0045, 844.8600, 20.4300, 302.6931,
// LABEL C
1467.0900, 1464.7800, 1464.5800, 1378.7000, 1036.0900, 191.5400, 63.6800, 181.5000, 181.5900, 514.5200, 122.8700, 514.5200, 733.3582, 1467.0900, 63.6800, 623.5187,
//LABEL D
12.0000, 13.0000, 13.0000, 11.0000, 11.0000, 13.0000, 12.0000, 12.0000, 11.0000, 12.0000, 11.0000, 12.0000, 11.9091, 13.0000, 11.0000, 0.8312
}
I am using this firmware Edge Impulse Example: standalone inferencing as a base, and this variable is located in the /app.cpp
#include "edge-impulse-sdk/classifier/ei_run_classifier.h"
#include <cstdio>
// Raw features copied from test sample
static const float features[] = {
// Copy raw features here (e.g. from the 'Model testing' page)
};
I tried to change the define in the metadata of this variable from my model generated in Edge Impulse
EI_CLASSIFIER_RAW_SAMPLE_COUNT
which set the sample count from 1 to 4 (as the example that I would like to try, previously mentioned), but it is not working.
#ifndef _EI_CLASSIFIER_MODEL_METADATA_H_
#define _EI_CLASSIFIER_MODEL_METADATA_H_
#include <stdint.h>
#include <stdbool.h>
#define EI_CLASSIFIER_NN_INPUT_FRAME_SIZE 16
#define EI_CLASSIFIER_RAW_SAMPLE_COUNT 1
#define EI_CLASSIFIER_RAW_SAMPLES_PER_FRAME 16
#define EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE (EI_CLASSIFIER_RAW_SAMPLE_COUNT * EI_CLASSIFIER_RAW_SAMPLES_PER_FRAME)
For some reason the microcontroller is not reading more than 16 raw values and not moving to the next 16 values continuosly. Can somebody help me with that?