this is a classic signal processing problem