Forums

Learning about oscillators in LTSpice

Started by Clifford Heath October 21, 2010
On Fri, 25 Jul 2014 10:53:19 -0700, John Larkin  
<jlarkin@highlandtechnology.com> wrote:

> Version 4 > SHEET 1 880 680 > WIRE 320 64 128 64 > WIRE 368 64 320 64 > WIRE 400 64 368 64 > WIRE 128 96 128 64 > WIRE 320 112 320 64 > WIRE 128 208 128 176 > WIRE 320 208 320 192 > FLAG 128 208 0 > FLAG 320 208 0 > FLAG 368 64 NOISE > SYMBOL bv 128 80 R0 > WINDOW 0 -198 53 Left 2 > WINDOW 3 -336 104 Left 2 > SYMATTR InstName B1 > SYMATTR Value V=random(100*time) - 0.5 > SYMBOL res 304 96 R0 > WINDOW 0 -59 37 Left 2 > WINDOW 3 -56 73 Left 2 > SYMATTR InstName R1 > SYMATTR Value 1 > TEXT -96 64 Left 2 !.tran 5
usually need the .options plotwinsize=0 not very 'flat' rolls down about 15dB between 20 and 50Hz, should be flat at least out to that. was it supposed to be flat? calibrated? have 'any' known characteristic? or, just make noise? even going to maximum time step of over 100x smaller than the maximum frequency [Nyquist] the noise rolls down almost 5 dB at the 'high' end. So conclusion, yes makes noise, but not very controllable and even slowing down your analysis won't make that noise source flat enough to count on it, plus I see no way to include the 1/f noise in an OpAmp and worst of all!!! put two in your circuit and they both produce the SAME voltage!!! just like white() does.
On Fri, 25 Jul 2014 14:15:53 -0700, RobertMacy
<robert.a.macy@gmail.com> wrote:

>On Fri, 25 Jul 2014 10:53:19 -0700, John Larkin ><jlarkin@highlandtechnology.com> wrote: > >> Version 4 >> SHEET 1 880 680 >> WIRE 320 64 128 64 >> WIRE 368 64 320 64 >> WIRE 400 64 368 64 >> WIRE 128 96 128 64 >> WIRE 320 112 320 64 >> WIRE 128 208 128 176 >> WIRE 320 208 320 192 >> FLAG 128 208 0 >> FLAG 320 208 0 >> FLAG 368 64 NOISE >> SYMBOL bv 128 80 R0 >> WINDOW 0 -198 53 Left 2 >> WINDOW 3 -336 104 Left 2 >> SYMATTR InstName B1 >> SYMATTR Value V=random(100*time) - 0.5 >> SYMBOL res 304 96 R0 >> WINDOW 0 -59 37 Left 2 >> WINDOW 3 -56 73 Left 2 >> SYMATTR InstName R1 >> SYMATTR Value 1 >> TEXT -96 64 Left 2 !.tran 5 > >usually need the >.options plotwinsize=0
A narrowband FFT of a noisy time-domain circuit is going to get grim. It's like a time-domain analysis of a high-Q crystal oscillator, likely to result in unbearable sim times.
> >not very 'flat' rolls down about 15dB between 20 and 50Hz, should be flat >at least out to that.
Nyquist is 50 Hz. Most real systems are flat to, say, half of Nyquist. This isn't bad for something this simple.
>was it supposed to be flat? calibrated? have 'any' known characteristic? >or, just make noise?
Well, obviously, you'd have to adjust the time quantization (and max timestep) to get wider bandwidth noise. And the RMS value can be changed, too; want to know how?
> >even going to maximum time step of over 100x smaller than the maximum >frequency [Nyquist] the noise rolls down almost 5 dB at the 'high' end. So >conclusion, yes makes noise, but not very controllable and even slowing >down your analysis won't make that noise source flat enough to count on >it, plus I see no way to include the 1/f noise in an OpAmp >
Add a shaping filter. Or demand your money back.
>and worst of all!!! put two in your circuit and they both produce the SAME >voltage!!! just like white() does.
Then change the time scalers. Change the amplitudes. Sum a few to make things more Gaussian... there might even be a theorem about that. Or post something better. -- John Larkin Highland Technology, Inc jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Fri, 25 Jul 2014 16:20:28 -0700, John Larkin  
<jlarkin@highlandtechnology.com> wrote:

