Using functions from `filters.hpp` in custom preprocessing

I’we built my own preprocessing module, as outlined in the video
here, my preprocessing makes use of optional highpass filtering, which is rather easily implemented when bulding the custom block in the browser based impulse and running in the browser.
Now after implementing my custom function in C, i would like to make use of the already implemented filter functions availibe as part of the EI DSP libraries, theres’ a butterworth_highpass function availible in edge-impulse-sdk/dsp/spectral/filters.hpp, - now how do i properly make use of this function, in my C impulse. Im guessing it has to do with attaching it in impulse->dsp_blocks, somehow ?

First, you must pull the Edge impulse C++ SDK from the studio deployment page. as you use a custom DSP block, the studio will provide you with a raw block in the C++ pipeline as a default one that does nothing. Also, I would recommend checking that by going to model-parameters/model_variable.h and you should see an ei_dsp_config_raw_t struct that is declared.

Second, if all of the above is good then you can use the function butterworth_highpass directly from your main function, you need to pass your raw feature matrix to src and recover it from dest.

If you need any example of how to use our SDK in a main function you have the following examples depending on what are you working at, an MCU or an MPU device:

For MPU:

For MCU:

Let me know if this make sense to you

Best,
Omar

Hi Omar, thanks, makes sense, and provides me with the results i neeed :slight_smile:

1 Like