Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returns NaN when filtering. #4

Closed
JoziGila opened this issue Jun 1, 2017 · 2 comments
Closed

Returns NaN when filtering. #4

JoziGila opened this issue Jun 1, 2017 · 2 comments

Comments

@JoziGila
Copy link

JoziGila commented Jun 1, 2017

I have setup a filter with the parameters (4, 30, 140, 200) for heartbeat filtering from camera brightness variation. However the returned value is NaN for each of the numbers I feed into it.
Butterworth butter = new Butterworth(); butter.bandPass(2, 29, 140, 200); for (Double val: brightness){ processed.add(butter.filter(val)); }

@berndporr
Copy link
Owner

berndporr commented Jun 1, 2017

You have a sampling rate of 29Hz, a centre frequency of 140Hz and a bandwidth of 200Hz?
Check out:
https://github.com/berndporr/iirj/blob/master/src/test/java/uk/me/berndporr/iirj/DetectorTest.java#L52
for an example config:
butterworth.bandPass(2,250,20,15);
...and of course the README and documentation which explain the parameters.

@JoziGila
Copy link
Author

JoziGila commented Jun 1, 2017

I actually don't really know much about DSP and just wanted to find an implementation of butterworth because it was mentioned in a paper that it's used to filter unwanted frequencies such as finger movement from the signal. So even though I have read the doc I don't understand the parameters. My intuition was wrong I guess, I though that sampling rate is the rate of sampling of the signal (29-30fps from the camera), and since the frequencies I want are between 40-230 Source, I interpreted the remaining parameters as 140 (mean of 240 and 40) and the width (+100, -100). Anyways thank you for the quick response, I'll read a bit more about signal processing.

@JoziGila JoziGila closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants