Acoustic filters, or mufflers, are used in a number of applications for suppression or attenuation of sound. These mufflers use pipes with side branches and/or Helmholtz resonators thus routing the flow through a number of passages wherein the waves are partially reflected resulting in sound power attenuation. With the idea of using a pipe for active noise cancellation to reduce cabin noise in propeller aircraft, we define an objective function that maximizes sound pressure (or other criteria) at a given frequency f0 while minimizing (attenuating) the pressure at other harmonics m1 f0, m2 f0 etc. within the frequency band. Thus, the device can be used to generate anti-noise at the first harmonic, while attenuating noise at higher harmonics. A design tool is developed here using an optimization technique. Plane wave propagation is assumed. A choice of objective functions can be user-specified. Details of the design parameters and objective functions are given followed by acoustic analysis details. Test results are then given which show that the code can be used as a valuable design tool for noise reduction.