> On Fri, 25 Jul 2014 14:15:53 -0700, RobertMacy > <robert.a.macy@gmail.com> wrote: >> ....snip... > A narrowband FFT of a noisy time-domain circuit is going to get grim. > It's like a time-domain analysis of a high-Q crystal oscillator, > likely to result in unbearable sim times.
How long the simulation time runs determines the BW and how small the maximum step determines the maximum frequency. With 10 uncorrelated true gaussian noise sources I analyzed the analog multiplier MC1496 made out of the CA3046 NPN's. Using BW of 100Hz BW out to 5MHz max frequency kept the simulation times resonable on this 500MHz machine. Just have to use reason.
>> not very 'flat' rolls down about 15dB between 20 and 50Hz, should be >> flat >> at least out to that. > > Nyquist is 50 Hz. Most real systems are flat to, say, half of Nyquist. > This isn't bad for something this simple.
Where do you get that the Nyquist is 50Hz? In your circuit it was actually 102.4Hz, I used half, at 50Hz, to give some allowance, albeit was not enough.
>> was it supposed to be flat? calibrated? have 'any' known characteristic? >> or, just make noise? > > Well, obviously, you'd have to adjust the time quantization (and max > timestep) to get wider bandwidth noise. And the RMS value can be > changed, too; want to know how?
That's a bit impudent, considering. Yes, for edification I do want to know how YOU would set ten independent gaussian noise sources to represent the contribution from ten resistors? I'm keeping it simple and not even including a transistor. I'll even help a bit, let's set the BW to 10Hz and the maximum frequency of interest to 100kHz.
>> ...snip... >> it, plus I see no way to include the 1/f noise in an OpAmp > > Add a shaping filter. Or demand your money back.
Actually, the way I do it, it is VERY easy to add the 1/f and control what you have.
>> and worst of all!!! put two in your circuit and they both produce the >> SAME >> voltage!!! just like white() does. > > Then change the time scalers. Change the amplitudes. Sum a few to make > things more Gaussian... there might even be a theorem about that.
Change in some arbitrary manner? No way! Again, what I do is CALIBRATED, so the results have value. The technique to get .tranoise is TRUE circuit simulation where in one pass you get BOTH .noise and .tran AND any interaction going on in the non-linear circuitry.
> Or post something better.
How? The zipped package for doing the MC1496 analysis was 35MB. If we can get someone to build it into LTspice, it would be less than 3k, and be text. The resistor model is very simple, consisting of a calibrated current noise source attached to the nodes of the resistor. As a result, the technique does not even increase the node count in the circuit. Anybody who has worked with PSpice knows the advantage of keeping node count low. Plus, the model does NOT get in the way of the normal .ac or .noise analysis. Also, the technique provides flat noise spectrums out to the Nyquist rate. If ten is too difficult, look forward to seeing how you propose to doing two resistor noise models.
On Fri, 25 Jul 2014 21:08:05 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>On Fri, 25 Jul 2014 16:20:28 -0700, John Larkin ><jlarkin@highlandtechnology.com> wrote: > >> On Fri, 25 Jul 2014 14:15:53 -0700, RobertMacy >> <robert.a.macy@gmail.com> wrote: >>> ....snip... >> A narrowband FFT of a noisy time-domain circuit is going to get grim. >> It's like a time-domain analysis of a high-Q crystal oscillator, >> likely to result in unbearable sim times. > >How long the simulation time runs determines the BW and how small the >maximum step determines the maximum frequency. With 10 uncorrelated true >gaussian noise sources I analyzed the analog multiplier MC1496 made out of >the CA3046 NPN's. Using BW of 100Hz BW out to 5MHz max frequency kept the >simulation times resonable on this 500MHz machine. Just have to use reason. > >>> not very 'flat' rolls down about 15dB between 20 and 50Hz, should be >>> flat >>> at least out to that. >> >> Nyquist is 50 Hz. Most real systems are flat to, say, half of Nyquist. >> This isn't bad for something this simple. > >Where do you get that the Nyquist is 50Hz? In your circuit it was actually >102.4Hz, I used half, at 50Hz, to give some allowance, albeit was not >enough.
100 samples per second, 50 Hz Nyquist.
> >>> was it supposed to be flat? calibrated? have 'any' known characteristic? >>> or, just make noise? >> >> Well, obviously, you'd have to adjust the time quantization (and max >> timestep) to get wider bandwidth noise. And the RMS value can be >> changed, too; want to know how? > >That's a bit impudent, considering. Yes, for edification I do want to know >how YOU would set ten independent gaussian noise sources to represent the >contribution from ten resistors? I'm keeping it simple and not even >including a transistor. I'll even help a bit, let's set the BW to 10Hz and >the maximum frequency of interest to 100kHz.
BW of what is 10 Hz?
> >>> ...snip... >>> it, plus I see no way to include the 1/f noise in an OpAmp >> >> Add a shaping filter. Or demand your money back. > >Actually, the way I do it, it is VERY easy to add the 1/f and control what >you have.
Well, how do you do it? Post an LT Spice circuit.
> >>> and worst of all!!! put two in your circuit and they both produce the >>> SAME >>> voltage!!! just like white() does. >> >> Then change the time scalers. Change the amplitudes. Sum a few to make >> things more Gaussian... there might even be a theorem about that. > >Change in some arbitrary manner? No way! Again, what I do is CALIBRATED, >so the results have value. The technique to get .tranoise is TRUE circuit >simulation where in one pass you get BOTH .noise and .tran AND any >interaction going on in the non-linear circuitry. > >> Or post something better. > >How? The zipped package for doing the MC1496 analysis was 35MB. If we can >get someone to build it into LTspice, it would be less than 3k, and be >text.
Blather. -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Fri, 25 Jul 2014 23:00:49 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

