Does Edge Impulse Scale Data once uploaded?

This post was flagged by the community and is temporarily hidden.

@notheruser - to answer the question in the title of the post, no, Edge Impulse doesn’t scale the data once it is uploaded. The only processing that happens to the data is based on the impulse you have defined (input block and processing block).

I know as a new forum user you were probably limited in the amount of photos you could post. Could you please share the two plots (the one shown in Studio and the one you have created yourself) for the same data sample. Let’s figure out what’s going on here.

This post was flagged by the community and is temporarily hidden.

This post was flagged by the community and is temporarily hidden.

This post was flagged by the community and is temporarily hidden.

Thanks for following up @notheruser (I didn’t get any notifications for your previous two posts, just the one where you tagged me). I’m going to ask the rest of the team about this one. Hang tight!

1 Like

Yes, it does appear that if you don’t upload a 16 bit wav (which is the typical precision), we’re rescaling it to 16 bit. The example you should tracks: the peak in the beginning of the frame is ~260,000. So 260,000 / 2^24 is about 0.15, so 0.15 max scale * 2^16 = ~1000, which you can see in the second graph

So if you have a true 24 bit input in deployment, and you can’t change that at the driver level, then just scale before calling run_classifier / get_data(). Scale like so: * 2^16/2^24. Or do the same thing with a bit shift (though the compiler almost always will see the optimization and do it for you in -O1 or better.

Another sanity check here: If you ever want to be sure how your data should look on device, take a look at “Raw Features” anywhere in Studio (ex: DSP screen, shown here)
image

1 Like

As I was thinking about filing an issue for this, I actually think this is the right choice in most cases. Users may upload wav files from different sources and they may be encoded differently, which will artificially change their classifier if we don’t scale to a standard precision. 16 bits is a good choice. Most wav is 16 bits and most deployments will be 16 bits. And even if you carry around 24 bits of precision, something in the ADC chain will likely not have that much precision, so you’ll effectively have “fake bits”.

There is a workaround: If you really have 24 bits on device (check your datasheets!), then you can upload via json instead of wav and Studio won’t do any scaling. You’ll lose the ability to play the samples in studio, but otherwise everything else will behave the same.

1 Like