I have been trying explore the background rates due to thermal noise (instrumental) through a simulation (python). So, what I have been essentially doing is the following

V_rms = np.sqrt(4 * k_B * T * R * B)

which is a standard formula with B = bandwidth.

Then, I am generating random noise data (i.e., V(t)) for 1 sec, with mean = 0 and sigma = V_rms.

I am choosing threshold voltage of form

V_TH = h x V_rms

I am trying to estimate "Background Rate" in a power sensitive device. As the power remains Independent of sampling frequency for white noise hence we shall expect background rate independent of sampling frequency, right ?

In the power sensitive detectors, instantaneous power i.e. $V^2 (t) / R$ is integrated over a small collection time. So, I am considering consecutive n-point averaging for all the instants and then taking square of that.

Mathematically, <V(ti)> = ( V(ti) + V(ti+1) + V(ti+2) + V(ti+3) +.... + V(ti+n))/n

Then checking as follows, Whether, $<V(ti)> ^2/R$ is >= $ V_{TH} ^2 /R$.

With sampling rate I am changing "n" in order to keep collection time same at all the sampling rates. e.g. for $F_S$ = 250 MHz -> n = 4. for $F_S$ = 500 MHz -> n = 8. for $F_S$ = 1000 MHz -> n = 16.

This is what I have understood and implemented. I am not an expert on this and a new learner so kindly let me know if I am not getting the thing correctly and also feel free to label logical correction in algorithm.


3 Answers 3


Responding to Updated question:

The OP is properly creating a white noise process that is proportional to bandwidth, with the standard deviation increasing at $\sqrt{B}$ consistent with thermal noise given as $kTB$ where $k$ is Boltzmann's constant, $T$ is the temperature in Kelvin and $B$ is the bandwidth. We will assume for practical application that the thermal noise has been amplified to be sufficiently above the noise floor of the A/D converter (as the digital samples of the thermal noise).

I think the issue is in the way the OP is measuring the thermal noise. A proper measurement is the standard deviation of the signal, which (assuming the signal has zero mean, otherwise subtract the mean first) is simply the square root of the sum of the square of each sample. Doing this will result in the same standard deviation regardless of sampling rate as long as the bandwidth of the noise is higher than the sampling rate (white noise has infinite bandwidth but in practical applications it would be limited by the analog bandwidth of the A/D converter, or an anti-aliasing filter placed prior to A/D conversion).

So in summary, to measure the actual noise level as an rms quantity, take the average of all the samples and subtract this average from each sample (to be zero-mean). Then square each sample, sum the squares, and then take the square root. This is "root-mean-square" and for a zero mean signal will be the standard deviation of the signal. The square of the standard deviation is the variance. If the signal is in volts, then the variance divided by the resistance will be the power.

The OP was also interested (in the comments) in how to determine the maximum number of samples to use. For a white noise process, this is an excellent application of the Allan Deviation, available in python as the "allantools" package, with key points summarized in the plot below (plot is from this link with further details on the Allan Deviation for those interested):

Allan Deviation

Even if you don't have time to understand the full details of the Allan Deviation you can use the tool to create a plot as above for any random process using "frequency" as the input variable and not "phase". (The tool is intended for frequency variation vs time, and specifically a "White FM" process would be the same as any white noise process. Phase is an integral of frequency, so the tool allows for that optional input, but that would result in integrating the noise process which acts like a low pass filter-- just use "frequency" as the input and it will work as expected). The Allan Deviation shows a measure of standard deviation versus averaging time (it is more detailed than that as I explain in other posts but for white noise processes it is that simple). For stationary white noise specifically, the Allan Deviation will go down as the square root of the averaging time (consistent with the standard deviation of samples of white noise reducing by the square root on the number of samples averaged). For practical application many processes are only stationary (constant mean and standard deviation) over a short time interval, after which drift and other factors take over-- any computation with averaging time longer than this cross over point will result in a degraded measure of standard deviation. This has wide applicability to many processes where we are not time limited and want to know how long we should average for!

Details from prior answer below

