advanced noise filtering

see the comments in NoiseFiltering.java
the code got messy though - it should be cleaned up ASAP