demod and lpfilter, except using cos instead of exp