When you double the sampling rate, you double the number of samples, which for a given threshold and same distribution, would double the number of samples crossing that threshold.

For example, below is a plot of a white noise process. To be "white noise" every sample would be independent of the next, so no matter how much we zoom in, this plot would look the same. If we set a threshold and sampled at twice the rate, over the same amount of time we would have twice the samples cross that threshold.

white noise

Thermal noise as we would sample with an A/D converter (ADC), if amplified to be higher than the ADC's own noise, is better represented as "band-limited white noise". This is because we would either low pass filter the signal before sampling (to eliminate all aliases), or if not, the ADC itself has a finite bandwidth. For this, as we zoom in, we will see the temporal variations in the waveform. Still if we sample this at twice the rate and have a threshold, we would again see twice the number of samples cross that threshold in the same amount of time.

band limited white noise

I mention the above since thermal noise is a spectral density, meaning power over unit bandwidth in Hz. If the analog bandwidth increases, then the total power (and thus the standard deviation of the Gaussian distribution) would increase. This has nothing to do with the sampling rate but everything to do with the analog bandwidth that exists either from our own filtering or the finite bandwidth of the sampling device (real world).

For thermal noise, this would make sense only if the signal bandwidth prior to the analog to digital converter (thermal noise is an analog process) was higher than the sampling rate, and the thermal noise was amplified to be well above the quantization noise (assuming you were modelling what would be at the output of an A/D converter, otherwise we would be modelling the quantization noise from the A/D converter instead of the thermal noise: that would be very similar as a white noise process but with a uniform distribution instead of Gaussian).

Thermal noise at a fixed temperature is at a fixed power spectral density (given by $kT$ where $k$ is Boltzmann's constant and $T$ is the temperature in Kelvin) meaning the power over a unit bandwidth is constant. It is a white noise random process with a Gaussian (normal) distribution. At a given sampling rate, the total variance in time will equal the total variance in frequency (see Parseval's Theorem). This means if you create samples of a noise process using a Gaussian random generator with standard deviation $\sigma$ at sampling rate $f_s$, the power of that waveform ($\sigma^2)$ will be spread evenly over the frequency range given by the sampling rate (so the power spectral density will be $\sigma^2/f_s$). If the input to the ADC is properly low pass filtered such that there is no aliasing, then we would expect the total power due to amplified thermal noise to increase with increasing sampling rate (assuming we increase the bandwidth of the associated anti-alias filter to allow all the first Nyquist zone to pass). To model thermal noise at a constant power level in that case, you need to increase the $\sigma$ used by the sampling rate to account for the increased bandwidth. If we sample far below the analog bandwidth, we will get the same distribution (standard deviation and variance) independent of sampling rate, which can be explained by an aliasing model.

To help visualize this I have provided the graphic below. On the left are samples of a normalized ($\sigma = 1$) Gaussian white noise process. It is white because each sample is independent of all others (no memory) and when the mean is 0 as in this case, $\sigma$ is the root-mean-square or rms of the signal. On the right is a histogram, turned sideways to align with the amplitude distribution of the signal, and the histogram is showing the distribution of all amplitudes. A threshold is shown in red at $\sigma =1$. The point is, this waveform with a given $\sigma$ is independent of the sampling rate; I did not need to provide the sampling rate to define how this will look as long as each sample was independently generated. At any given sampling rate, with enough samples we will see the same distribution, and therefore over enough samples to be statistically valid will get the same percentage of samples crossing the threshold. If the time duration is the same, and we double the sampling rate, we will double the number of samples crossing the threshold. As the resulting digital samples, this is the same result we would get with noise filtered to the Nyquist bandwidth or noise with much higher bandwidth as long as the total power in both cases was the same (and we can see visually how we would get the same standard deviation for both those cases since it is based on the total power alone). If we were to provide filtering that is below the sampling rate, we would get different standard deviations depending on the bandwidth of the filter used. (This would be referred to as band-limited white noise).

