Optimized sinewave test of waveform digitizers by a DFT approach