Thanks Helmut for your answer!
Regards
Sergio
toggle quoted message
Show quoted text
--- In LTspice@..., "Helmut" <helmutsennewald@...> wrote:
--- In LTspice@..., "sergio" <thetosk@> wrote:
Hello,
I kindly ask for an advice to choose the correct parameter to insert in the Box-Muller formula using the "rand" function.
In particular I need to have a white noise in the band of interest (called BW in the param def below), the RMS I called Vrmsn1 due to R1 in the BW.
my question is:
which value do I need to put to multiply "time" ? I use 2*BW is it correct?
.param Vrmsn1 = sqrt(4*kB*T*R1 *BW)
V = {Vrmsn1}*SQRT(-2*LN(1E-8+rand(time*2*BW)))*SIN(2*PI*rand(time*2*BW+1879))
using an fft with nfft points the average of the noise spectrum seen in the FFT should be:
10*log10( 4*kB*T*R1 *BW /(nfft/2) )
I cannot get this correspondence (maybe I miss some point!)
From an old post #40603 (that refers to an older one #5598) I read:
---
There are pseudo random number generator functions
available in behavioral sources: white(), rand(),
and random(). You would have to filter their
response to make it white or pink. Their frequency
domain spectral output is a specific function I do
not document, not white or pink (given sufficient
statistics it will increase in frequency and then
roll off). --Mike
---
that means the spectrum of "rand" is not really white ...
any suggestion to match the AC:
10*log10( 4*kB*T*R1 *BW /(nfft/2) )
with the time domain (just a voltage source with the box-muller
formula as above) is appreciated.
kind regards
Sergio
Hello Sergio,
V = {Vrmsn1}*SQRT(-2*LN(1E-8+rand(time*2*BW)))*SIN(2*PI*rand(time*2*BW+1879))
.param Vrmsn1=1
This voltage has the RMS value of 1V, but it has some power
beyond the frequency BW. When I filter it with a 7nd order
Butterworth filter with bandwidth BW, I got 438mVrms.
The spectrum has still a little bit energy above BW. So the
corresponding power density may be still a little bit less
between 0Hz and BW.
Best regards,
Helmut