I have code on Arduino Nano that has predefined array of 4 waveforms (square, sawtooth, triangle, sine).

The array has, for each of the waveforms, 256 values where each value is 8 bit.

The speed, at which Arduino Nano sends the value to the MCP4802 DAC is 1 ms, so the full period of any waveform will be 256 ms.

Let's say that MCP4802 DAC will output the full period of any waveform at the same speed as it receives that waveform from the Arduino Nano, i.e 256 ms for full period (frequency is 1/256 = 3.9 Hz)

At the output of the MCP4802 DAC I have RC filter (R=3400 Ohms and C=10 uF) which makes the cutoff frequency to be 4.7 Hz.

Since the output voltage of the RC filter that I'm interested in is hooked up to the C(capacitor), the time of charge and discharge will very well smooth sine wave (the output of DAC is stepped), however will completely distore my sawtooth, triangular and square waveforms' signals.

So, my question is - how should I choose the RC-filter components to have an ability to still filter out the unwanted noise (if occurs) but being able to see all waveforms not being distorted?

  • 2
    \$\begingroup\$ I'm suggesting your question above is a duplicate of your earlier question: How to design a function generator (Arduino Nano) to filter out noise of different signals?. I'm suggesting it because, in that question you have a very similar set-up (trying to produce a function generator) and, ask this question: Is there a proper way to design an RC filter on the output and at the same time not distort other waveforms (but instead filter out the noise)? \$\endgroup\$
    – Andy aka
    Nov 27, 2022 at 12:55
  • 2
    \$\begingroup\$ I've answered that earlier question by the way so don't be disheartened by my close vote for this question. \$\endgroup\$
    – Andy aka
    Nov 27, 2022 at 13:05