Electrical – How to change the reference voltage and resolution of SAMPLE and HOLD block in LTSpice

ltspicesample and hold

I have a question about LTSpice.
I put a Sample & Hold block in a sheet to quantize a continuous sine signal like below:
enter image description here
But the resolution is not desired. I have a 16-Bit ADC with a 1v reference voltage.
even I changed the spice lines and opened the SAMPLE.asy symbol but I really couldn't find any solutions.

Thanks


@andy-aka
I really appreciate you for your reply. (due to my low reputation I couldn't upvote for you)
Yes. I had forggoton the principle 🙂 actually N=Fs/F. so we have N=10Meg/1Meg=10 points per each cycle.
enter image description here

if it's possible I have an another question 🙂
when the ADC resolution is Vref/(2^16), can I implement it in LTspice like below:

Vres=Vref/(2^16)
out=int(Vin/Vres)
if abs(Vin)>=Vref
Vin=1
end

Best Answer

You will have perfect resolution with this circuit but you are seeing the effects of sampling at exactly 10 samples per sinewave. If you lowered the sinewave input frequency by ten you would see ten times as many samples in a cycle of sinewave and you will see many more points of resolution.

Alternatively, if you altered the sinewave frequency by just a little bit and looked at many cycles you would also see many more points of resolution. At the moment all your sample points are hitting the same parts of the sinewave and making you think your resolution is bad (but it isn't).

The sinewave below has been sampled 26 times in a cycle and you can see that there are more points with tighter resolution: -

enter image description here