Version 4 SHEET 1 1060 824 WIRE 0 224 0 160 WIRE 0 544 0 480 WIRE 32 160 0 160 WIRE 32 480 0 480 FLAG 0 304 0 FLAG 32 160 rnd FLAG 0 624 0 FLAG 32 480 rnd2 SYMBOL bv 0 208 R0 WINDOW 123 22 127 Left 0 SYMATTR Value2 COS(2*PI*white(time*0.93*ft+0.5)) SYMATTR InstName B1 SYMATTR Value V=SQRT(-2*LN(0.999997*white(time*1.07*ft)+0.50001))* SYMBOL bv 0 528 R0 WINDOW 123 38 71 Left 0 WINDOW 3 38 42 Left 0 SYMATTR Value2 tripdv=5m tripdt=1m SYMATTR InstName B2 SYMATTR Value V=SQRT(-2*LN(1E-5+rand(time*ft)))*SIN(2*PI*rand(time*ft+2345)) TEXT 174 162 Left 0 !.tran 0 2000 0 TEXT -24 -160 Left 0 ;From yahoo/LTSPICE-group:\n"This is the Box-Mueller algorithm for Gaussian Noise. You need two\nindependent random variables. The factors 1.07 and 0.93 is an attempt\nto do this. You will need to alter these, and the time step to get\nwhat you want. You also may need to scale to get the correct rms\nvalue in your noise bandwidth.\nIt's not perfect."\n \nFactors .999997 and .50001 correct for the math. problem at LN(0).\nOriginal formula given was:\nV=SQRT(-2*LN(white(time*1.07G)+0.5))*COS(2*PI*(white(time*0.93G+0.5))) TEXT 384 160 Left 0 !.params ft=1 TEXT -24 416 Left 0 ;Better formula (more gauss-like distribution, RMS closer to expected)\nThe 1E-5 factor can be changed to adjust for the peak value! TEXT 176 192 Left 0 !.options plotwinsize=0 TEXT 32 632 Left 0 ;TripdV & Tripdt is needed for sufficient\n"oversampling" of the rand() function\nto give the correct RMS = 1.\nOtherwise RMS would be too low. TEXT -24 -200 Left 0 ;Box-Mueller formula for Gaussian Noise TEXT 160 224 Left 0 ;This formula using white() gives an RMS which is too low (881mV)\nTripdV & Tripdt would improve it, but simulation\nwill get very slow. TEXT -16 752 Left 0 ;If rand() is used in a DC sweep, a similar oversampling is needed,\ne.g. increment such that >10 datapoints/unit of rand() argument\nchange are taken.