Electronics-Related.com
Forums

Learning about oscillators in LTSpice

Started by Clifford Heath October 21, 2010
On Mon, 28 Jul 2014 22:36:45 -0400, Phil Hobbs <hobbs@electrooptical.net> wrote:

>On 7/28/2014 9:24 PM, John Larkin wrote: >> On Mon, 28 Jul 2014 16:31:38 -0700, RobertMacy >> <robert.a.macy@gmail.com> wrote: >> >>> On Mon, 28 Jul 2014 16:15:18 -0700, Phil Hobbs <hobbs@electrooptical.net> >>> wrote: >>> >>>>>> ...snip.... >>>> >>>> I discussed how to fix that in later posts, like so. I asked on the >>>> Yahoo LTspice group whether there's any way to do frequency binning on >>>> the LTspice FFT function. So far, it doesn't look like it. >>>> >>>> Cheers >>>> >>>> Phil Hobbs >>>> >>> I saw that, ....but didn't understand the purpose of the discussion and >>> deleted the thread. didn't know you started it, thought John Woodgate, UK >>> started it. oops. >>> >>> Check a reply to John Larking, the FULL details of how to do the >>> .transoise technique are in there. >> >> Seems awfully complex. This is pretty good: >> >> >> Version 4 >> SHEET 1 880 680 >> WIRE 192 64 128 64 >> WIRE 272 64 192 64 >> WIRE 432 64 352 64 >> WIRE 512 64 432 64 >> WIRE 576 64 512 64 >> WIRE 128 96 128 64 >> WIRE 432 112 432 64 >> WIRE 128 208 128 176 >> WIRE 432 208 432 176 >> FLAG 128 208 0 >> FLAG 192 64 NOISE >> FLAG 432 208 0 >> FLAG 512 64 LPF >> SYMBOL bv 128 80 R0 >> WINDOW 0 -68 104 Left 2 >> WINDOW 3 -225 179 Left 2 >> SYMATTR InstName B1 >> SYMATTR Value V=58.65 * ( rand(12345*time) - 0.5 ) >> SYMBOL res 368 48 R90 >> WINDOW 0 72 56 VBottom 2 >> WINDOW 3 78 56 VTop 2 >> SYMATTR InstName R1 >> SYMATTR Value 1 >> SYMBOL cap 416 112 R0 >> WINDOW 0 70 20 Left 2 >> WINDOW 3 63 53 Left 2 >> SYMATTR InstName C1 >> SYMATTR Value 0.016 >> TEXT -176 104 Left 2 !.tran 0 10 0 10u >> TEXT 24 -40 Left 2 ;10 Hz Noise Source J Larkin July 28, 2014 >> >> >> rand() runs about 6 times faster than random() and gives slightly >> better crest factors and a mildly messier spectrum. Shaping the noise >> spectrum would be easy by futzing the filter. >> >> > >That method is appealingly simple, I agree. It generates independent >samples much more slowly than the Box-Mueller approach, though, because >you're relying on the central limit theorem to give you your Gaussian >statistics, rather than applying the inverse function. > >Cheers > >Phil Hobbs
Wouldn't you want to soften the sharp edges anyhow? -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Mon, 28 Jul 2014 19:39:53 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>On Mon, 28 Jul 2014 18:24:07 -0700, John Larkin ><jlarkin@highlandtechnology.com> wrote: > >>> ...snip... >> Seems awfully complex. This is pretty good: > >May be good, but don't see how to use it to analyze an MC1496, would you >show us?
No thanks. Analyzing an MC1496 is a job for a historian, not an engineeer. Is it 50 years old yet? Why not just measure it? It's probably noisier than a sim would predict. Point is, rand(time) can be the basis of a pretty good time-domain noise source, and it's easy. -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Mon, 28 Jul 2014 20:21:45 -0700, Phil Hobbs  
<pcdhSpamMeSenseless@electrooptical.net> wrote:

> On 7/28/2014 7:02 PM, RobertMacy wrote: >> On Sat, 26 Jul 2014 14:34:46 -0700, John Larkin >> <jjlarkin@highnotlandthistechnologypart.com> wrote: >> >>>> ..snip... >>> >>> Post an LT Spice demo. >>> >> >> whew >> >> Since limited by length here, will try to put everything in. >> > > Eternal September costs the same as aioe, and doesn't have the silly > limitation. > > Cheers > > Phil Hobbs > >
Yes, I am signed up for Eternal September and use it to receive every Usenet, but alt.home.repair but alas some setting I haven't figured out won't let me post through it, keep getting an error about some setting is wrong. So, when Aioe allowed me to instantly get going, was done.
On Mon, 28 Jul 2014 21:00:57 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

>> ...snip.... > Point is, rand(time) can be the basis of a pretty good time-domain noise > source, > and it's easy.
Acutally white() is not a bad basis, but was 'difficult' to concquer the myriad of problems, thus the solution I posted to you. This is your second email ADMITTING to not providing your offer of two noise sources. The other one you talked about 100 and 101 as some point of a flaw and this one you call it a basis. Still interested in a simple two resistor circuit with two sources I'll post one here for you later, It has an interesting way to show the effects of that rounding in LTspice.
On Tue, 29 Jul 2014 06:39:35 -0700, RobertMacy <robert.a.macy@gmail.com> wrote:

>On Mon, 28 Jul 2014 21:00:57 -0700, John Larkin ><jjlarkin@highnotlandthistechnologypart.com> wrote: > >>> ...snip.... >> Point is, rand(time) can be the basis of a pretty good time-domain noise >> source, >> and it's easy. > >Acutally white() is not a bad basis, but was 'difficult' to concquer the >myriad of problems, thus the solution I posted to you. > >This is your second email ADMITTING to not providing your offer of two >noise sources. The other one you talked about 100 and 101 as some point of >a flaw and this one you call it a basis. Still interested in a simple two >resistor circuit with two sources
My N1 and N2 are independent noise sources. You're not making sense. -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation
On Tue, 29 Jul 2014 07:26:15 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

>> ...snip.... > > My N1 and N2 are independent noise sources. You're not making sense.
No, they are not independent. Again, Vrms for N1, N2, and sum are approximately the same value. Check the spectrum of N1, N2 [which are the same], BUT the spectrum for the sum is off more than 8dB, signifying a fair bit of 'non-independency'. you did look at my other reply? named NoiseSources_JohnLarking_compared.asc Version 4 SHEET 1 2088 680 WIRE -176 -256 -240 -256 WIRE -112 -256 -176 -256 WIRE -48 -256 -112 -256 WIRE 528 -256 464 -256 WIRE 592 -256 528 -256 WIRE 656 -256 592 -256 WIRE -240 -224 -240 -256 WIRE 464 -224 464 -256 WIRE -240 -112 -240 -144 WIRE 464 -112 464 -144 WIRE 160 -80 64 -80 WIRE 192 -80 160 -80 WIRE 864 -80 768 -80 WIRE 896 -80 864 -80 WIRE 64 -64 64 -80 WIRE 768 -64 768 -80 WIRE -176 -48 -176 -256 WIRE 16 -48 -176 -48 WIRE 528 -48 528 -256 WIRE 720 -48 528 -48 WIRE 16 0 -176 0 WIRE 720 0 528 0 WIRE 64 64 64 16 WIRE 768 64 768 16 WIRE -176 128 -176 0 WIRE -176 128 -240 128 WIRE -112 128 -176 128 WIRE -48 128 -112 128 WIRE 528 128 528 0 WIRE 528 128 464 128 WIRE 592 128 528 128 WIRE 656 128 592 128 WIRE -240 160 -240 128 WIRE 464 160 464 128 WIRE -240 272 -240 240 WIRE 464 272 464 240 FLAG -240 272 0 FLAG -112 128 uniform_N2 FLAG -240 -112 0 FLAG -112 -256 uniform_N1 FLAG 64 64 0 FLAG 160 -80 uniform_out FLAG 464 272 0 FLAG 592 128 white_N2 FLAG 464 -112 0 FLAG 592 -256 white_N1 FLAG 768 64 0 FLAG 864 -80 white_out SYMBOL bv -240 144 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 -240 -240 R0 WINDOW 0 84 55 Left 2 WINDOW 3 50 100 Left 2 SYMATTR InstName B2 SYMATTR Value V= 3.94 * ( random(1021*time) - 0.5 ) SYMBOL e 64 -80 R0 SYMATTR InstName E1 SYMATTR Value {1/sqrt(2)} SYMBOL bv 464 144 R0 WINDOW 0 97 46 Left 2 WINDOW 3 51 95 Left 2 SYMATTR InstName B3 SYMATTR Value V= 4.08*white(100*time) SYMBOL bv 464 -240 R0 WINDOW 0 84 55 Left 2 WINDOW 3 50 100 Left 2 SYMATTR InstName B4 SYMATTR Value V= 4.08*white(1021*time) SYMBOL e 768 -80 R0 SYMATTR InstName E2 SYMATTR Value {1/sqrt(2)} TEXT 176 -304 Left 2 !.tran 0 10 0 100u TEXT -112 -352 Left 2 ;MODIFIED [Some time-domain noise sources J Larkin July 26, 2014] TEXT 1040 -112 Left 2 ;NOTE: useable range is only minimum to 25Hz due to the use of 100 as a k factor\nvery slow analysis for only two sets of sources,shudder at 10 of these!\nwhy are the 'independent' noise sources produce 8 dB more energy?\nhow does anyone interpret the nV/rtHz from the the spectral plot? TEXT 920 96 Left 2 ;white() is described as a 'gaussian' distribution value limited random signal\nrandom() is described as a 'uniform' distribution also value limited random signal\nIt is very interesting the spectrum of the two so closely match and \n further the distributions do not seem to impact that spectrum TEXT 896 -264 Left 2 ;ERROR: the rms voltage of EACH noise is 1 Vrms, \nyet over the 'useable' range of 0.1Hz to 25 Hz\nthe spectral energies are NOT the same and are off by over 8dB
On Tue, 29 Jul 2014 12:10:29 -0700, RobertMacy
<robert.a.macy@gmail.com> wrote:

