I am trying to model a DAC , to do so I need to write a Zero Order Hold function , which repeats each sample a certain number of times. I see that the spectrum has not the same amplitude before and after ZOH . I used a number of points in power of 2 so that I can see the noise floor.
I have really big problems to make the noise appear at the same level than before. I join 2 photos, 1 which is the result of a 3bit DAC on a 100 Hz sine wave and then the spectrum of the holded signal.
Could you tell me why the noise level becomes 0 dBm when it was -78 dBm before ZOH ?
I also give you my ZOH code;
Thank you for your help.