Cihan Keser
Cihan Keser

Reputation: 3261

Detecting a spike in an input signal using Java

I'm working on a project where, I need to control the mouse cursor by some accelerometer input. I'm using Java and have already completed the data collection part and I can move the mouse according to accelerometer input successfully.

I also need to support mouse click events which are triggered by a sudden movement. So; this sudden movement creates a spike in the input signal (a wide one, not just single point). How can I detect such a spike using Java?

Upvotes: 1

Views: 653

Answers (1)

Ali
Ali

Reputation: 58451

A properly tuned high-pass filter could do it, depending on your application. Really simple, 1 line of code.

High-pass filter

Upvotes: 1

Related Questions