nickgillian / grt

gesture recognition toolkit
856 stars 286 forks source link

PreProcessing is not working #94

Open codeflakes0 opened 7 years ago

codeflakes0 commented 7 years ago

Are the PreProcessing examples supposed to work ? I've tried them and I don't think LowPass, HighPass and FFT filters work as the code compute the output on each single data point instead of analysing the whole sample. You can test it by compiling it you can see that HighPassFilter example always return 0, no matter what frequency is passed as output.

cyberluke commented 7 years ago

FFT works for me. Maybe you have to set something like CutOff threshold (music terminology) for HighPass or try to send different values for the input. And it works per sample mostly if there is no buffering option like in FFT for example. I tried also FFT feature extraction.

nickgillian commented 7 years ago

Hi codeflakes0 ,

Can you give us some more info on how you are trying to use the PreProcessing examples?

The idea behind all the PreProcessing modules is that the input to the algorithm represents a single time sample (either for a 1 dimensional signal, like a pressure sensor, or an N-dimensional signal, like a 3-axis accelerometer for example). The algorithms will then filter this signal over time, storing the previous X time samples internally in the class as needed (e.g., the last 10 samples for a moving average filter with a buffer size of 10).

The reason for this design is so the algorithm can be used in real time, as opposed to most tools, where you run the algorithm offline and give it the entire timeseries in one buffer (e.g., like how you would filter in Matlab).

codeflakes0 commented 7 years ago

Hello Nick,

What you describe is indeed how I understood the preprocessing principles and I've been trying to use it accordingly. I've had good results with the DeadZone, and Derivative gives me results (which I didn't check if they were correct but at least I get results). But once I try to use the LowPass and HighPass I got nothing. LowPass seems to have no effect on the input signal, HighPass returns always zero. I tried it with a sinusoid signal to try to reproduce your wiki sample results. As a last resort I compiled and ran you own example without any modification and HighPassFilterExample returns always zero which is not what it should be if I understand the code and the comments correctly.

codeflakes0 commented 7 years ago

I'm stuck on this problem. Can anyone confirm that the HighPassFilterExample returns this kind of output ? Why are all the filtered value 0 ?

0.000628318 0 0.00125664 0 0.00188495 0 0.00251327 0 0.00314159 0 0.0037699 0 0.00439822 0 0.00502653 0 0.00565484 0 0.00628314 0 0.00691145 0 0.00753975 0 0.00816805 0 0.00879635 0 0.00942464 0 0.0100529 0 0.0106812 0 0.0113095 0 0.0119378 0 0.012566 0 0.0131943 0 0.0138226 0 0.0144508 0 0.0150791 0 0.0157073 0 0.0163356 0 0.0169638 0 0.017592 0 0.0182202 0 0.0188484 0