> On Fri, 25 Jul 2014 21:08:05 -0700, RobertMacy <robert.a.macy@gmail.com> > wrote: >>> ....snip.... >> Where do you get that the Nyquist is 50Hz? In your circuit it >> was actually 102.4Hz, I used half, at 50Hz, to give some >> allowance, albeit was not enough. > > 100 samples per second, 50 Hz Nyquist.
Yes, 100 samples per second does yield 50Hz Nyquist, but a formula should use values based upon some type of reality. LTspice's ACTUAL sampling rate is related to the maximum step size set in the .tran command. Which by default is 1000 steps. By setting the argument in the random function to (100*time); you have forced the 'effective' useable rate to be much less, only due to the resulting 'flatness' of your noise source. You did NOT match the use of your random function to the use of the sampling rate. Threw away a lot of capability. Setting the random function to (100*time) only causes the function to change at 100Hz rate, BUT the random function is smoothed. Since random is smoothed, it's VERY difficult to get the noise spectrum flat, in this case, still not flat even over the very small range between 200mHz to 25Hz. Plus, the noise characteristic doesn't even 'look' right. White noise is more 'spikey'. For example, a 1 Vrms white noise source will actually have, every now and then, 6 Volts pop out of it, where as that random function will ALWAYS be within +/-0.5 volts and NEVER be outside that range.
>> Yes, for edification I do want to know how YOU would set ten >> independent gaussian noise sources to represent the contribution >> from ten resistors? I'm keeping it simple and not even including >> a transistor. I'll even help a bit, let's set the BW to 10Hz and >> the maximum frequency of interest to 100kHz. > > BW of what is 10 Hz?
The Bandwidth is set by the run length. The Nyquist rate is related to the maximum time step. Therefore, the following gets you BW of 10Hz and Nyquist rate of 100kHz: .tran 0 100m 0 5u
>> ...snip... > Well, how do you do it? Post an LT Spice circuit.
I do it in the spectral domain, multiply a noise spectrum by 1/sqrt(frequency) then convert back to the time domain and use those values. Creates noise that plots with the 1/f shape and obviously looks correct with that meandering characteristic one sees at the output of an OpAmp.
>> ...snip... >> How? The zipped package for doing the MC1496 analysis was 35MB. If we >> can >> get someone to build it into LTspice, it would be less than 3k, and be >> text. > > Blather.
No, statement of fact. . . . Have you yet figured out how to make the two noise sources using random()?
On Sat, 26 Jul 2014 13:44:18 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>On Fri, 25 Jul 2014 23:00:49 -0700, John Larkin ><jjlarkin@highnotlandthistechnologypart.com> wrote: > >> On Fri, 25 Jul 2014 21:08:05 -0700, RobertMacy <robert.a.macy@gmail.com> >> wrote: >>>> ....snip.... >>> Where do you get that the Nyquist is 50Hz? In your circuit it >>> was actually 102.4Hz, I used half, at 50Hz, to give some >>> allowance, albeit was not enough. >> >> 100 samples per second, 50 Hz Nyquist. > >Yes, 100 samples per second does yield 50Hz Nyquist, but a formula should >use values based upon some type of reality.
What number is more "real" than 50? 50 is a perfectly respectable number. LTspice's ACTUAL sampling rate
>is related to the maximum step size set in the .tran command. Which by >default is 1000 steps. By setting the argument in the random function to >(100*time); you have forced the 'effective' useable rate to be much less, >only due to the resulting 'flatness' of your noise source.
Sure. Why not? If you don't like the sample rate in my example, change it. It's there in plain sight. I did the demo for visibility.
> >You did NOT match the use of your random function to the use of the >sampling rate. Threw away a lot of capability. Setting the random function >to (100*time) only causes the function to change at 100Hz rate, BUT the >random function is smoothed. Since random is smoothed, it's VERY difficult >to get the noise spectrum flat, in this case, still not flat even over the >very small range between 200mHz to 25Hz.
Of course it isn't flat. It's noise. Look at real wideband noise on a spectrum analyzer some time. It's noisy! Plus, the noise characteristic
>doesn't even 'look' right. White noise is more 'spikey'. For example, a 1 >Vrms white noise source will actually have, every now and then, 6 Volts >pop out of it, where as that random function will ALWAYS be within +/-0.5 >volts and NEVER be outside that range.
The single Random(time) call obviously has a uniform probability distribution. EE101. If you want it to be more Gaussian, sum a few of them. Statistics101. The extreme example of a non-Gaussian PDF is a TTL serial data stream, specifically the output of a pseudo-random shift register. That can be turned into nearly perfect bandlimited white noise with a simple RC lowpass filter; see AoE for details. Similarly, a lowpass filter is another, simple way to improve the statistics of random(time), and fix your complaint about the rolloff shape. I was looking for a simple way to graph probability density functions in LT Spice. Some other time maybe.
> >>> Yes, for edification I do want to know how YOU would set ten >>> independent gaussian noise sources to represent the contribution >>> from ten resistors? I'm keeping it simple and not even including >>> a transistor. I'll even help a bit, let's set the BW to 10Hz and >>> the maximum frequency of interest to 100kHz. >> >> BW of what is 10 Hz? > >The Bandwidth is set by the run length. The Nyquist rate is related to the >maximum time step. Therefore, the following gets you BW of 10Hz and >Nyquist rate of 100kHz: >.tran 0 100m 0 5u
The random(K*TIME) function changes K times per second regardless of the LT Spice time step. So going to smaller time steps doesn't change the spectrum. See example below where K=1.
> >>> ...snip... >> Well, how do you do it? Post an LT Spice circuit. > >I do it in the spectral domain, multiply a noise spectrum by >1/sqrt(frequency) then convert back to the time domain and use those >values. Creates noise that plots with the 1/f shape and obviously looks >correct with that meandering characteristic one sees at the output of an >OpAmp.
Post an LT Spice demo.
> >>> ...snip... >>> How? The zipped package for doing the MC1496 analysis was 35MB. If we >>> can >>> get someone to build it into LTspice, it would be less than 3k, and be >>> text. >> >> Blather. > >No, statement of fact.
You've done nothing but whine, and present a Thompson-Fermat claim of a marvelous solution that you don't have room to post. If you want to discuss things, great. If you want to whine and bitch, you should try to be right.
> >. >. >. >Have you yet figured out how to make the two noise sources using random()?
I can make any number of them. Of arbitrary bandwidth and amplitude, and as Gaussian as you like. This ain't hard. Below is a set of examples, which I did for future reference. The product XC, and its lowpass filtered version XCLP, are fun. The N1 and N2 sources start identical, and take one second to drift out of correlation. I think the 3.94 values (to make 1 volt RMS) should actually be 3.464, the square root of 12, but maybe the LT Spice smoothing changes the statistics or something. Version 4 SHEET 1 1268 680 WIRE -352 -272 -432 -272 WIRE -272 -272 -352 -272 WIRE 112 -272 -16 -272 WIRE 176 -272 112 -272 WIRE 624 -272 576 -272 WIRE 656 -272 624 -272 WIRE 880 -272 736 -272 WIRE 976 -272 880 -272 WIRE 1040 -272 976 -272 WIRE -432 -240 -432 -272 WIRE -16 -240 -16 -272 WIRE 576 -192 576 -272 WIRE 880 -192 880 -272 WIRE -432 -128 -432 -160 WIRE -16 -128 -16 -160 WIRE 576 -48 576 -112 WIRE 880 -48 880 -128 WIRE -352 112 -432 112 WIRE -272 112 -352 112 WIRE 112 112 -16 112 WIRE 176 112 112 112 WIRE 608 112 576 112 WIRE 656 112 608 112 WIRE 880 112 736 112 WIRE 976 112 880 112 WIRE 1040 112 976 112 WIRE -432 144 -432 112 WIRE -16 144 -16 112 WIRE 880 192 880 112 WIRE -432 256 -432 224 WIRE -16 256 -16 224 WIRE 880 336 880 256 WIRE -320 448 -432 448 WIRE -112 448 -240 448 WIRE 96 448 -32 448 WIRE 288 448 176 448 WIRE 464 448 368 448 WIRE 656 448 544 448 WIRE 720 448 656 448 WIRE 880 448 800 448 WIRE 944 448 880 448 WIRE 1024 448 944 448 WIRE -432 496 -432 448 WIRE 880 496 880 448 WIRE 880 608 880 560 FLAG -16 256 0 FLAG 112 112 N1 FLAG -16 -128 0 FLAG 112 -272 N2 FLAG 576 -48 0 FLAG 880 -48 0 FLAG 880 336 0 FLAG 608 112 N1 FLAG 976 -272 XCLP FLAG 976 112 N1LP FLAG 624 -272 XC FLAG -432 -128 0 FLAG -352 -272 T FLAG -432 256 0 FLAG -352 112 R FLAG 880 608 0 FLAG 656 448 SUM FLAG 944 448 SLP FLAG -432 496 0 SYMBOL bv -16 128 R0 WINDOW 0 97 46 Left 2 WINDOW 3 51 95 Left 2 SYMATTR InstName B1 SYMATTR Value V= 3.94 * ( random(100*time) - 0.5 ) SYMBOL bv -16 -256 R0 WINDOW 0 84 55 Left 2 WINDOW 3 50 100 Left 2 SYMATTR InstName B2 SYMATTR Value V= 3.94 * ( random(101*time) - 0.5 ) SYMBOL bv 576 -208 R0 WINDOW 0 52 78 Left 2 WINDOW 3 27 130 Left 2 SYMATTR InstName B3 SYMATTR Value V= V(N1) * V(N2) SYMBOL res 752 -288 R90 WINDOW 0 74 54 VBottom 2 WINDOW 3 79 54 VTop 2 SYMATTR InstName R3 SYMATTR Value 1 SYMBOL cap 864 -192 R0 WINDOW 0 83 16 Left 2 WINDOW 3 77 55 Left 2 SYMATTR InstName C1 SYMATTR Value 0.16 SYMBOL res 752 96 R90 WINDOW 0 75 54 VBottom 2 WINDOW 3 85 56 VTop 2 SYMATTR InstName R4 SYMATTR Value 1 SYMBOL cap 864 192 R0 WINDOW 0 75 21 Left 2 WINDOW 3 69 58 Left 2 SYMATTR InstName C2 SYMATTR Value 0.16 SYMBOL bv -432 -256 R0 WINDOW 0 86 44 Left 2 WINDOW 3 58 85 Left 2 SYMATTR InstName B4 SYMATTR Value V=TIME SYMBOL bv -432 128 R0 WINDOW 0 89 50 Left 2 WINDOW 3 47 91 Left 2 SYMATTR InstName B5 SYMATTR Value V=random(TIME) SYMBOL bv -224 448 R90 WINDOW 0 71 59 VBottom 2 WINDOW 3 80 58 VTop 2 SYMATTR InstName B6 SYMATTR Value V=random(721*time) - 0.5 SYMBOL bv -16 448 R90 WINDOW 0 71 59 VBottom 2 WINDOW 3 142 62 VTop 2 SYMATTR InstName B7 SYMATTR Value V=random(420*time) - 0.5 SYMBOL bv 192 448 R90 WINDOW 0 71 59 VBottom 2 WINDOW 3 89 58 VTop 2 SYMATTR InstName B8 SYMATTR Value V=random(1234*time) - 0.5 SYMBOL bv 384 448 R90 WINDOW 0 71 59 VBottom 2 WINDOW 3 141 49 VTop 2 SYMATTR InstName B9 SYMATTR Value V=random(555*time) - 0.5 SYMBOL res 816 432 R90 WINDOW 0 76 55 VBottom 2 WINDOW 3 81 55 VTop 2 SYMATTR InstName R5 SYMATTR Value 1 SYMBOL cap 864 496 R0 WINDOW 0 86 16 Left 2 WINDOW 3 82 55 Left 2 SYMATTR InstName C3 SYMATTR Value 0.016 SYMBOL bv 560 448 R90 WINDOW 0 71 59 VBottom 2 WINDOW 3 87 45 VTop 2 SYMATTR InstName B10 SYMATTR Value V=random(1690*time) - 0.5 TEXT 184 -368 Left 2 !.tran 0 10 0 100u TEXT -8 -416 Left 2 ;Some time-domain noise sources J Larkin July 26, 2014 -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Sat, 26 Jul 2014 14:34:46 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

