Method and apparatus for adaptive noise cancellation