Spike timing-dependent plasticity as dynamic filter