>On Tue, 29 Jul 2014 07:26:15 -0700, John Larkin ><jjlarkin@highnotlandthistechnologypart.com> wrote: > >>> ...snip.... >> >> My N1 and N2 are independent noise sources. You're not making sense. > >No, they are not independent. > >Again, Vrms for N1, N2, and sum are approximately the same value.
I measured the sum as almost exactly 1.41 times the individual values. N1 and N2 only correlate for the first second, and that was deliberate. You don't have to do that. You can break almost anything that you don't like. LT Spice will help you if you want. -- John Larkin Highland Technology, Inc jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Tue, 29 Jul 2014 07:26:15 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

APOLOGIES!

typo alert! left hand keeps adding a g and typing 'ing' instead of 'in'

Absolutely no insult intended. Again, apologies.
On Mon, 28 Jul 2014 21:00:57 -0700, John Larkin  
<jjlarkin@highnotlandthistechnologypart.com> wrote:

>> ...snip.... > > Point is, rand(time) can be the basis of a pretty good time-domain noise > source, > and it's easy.
As promised here is a simple resistor network with CALIBRATED noise sources. The schematic has comparison notes. It is interesting to note that the resistor networks do NOT even add a single node to the PSpice solution matrix, which maintains speed [and I'll bet accuracy] some of the fonts may not transfer. ResistorCompare.asc Version 4 SHEET 1 27404 712 WIRE 896 -16 880 -16 WIRE 1344 -16 896 -16 WIRE 1936 -16 1424 -16 WIRE 2048 -16 1936 -16 WIRE 2112 -16 2048 -16 WIRE 2208 -16 2112 -16 WIRE 880 16 880 -16 WIRE 1936 16 1936 -16 WIRE 2048 32 2048 -16 WIRE 2144 32 2048 32 WIRE 2048 112 2048 96 WIRE 2144 112 2048 112 WIRE 2368 112 2256 112 WIRE 2416 112 2368 112 WIRE 880 144 880 96 WIRE 1936 144 1936 96 WIRE 2048 144 2048 112 WIRE 2256 160 2256 112 WIRE 2208 176 2208 -16 WIRE 2256 272 2256 240 WIRE 1248 320 1232 320 WIRE 1312 320 1248 320 WIRE 1328 320 1312 320 WIRE 1424 320 1408 320 WIRE 1936 320 1424 320 WIRE 2048 320 1936 320 WIRE 2112 320 2048 320 WIRE 2208 320 2208 224 WIRE 2208 320 2112 320 WIRE 1936 336 1936 320 WIRE 1936 336 1856 336 WIRE 1856 352 1856 336 WIRE 1936 352 1936 336 WIRE 2048 368 2048 320 WIRE 2144 368 2048 368 WIRE 1312 400 1312 320 WIRE 1328 400 1312 400 WIRE 1424 400 1424 320 WIRE 1424 400 1408 400 WIRE 1856 448 1856 432 WIRE 1936 448 1936 432 WIRE 1936 448 1856 448 WIRE 2048 448 2048 432 WIRE 2144 448 2048 448 WIRE 1936 480 1936 448 WIRE 2048 480 2048 448 FLAG 880 144 0 FLAG 1936 144 0 FLAG 2048 144 0 FLAG 1936 480 0 FLAG 2048 480 0 FLAG 896 -16 in FLAG 1248 320 in FLAG 2112 320 out FLAG 2112 -16 out1 FLAG 2256 272 0 FLAG 2368 112 compare SYMBOL res 1328 0 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 0 56 VBottom 2 SYMATTR InstName Rs1 SYMATTR Value {Rs} SYMBOL res 1920 0 R0 SYMATTR InstName Rload1 SYMATTR Value {Rload} SYMBOL voltage 880 0 R0 WINDOW 0 -119 20 Left 2 WINDOW 3 -249 101 Left 2 WINDOW 123 -131 67 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName Vin SYMATTR Value SINE(0 100uV 100kHz) SYMATTR Value2 AC 1 SYMBOL cap 2032 32 R0 SYMATTR InstName Cload1 SYMATTR Value 1nF SYMBOL res 1312 336 R270 WINDOW 0 32 56 VTop 2 WINDOW 3 -1 62 VBottom 2 SYMATTR InstName Rs2 SYMATTR Value {Rs} SYMBOL res 1920 336 R0 SYMATTR InstName Rload2 SYMATTR Value {Rload} SYMBOL cap 2032 368 R0 SYMATTR InstName Cload2 SYMATTR Value 1nF SYMBOL e 2256 144 R0 SYMATTR InstName Ecompare SYMATTR Value 1 SYMBOL current 1328 400 R270 WINDOW 0 -66 33 VTop 2 WINDOW 3 -94 33 VTop 2 SYMATTR InstName InoiseRs SYMATTR Value PWL value_scale_factor={sqrt(4*k*T/Rs*fmax)} time_scale_factor={dt} file=Vn1.txt SYMBOL current 1856 352 R0 WINDOW 0 -142 -7 Left 2 WINDOW 3 -154 176 Left 2 SYMATTR InstName InoiseRload SYMATTR Value PWL value_scale_factor={sqrt(4*k*T/Rload*fmax)} time_scale_factor={dt} file=Vn2.txt TEXT 584 424 Left 2 !.tran 0 {Tstop} {Tstart} {dt/2} TEXT 592 344 Left 2 ;.ac dec 100 {BW} {fmax} TEXT 592 376 Left 2 ;.noise V(out) Vin dec 100 {BW} {fmax} TEXT 1400 -104 Left 2 ;NORMAL CIRCUIT TEXT 1376 232 Left 2 ;.TRANOISE CIRCUIT TEXT 584 168 Left 2 !.options plotwinsize=0\n.param Rs=1k Rload=5k\n.param k=1.38e-23 T=300 N=20000 fmax=10MEG\n.param Tstop={1.1*N/2/fmax} Tstart={0.1*N/2/fmax}\n.param dt={1/2/fmax} BW={2*fmax/N} TEXT 1256 104 Left 2 ;Circuit set up for 1kHz to 10MHz operation TEXT 2472 -16 Left 2 ;.ac V(out) at 100kHz is -2.62657dB, if rms for 100uVp signal that is 52.258 uVrms\n.noise V(onoise) shows 2.0199&micro;Vrms\n with no cap, 11.752&micro;Vrms\n starts at 3.71659nV/Hz&frac12;\n with no cap, 3.71664nV/Hz&frac12;\n.tran V(compare) ctl-left-clk shows approx 2.0245&micro;Vrms\n with no cap, 11.522&micro;Vrms\n from FFT approx starts at -140dBV, estimate start at 3.2 nV/rtHz\n with no cap, approx -140dBV, estimate 3.2 nVrms/rtHz\n using V(out), peak arppox -86.0377dBV\n octave Post Processing:\n using V(compare_eq)\n time waveform, 2.04uVrms\n after conversion to spectrum using time2freq, starts with 3.64nV/rtHz\n using V(out_eq)\n after conversion to spectrum using time2freq, peak occurs at -85.639 dBV, 52.246uVrms TEXT 824 520 Left 2 ;NOTE: Usually the full formula of each PWL description are NOT shown,\n but are left shown here for review.
On Tue, 29 Jul 2014 12:16:55 -0700, John Larkin  
<jlarkin@highlandtechnology.com> wrote:

> On Tue, 29 Jul 2014 12:10:29 -0700, RobertMacy > <robert.a.macy@gmail.com> wrote: > >> On Tue, 29 Jul 2014 07:26:15 -0700, John Larkin >> <jjlarkin@highnotlandthistechnologypart.com> wrote: >> >>>> ...snip.... >>> >>> My N1 and N2 are independent noise sources. You're not making sense. >> >> No, they are not independent. >> >> Again, Vrms for N1, N2, and sum are approximately the same value. > > I measured the sum as almost exactly 1.41 times the individual values. > N1 and N2 only correlate for the first second, and that was > deliberate. You don't have to do that. > > You can break almost anything that you don't like. LT Spice will help > you if you want. > >
not trying to break, was examining it. and the statment the same Vrms is BECAUSE when I summed I used 1/sqrt(2) to make them similar. Didn't you look at the schematic?