Hi,
Sorry i can´t help you with matlab...
****
b) how big should my signal bandwidth be to adequately calculate SNDR with hann window?
this should be determined by the engineer.
My opinion: i´d go up to fs/2 (according nyquist).
If an industrial ADC is specified with max sampling rate of 100.000 ksmpl/s then i´d use this as sample freq. and SNDR calculation up to 50.000 kHz
For an an audio ADC with a typical fs of 44.100 smpls/s and max fs = 100.000 smpl/s i´d test it with the typical fs of 44.100 smpls/s and SNDR calculation up to 22.05kHz
(exceptions are ADCs that especially are built for undersampling)
***
I reviewed your posts.
it seems to me you are using
* a 50Hz input sine wave
* with 100% max amplitude
* a sampling rate of 1ms --> 1kHz
* An FFT with 2048 points
I have some experience with testing ADCs, production test of a big ADC manufacturer.
I hope you don´t mind my recommendations.
* In real tests one does not use 100% input range. Maybe 95% to avoid clipping signals caused by offset and/or gain errors of the ADC.
* If using FFT one tries to use that the sample frequency is 2^n of analog frequency.
if you need analog frequency fa to be 50HZ, then Fs = 16 x fa or 32 x fa. fs = 800Hz or 1600Hz
or if you need 1kHz sample frequency --> then fa = 31.25Hz or 62.5Hz
--> then you don´t need windowing. You get best results with sharp peaks from FFT, and calculation of SNDR and so os is easy.
with the use of a window you always get those (not nice) arcs in the result of the FFT.
Maybe it´s worth a try.
Good luck
Klaus