# What should be my sampling frequency for a peak detector output where it is extremely important for me to capture the first time the peak occured?

Following is the output of the peak detector:

The amplitude is not important to me, however the time when the peak occurs is extremely important. So my microcontroller will have an algorithm like capture the digital values, and when 'n' digital values are same (this means the peak has arrived), store the time corresponding to the first time that digital value occured. Hence obviously, it is important that rising part is accurately digitised. This is where I am sort of confused. Following is the FFT of the signal:

As you can see, it has dominant frequency components upto 15MHz. So should my sampling frequency be greater than 30MHz?

Or should it be calculated as follows: rise time ~ 2 microseconds. Therefore, frequency ~ 0.5MHz. Hence sampling frequency > 1MHz.

• It all comes down to how much time resolution you need in order to meet your unstated requirements. Jul 3, 2021 at 11:08

Depends on the duration of the peak occurrence, if you have a slow sampling period and the peak occurs faster than the sampling frequency, you might miss the peak.

• So here it occurs within 2 microseconds. So sampling time of 2-3MHz should be enough? Jul 3, 2021 at 11:40
• @needbrainscratched what if it peaked and then flat-lined within 4 microseconds? You need to consider the what-ifs and demonstrate that you have done so. We can't do that for you and we're not mind-readers. 1 scenario is not enough. Consider all the scenarios. Jul 3, 2021 at 11:57
• @needbrainscratched You should use Nyquist sampling to record the waveform and then post process it to extract the peak position, which you can do arbitrarily accurately. Don't think about the peak in terms of settling time but bandwidth. Jul 3, 2021 at 16:23