Fixed the threshold filter

Threshold Filter was not working due to problems in calculating the
RMS. This should be fixed now by editing the RMS function in
functions.py