# THD requirement for generated sine

I need to generate a sine signal using a DAC with a certain THD specification, say 0.1% @ 1KHz. As a first approach I’m considering it to be an ideal DAC along with an ideal LPF for aliasing removal in order to define the minimal resolution in bits so I could achieve the desired THD. To optimize the quality consider I’ll generate the signal using the full scale. Is there a direct method to find the optimal resolution?

I really appreciate any insights!

• That's a very direct method you've described. Not quite sure what you're asking from us? Aug 12, 2018 at 9:04
• @MarcusMüller what’s the minimal bit-depth to achieve 0.1% THD @ 1KHz? Aug 12, 2018 at 12:33
• Read my answer. Aug 12, 2018 at 12:33

## 1 Answer

This can't be the way to go: If you have an ideal LPF, one-bit DAC is always sufficient. (Hint: Draw the spectrum of a square wave. Draw the pass band of your LPF on top.)

You don't have an ideal LPF; or you might want to produce a range of sine frequencies (not only a single one) spanning more than an octave, so that you can't just use a fixed LPF + 1 bit DAC.

The easy way to calculate THD is realizing that it's a relation between powers. So, you need to know how much "error power" there is in a quantized signal. There's this term quantization noise that captures that – and it's well-known for sinusoidal signals!

• I believe I did’t express myself very accuratelly. Yes, you’re correct if I use a square wave and LPF, but that’s not the design I was looking for. You must consider that my system has a minimal bandwidth, say 100KHz @ 200KSa/s, therefore the LPF is tuned in 100KHz Aug 12, 2018 at 12:46
• if you know your desired frequency is 100 kHz, then a 1 bit DAC running at 200 kHz is really enough, and you get 0 THD if your LPF cuts off between anywhere 100 kHz and 300 kHz and has infinite suppression at 300 kHz. Aug 12, 2018 at 12:49
• actually my desired frequency lies inside the bandwidth, 1KHz is a reference for the calculation of THD. So 1-bit DAC generating 1KHz @ 200KSa/s would reproduce all the harmonics from 1KHz up to 100KHz, what am I missing? Aug 12, 2018 at 13:35
• As I said in the second paragraph, then you can't just use your sampling rate LPF. So, apply what I said in the third paragraph of my answer. Aug 12, 2018 at 13:38
• got it, tks for this support! Aug 12, 2018 at 15:52