Active attenuation of noise in ducts