How to add Band pass filter and use external feature extraction

Question/Issue:

Project ID:

Context/Use case:
How can i add the Band pass filter for the combination of the LOW pass and HIGH pass at the same time
and i wanted to also to include different type of feature extraction such as Standard deviation,Variance,Mean Absolute Value and etc…

This is not something supported at the moment. If you want to implement a band pass filter, you can create your own processing block.
Otherwise for the std variation, mean value,… the Flatten block should cover most of it. You can have this block + the spectral features one in parallel.

@aurelim im not really expert on how can i adjust the code of the custom block i’ve tried to make it like this but i dont know what else i could modify in the code


Is there anyone who could elaborate more on how I can adjust the custom block to add the bandpass filter and notch filter? I’m not knowledge about python programming. However, For the feature, extraction is it possible to add a different feature in the spectral feature

@aurel Even if one could build a custom processing block that does low pass filtering inside the Impulse, once the Model gets deployed to the microcontroller (MCU) and sensor data is collected it would need to be filtered on the MCU so the data being fed to the Model is similar to what it got trained on, correct?

Likewise for images, an Impulse uses the Image Block to convert all incoming data to say 96x96. So, if a Model gets trained on 96x96 images, then the running Model on a MCU must be fed 96x96 images, correct?

@MMarcial,

That’s correct. You can read more about how to develop the corresponding embedded code here.

Aurelien

@aurel
you answered his concern and you ignored mine haha

@Joker147 I was looking for clarification before answering you… The path forward is to filter the data before uploading to Edge Impulse. Then on your MCU, read the sensor, implement the same filter, then feed that to the trained classifier running on the MCU.

@MMarcial
The data i got it from the internet

The write-up Aurel suggested shows how to add a custom block as well as something known as a cppType to help one implement the methods in the custom block on the MCU. I was able to get the code in the write-up working with the help of code here (things in the write-up are old or outdated but in general it can be used as a guide).

So based on this I think I could get a bandpass filter working along with statistical metrics added as features. Can someone point me to specific lines of code in EI github that show how to add features to labels as suggested here.

@Joker147 make your project public so I can get a copy of you data or point me to the internet location.

I made the project to the public here is the project id=138551
Aurel did not clarify whether it possible to add different feature extraction or not there are many other features i wanted to test it

Aurel lead us to the answer in the write-up. See Section 3.1. So any component that can be extracted from the signal can become a Feature.

@MMarcial So in order to add any features i need to add them in the C++ files

Features get generated in a Processing Block. See the code here Spectra Analysis Processing Block.

So I think you path forward is to download the Spectra Analysis Processing Block file, dsy.py, and follow the write-up Aruel’s suggested to get your Custom Processing Block running. Once is is running, then you can add all the Features you can think of. Put you additional code near where the Skew and Kurtosis is being calculated.

The C++ comes in when you deploy the Model. I need to ask the Forum more about using the cppType.

The project does not seem to be public. I get User does not have access to project 138551.

@MMarcial


Is it the right way to make it public?

@Joker147 This is strange. Tthe screenshot shows the Clone button so that means the project is Public.

@Aurel Why can’t I see the project?

https://studio.edgeimpulse.com/public/138551/latest

@Joker147 I created a down-n-dirty Custom Processing Block that executes a Lowpass filter and a Notch Filter along with some summary statistics as Features. The code is here.

1 Like

So i can just clone it immedieitly ?
Did you managed to access to my project ?

What you did here is abslousltrly unbelievable I don’t know how I can appreciate you with this much effort