Added signal filtering
Moved code from playground