dds sine wave frequency changing

OK, I hear two things: some hiss, and some soft, changing musical tones. The tones seem to alternate from something less than a whole tone below the foreground note to maybe about a minor third above it. The pattern seems to repeat. Those tones are very faint, though, and I could be wrong about their pitches.

I'll suggest that you try recording a couple of seconds of audio four ways, as an experiment:

  1. With the Arduino connected, and running its program, with the output pin's mode set to output, but with the PWM turned off
  2. With the Arduino connected, and running its program, with the output pin's mode set to input, with the PWM turned off
  3. With the Arduino connected, but with its power supply disconnected, and
  4. With nothing connected. You may have to plug in a cable to the sound card to convince it that something's there.

if you're feeling especially curious, you could try letting the PWM run, and connecting the output to a different, quiescent digital output, and then to a quiescent digital input, and see what happens then, too.

I won't ask you to post those files, because that amounts to a whole lot of data. But, I'll ask you to listen to them, to find out whether those effects are showing up without the PWM operating. I'm thinking that they may artifacts of the programs running on the Arduino or the PC, or of the power supply.

The Arduino's power supply will likely have switching components, and they may switch in a fashion that makes some audible artifacts on the output signal. Remember - the digital signal isn't perfect; excursions on it's power supply will affect the output voltage. Those excursions may come from the power supply itself - probably a PC's USB port; from short-term variations in the power supply voltage caused by current drawn by the Arduino; or from the PC power supply that drives the sound card you use to record. I note that the sound card you're using is external, but I'm not sure that means that its power supply is isolated from the PC. Is it USB-powered?

The hiss that you hear may be filterable, but the tones are right in the range that your low-pass filter has to let through. It seems unlikely that you'll be able to filter them out, while leaving the actual output audio signal unaffected.

No need to post files. We'll rely on your ears.