White Gaussian noise

  • $\begingroup$ sir, if I understand this correctly, as I am trying to write a simulation on this and hence I am not applying any sort of filters, so background rate will increase as long as the sampling rate is chosen less than the bandwidth under consideration ? I mean the band-width (B) used in the expression of V_rms ? This is so ? $\endgroup$ Feb 18, 2022 at 14:02
  • $\begingroup$ Sir, " and the thermal noise was amplified to be well above the quantization noise" - Pardon but I did not quite get this. Since, I am trying to estimate "Background Rate" for a Power Sensitive device and as you have mentioned that power essentially remains same with sampling frequency, right ? So for such a systems Background Rate must be independent of Sampling frequency, Right ? Kindly let me know whether I am on right track or not since I am merely a new learner. Thanks. $\endgroup$ Feb 18, 2022 at 14:07
  • $\begingroup$ It depends on what exactly you are trying to model. Quantization noise of an ADC can also be a white noise process. Can you provide more specific details in your question on what exactly you want to model and why? This will help provide clarity on remaining questions. I can explain it very simply if you can explain in the question your motivation for doing this; what is it you are trying to prove to yourself or further understand by doing this, or what requirement are you trying to meet? $\endgroup$ Feb 18, 2022 at 14:38
  • $\begingroup$ I amused to know that as I am changing the sampling frequency the total power (as well as standard deviation of Gaussian distribution) changes. This is because I have fixed "B" in expression of V_rms at all the sampling rate and hence used the same V_rms as standard deviation of Gaussian distribution in all the compilations (i.e., at different sampling frequencies). I have also rephrased the question with more information. $\endgroup$ Feb 18, 2022 at 16:04
  • $\begingroup$ @SubhadipSaha Got it, thanks for clarifying- yes we can clear that up! Let me add that to the top of my answer $\endgroup$ Feb 18, 2022 at 16:16

Is it adhering to the Nyquist Criterion?

A repetitive waveform can be correctly reconstructed provided that the sampling frequency is greater than double the highest frequency to be sampled.

Does this seem relevant? I don't study the subject


  • $\begingroup$ Actually, I am also a new person in this field. But, I believe as I am increasing the the sampling frequency, the band-width is automatically getting larger ? Right ? $\endgroup$ Feb 18, 2022 at 14:18
  • $\begingroup$ no as you increase the frequency the bandwidth gets smaller. think of like frets on a guitar that get smaller farther down the neck, as the frequency (pitch) goes up, the amount of waves per time unit is higher. the space for a fret gets smaller for each octave by quite a bit. in some of these pictures you can see the how it squishes up and goes up exponentially from 100 to 10,000 iconcollective.edu/spectrum-analyzers $\endgroup$
    – Ryan Stark
    Feb 19, 2022 at 13:48

When you double the sample rate, you double the bandwidth. If your noise has constant power spectral density, than the total noise energy doubles as well.

You can't really sample continuous white noise since it's not bandlimited. If you do sample it, you typically apply an anti-aliasing filter that low-passes the signal at roughly half the sample rate.

Also, if I am also making a logical mistake in Algorithm, kindly let me know that.

It sure is an unusual algorithm. The result will not only on the sample rate, but also on the threshold and on the distribution of the noise. It is more common to just use noise energy, signal to noise ratio or power spectral density (PSD) of the noise. Whether your algorithm is useful or not depends on the requirements of your specific application.

  • $\begingroup$ Sir, "If you do sample it, you typically apply an anti-aliasing filter that low-passes the signal at roughly half the sample rate." - I certainly appreciate that, however, I have also fixed the value of bandwidth (B) in the expression of "V_rms", Does it not limiting the allowed band of "Noise" ? And sir, I am trying to write my code for a power sensitive detector, where the power is integrated over a 10-12 nanosecond (i.e., to limit the band-width again) interval right ? In that sort of system I shall be expecting "Background Rate" to be independent of Sampling frequency, Right ? $\endgroup$ Feb 18, 2022 at 14:13
  • $\begingroup$ Kindly let me know if I am not getting it correctly, Since I am a new learner on this field it would definitely contribute in my progress. Thanks a lot. $\endgroup$ Feb 18, 2022 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.