>> ...snip... > What number is more "real" than 50? 50 is a perfectly respectable number.
You missed the whole point. Now THAT comment is blather.
>> ...snip.... > Of course it isn't flat. It's noise. Look at real wideband noise on a > spectrum > analyzer some time. It's noisy!
You missed the whole point again.
>> ...snip.. > The single Random(time) call obviously has a uniform probability > distribution. > EE101. If you want it to be more Gaussian, sum a few of them. > Statistics101.
Only works *IF* you sum a few INDEPENDENT noise sources! As you found out later by having to use the K multiplying factor to try to change the function's coherency.
>> ...snip... > the statistics of random(time), and fix your complaint about the rolloff > shape.
Where do you assume complaint?! That was an observation, albeit an observation that makes it less desirable to use that function, but still an observation. Very importantly, take a look at trying to actually use that function as a 'calibrated' noise source. To actually use any noise source it must be calibrated in terms of resistor value AND BW! With your example, you'll be 'adjusting' every noise source to get each to produce the 'correct' value.
> I was looking for a simple way to graph probability density functions in > LTSpice. Some other time maybe.
When I plotted the probability density function for your multisource technique, and looked at its distribution, it only took about four of the uniform distributions to get a 'decent' gaussian shape, interesting. Didn't know so few could go so far.
>> ..snip... > The random(K*TIME) function changes K times per second regardless of the > LT > Spice time step. So going to smaller time steps doesn't change the > spectrum. See > example below where K=1.
Not quite correct. By making the K factor small, you've caused the random function's K value to dominate, so LTspice .tran maximum steps ultimately have no effect. However, the true LIMITING maximum frequency is set by .tran's maximum step. The 'useable' frequency range can only be set to a frequency smaller than that.
>> ...snip.... > You've done nothing but whine, and present a Thompson-Fermat claim of a > marvelous solution that you don't have room to post. > > If you want to discuss things, great. If you want to whine and bitch, > you should > try to be right.
Discussing is not whining and bitching. Note three times you missed the point and regarding a simple, easy to verify statement you are wrong, yet I've never stooped to calling you an idiot. Instead, I continue to discuss, and again, ask you for your example TWO calibrated noise sources. You still haven't produced them, although purport how 'simple' it is to do.
>> ...snip.... > I can make any number of them. Of arbitrary bandwidth and amplitude, and > as > Gaussian as you like. This ain't hard. > > ....SNIP... description of schematic.... > I think the 3.94 values (to make 1 volt RMS) should actually be 3.464, > the > square root of 12, but maybe the LT Spice smoothing changes the > statistics or > something.
"...ain't hard"? Then where are your two calibrated noise sources? With your questioning sqrt(12), there's hope! yes, LTspice changes things a bit. It 'smooths' the function, which doesn't change the statistics [or may be semantics] but changes the spectral content by rolling off the high frequency end. How valuable is a noise source that you must wait for 1 second?! and then there's a beat in there? [Look closely at your low pass output 'noise' signal.] Interesting statistics. Did you ever analyze the statistics of these 'added' noise sources to determine how many of these noise sources you must add together to reach a specific level of confidence? Hold it! don't assume uncorrelated noise sources either, because the random function is replicated. You only get some type of non-correlation [as you found out] by varying the K multiplier term in the argument. In review: 1. You still haven't produced your claimed simple noise sources. So far, you've made a lot of symbols on a schematic. [Note, I recommend using use multiple current sources, not voltage sources, else you unnecessarily increase the number of nodes in the kernel's analyses.] Although a bit uncontrollable, using random() is an interesting approach. [In other words, so far your solution does NOT meet requirements.] 2. You chide me by saying I'm whining and bitching [no idea where THAT'S coming from] rather than respond to legitimate attempt to discuss. 3. You actually declare I'm wrong without supporting that claim. When YOUR claim(s) is/are wrong. 4. And STILL you have not produced two simple CALIBRATED noise sources. Which you declared several times as an easy task. So summarizing: wrong, name calling, wrong, didn't produce. Again, since using Aioe for access to these usenet groups, I'm limited by number of quote lines AND number of reply lines. It is NOT possible to quote completely, nor possible to post very long copies of a program. I even have to reply to this post to include the example of trying to calibrate your proposed multi-source noise source. NOTE: If any lurkers out there are interested, let me know. I'll see if there's a way to post somewhere a complete description of the basics, of the 'gotcha's', the step by steps, and a set of small programs that can be used on free PC tools to do this. Of course, up front, I say tremendous thanks to Alex Bordodynov for his excellent help in streamlining/automating the technique.
here is the LTspice schematic showing the diffiuclty at 'calibrating' your  
noise source.

Version 4
SHEET 1 27404 860
WIRE 1984 -336 1808 -336
WIRE 2096 -336 1984 -336
WIRE 2128 -336 2096 -336
WIRE 1808 -304 1808 -336
WIRE 1984 -304 1984 -336
WIRE 1808 -192 1808 -224
WIRE 1984 -192 1984 -224
FLAG 1984 -192 0
FLAG 1808 -192 0
FLAG 2096 -336 noise
SYMBOL res 1968 -320 R0
SYMATTR InstName R1
SYMATTR Value 1
SYMBOL bv 1808 -320 R0
WINDOW 0 -67 10 Left 2
WINDOW 3 -414 168 Left 2
SYMATTR InstName B1
SYMATTR Value V=(random(100*time)-0.5)/0.20353/1.134/0.98523
TEXT 1448 -272 Left 2 !.tran 5
TEXT 1448 -336 Left 2 !.options plotwinsize=0;\n.param fmax=50
TEXT 2256 -312 Left 2 ;Why does it take three attempts to find the  
constant to make this 1Vrms?\nV=random(100*time)-0.5 produces  
203.53mVrms\nV=(random(100*time)-0.5)/0.20353 produces  
1.134Vrms\nV=(random(100*time)-0.5)/0.20353/1.134 produces  
985.23mVrms\nV=(random(100*time)-0.5)/0.20353/1.134/0.98523 produces  
1.0005Vrms\nnote: k=4.3977, not the expected sqrt(12)=3.4641, odd.
TEXT 1704 -408 Left 3 ;Uncontrollable Aspects of Using Random Function as  
a Noise Source



oops, guess it wasn't that long!
On Sun, 27 Jul 2014 19:23:54 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>On Sat, 26 Jul 2014 14:34:46 -0700, John Larkin ><jjlarkin@highnotlandthistechnologypart.com> wrote: > >>> ...snip... >> What number is more "real" than 50? 50 is a perfectly respectable number. > >You missed the whole point. Now THAT comment is blather. > >>> ...snip.... >> Of course it isn't flat. It's noise. Look at real wideband noise on a >> spectrum >> analyzer some time. It's noisy! > >You missed the whole point again. > >>> ...snip.. >> The single Random(time) call obviously has a uniform probability >> distribution. >> EE101. If you want it to be more Gaussian, sum a few of them. >> Statistics101. > >Only works *IF* you sum a few INDEPENDENT noise sources! As you found out >later by having to use the K multiplying factor to try to change the >function's coherency.
I didn't find that out "later". I've known that for decades. And changing the K factor does deconhere the sources. Throw in some sines or something if you want, but I don't think they are necessary.
> >>> ...snip... >> the statistics of random(time), and fix your complaint about the rolloff >> shape. > >Where do you assume complaint?! That was an observation, albeit an >observation that makes it less desirable to use that function, but still >an observation. Very importantly, take a look at trying to actually use >that function as a 'calibrated' noise source. To actually use any noise >source it must be calibrated in terms of resistor value AND BW! With your >example, you'll be 'adjusting' every noise source to get each to produce >the 'correct' value.
What's wrong with that? If you used a zener diode noise source, you'd have a trimpot or something to adjust the RMS noise voltage.
> >> I was looking for a simple way to graph probability density functions in >> LTSpice. Some other time maybe. > >When I plotted the probability density function for your multisource >technique, and looked at its distribution, it only took about four of the >uniform distributions to get a 'decent' gaussian shape, interesting. >Didn't know so few could go so far.
The crest factor for a single source is already over 2. Four sources gets you to 4, which is OK.
> >>> ..snip... >> The random(K*TIME) function changes K times per second regardless of the >> LT >> Spice time step. So going to smaller time steps doesn't change the >> spectrum. See >> example below where K=1. > >Not quite correct. By making the K factor small, you've caused the random >function's K value to dominate, so LTspice .tran maximum steps ultimately >have no effect. However, the true LIMITING maximum frequency is set by >.tran's maximum step. The 'useable' frequency range can only be set to a >frequency smaller than that.
LT Spice smooths the steps (and I don't know how he manages to do that) so the spectrum rolls off well below Nyquist. So, tune the K values and filter the output until it makes the noise you want.
> >>> ...snip.... >> You've done nothing but whine, and present a Thompson-Fermat claim of a >> marvelous solution that you don't have room to post. >> >> If you want to discuss things, great. If you want to whine and bitch, >> you should >> try to be right. > >Discussing is not whining and bitching. Note three times you missed the >point and regarding a simple, easy to verify statement you are wrong, yet >I've never stooped to calling you an idiot. Instead, I continue to >discuss, and again, ask you for your example TWO calibrated noise sources. >You still haven't produced them, although purport how 'simple' it is to do.
N1 is a calibrated (1 volt RMS) noise source. N2 is an identical but uncorrelated source. My sum thing is a pretty Gaussian source. You should be able to copy/paste the Gaussian source, select some different K values, and get a second, independent Gaussian source. Scaling the RMS voltage is easy too. Surely you don't need help doing any of that.
> >>> ...snip.... >> I can make any number of them. Of arbitrary bandwidth and amplitude, and >> as >> Gaussian as you like. This ain't hard. >> >> ....SNIP... description of schematic.... >> I think the 3.94 values (to make 1 volt RMS) should actually be 3.464, >> the >> square root of 12, but maybe the LT Spice smoothing changes the >> statistics or >> something. > >"...ain't hard"? Then where are your two calibrated noise sources?
N1. N2.
> >With your questioning sqrt(12), there's hope! yes, LTspice changes things >a bit. It 'smooths' the function, which doesn't change the statistics [or >may be semantics] but changes the spectral content by rolling off the high >frequency end. > >How valuable is a noise source that you must wait for 1 second?!
There's no need to wait any time. I purposely selected K values of 100 and 101 to demonstrate 1 second decoherence, just for fun. and then
>there's a beat in there? [Look closely at your low pass output 'noise' >signal.] Interesting statistics. Did you ever analyze the statistics of >these 'added' noise sources to determine how many of these noise sources >you must add together to reach a specific level of confidence? Hold it! >don't assume uncorrelated noise sources either, because the random >function is replicated. You only get some type of non-correlation [as you >found out] by varying the K multiplier term in the argument.
All obvious. And we're simulating noisy analog circuits, not generating crypto keys for the NSA.
> >In review: >1. You still haven't produced your claimed simple noise sources. So far, >you've made a lot of symbols on a schematic. [Note, I recommend using use >multiple current sources, not voltage sources, else you unnecessarily >increase the number of nodes in the kernel's analyses.] Although a bit >uncontrollable, using random() is an interesting approach. [In other >words, so far your solution does NOT meet requirements.] >2. You chide me by saying I'm whining and bitching [no idea where THAT'S >coming from] rather than respond to legitimate attempt to discuss. >3. You actually declare I'm wrong without supporting that claim. When YOUR >claim(s) is/are wrong. >4. And STILL you have not produced two simple CALIBRATED noise sources. >Which you declared several times as an easy task.
N1. N2.
> >So summarizing: wrong, name calling, wrong, didn't produce. > > > >Again, since using Aioe for access to these usenet groups, I'm limited by >number of quote lines AND number of reply lines. It is NOT possible to >quote completely, nor possible to post very long copies of a program. I >even have to reply to this post to include the example of trying to >calibrate your proposed multi-source noise source.
Filter it to the desired spectral shape and bandwidth. Then measure the RMS voltage and scale to whatever you need. I can't believe that I have to explain stuff this simple.
> > >NOTE: If any lurkers out there are interested, let me know. I'll see if >there's a way to post somewhere a complete description of the basics, of >the 'gotcha's', the step by steps, and a set of small programs that can be >used on free PC tools to do this. Of course, up front, I say tremendous >thanks to Alex Bordodynov for his excellent help in >streamlining/automating the technique.
-- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Sun, 27 Jul 2014 19:26:57 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>here is the LTspice schematic showing the diffiuclty at 'calibrating' your >noise source. > >Version 4 >SHEET 1 27404 860 >WIRE 1984 -336 1808 -336 >WIRE 2096 -336 1984 -336 >WIRE 2128 -336 2096 -336 >WIRE 1808 -304 1808 -336 >WIRE 1984 -304 1984 -336 >WIRE 1808 -192 1808 -224 >WIRE 1984 -192 1984 -224 >FLAG 1984 -192 0 >FLAG 1808 -192 0 >FLAG 2096 -336 noise >SYMBOL res 1968 -320 R0 >SYMATTR InstName R1 >SYMATTR Value 1 >SYMBOL bv 1808 -320 R0 >WINDOW 0 -67 10 Left 2 >WINDOW 3 -414 168 Left 2 >SYMATTR InstName B1 >SYMATTR Value V=(random(100*time)-0.5)/0.20353/1.134/0.98523 >TEXT 1448 -272 Left 2 !.tran 5 >TEXT 1448 -336 Left 2 !.options plotwinsize=0;\n.param fmax=50 >TEXT 2256 -312 Left 2 ;Why does it take three attempts to find the >constant to make this 1Vrms?\nV=random(100*time)-0.5 produces >203.53mVrms\nV=(random(100*time)-0.5)/0.20353 produces >1.134Vrms\nV=(random(100*time)-0.5)/0.20353/1.134 produces >985.23mVrms\nV=(random(100*time)-0.5)/0.20353/1.134/0.98523 produces >1.0005Vrms\nnote: k=4.3977, not the expected sqrt(12)=3.4641, odd. >TEXT 1704 -408 Left 3 ;Uncontrollable Aspects of Using Random Function as >a Noise Source > > > >oops, guess it wasn't that long!
The problem here is that, with only one simple function on the screen, LT Spice uses huge time steps and gets the RMS value wrong. LT Spice is quirky that way. I wish it allowed me to specify the exact, invariant time step; that would help with a number of issues. Try setting the max time step to 10u or 100u. Then things scale sensibly. The correct RMS value of 'noise', unscaled, seems to be 251.1 mV. -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation