Changed code to output filtered signal