Forums

dac dithering

Started by John Larkin November 29, 2013
On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >> >> <robert.a.macy@gmail.com> wrote: >> >> >> >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs >> >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >> >> > >> >> >>> ...snip... >> >> >> It's pretty simple--the probability density of the sum of two >> >> >> uncorrelated variables (e.g. sines of incommensurate frequency) is the >> >> >> convolution of the two individual densities. So the nasty peaks at the >> >> >> ends get smoothed off. >> >> >> >> >> >> ..snip... >> >> > >> >> >Isn't the distribution sometype of hyperbolic function? Looks like spires >> >> >on a suspension bridge. >> >> > >> >> >HP used to make a histogram instrument, replicated the probably function >> >> >of a sine wave pretty well. >> >> > >> >> >Once I can get the function, I'll pop it through octave and see just how >> >> >'flat' the probability distribution goes. >> >> >> >> I'd love to see that. I haven't got around to learning how to drive >> >> Matlab or its clones. Maybe try more than two uncorrelated sines? >> >> >> >> I tried adding a histogram block (swept window comparator and lowpass >> >> filter) but it ran really slow, and I put that aside for now. That >> >> would be a cool intrinsic for LT Spice. Or I guess I could export a >> >> waveform and sic a PowerBasic program on it. The other thing I'd like >> >> to have is a time-domain Gaussian noise generator. Anybody want to >> >> write one? $100? Lunch at Zuni? > >in ltspice export the waveform, run something like this in scilab: > >signal = csvRead('filename.txt',ascii(9), '.', 'double'); >histplot(100,signal(:,2)) > > >no guarantees but will this work? > >Version 4 >SHEET 1 3688 680 >WIRE 224 96 80 96 >WIRE 224 112 224 96 >WIRE 80 128 80 96 >WIRE 224 208 224 192 >FLAG 80 208 0 >FLAG 224 208 0 >SYMBOL res 208 96 R0 >SYMATTR InstName R1 >SYMATTR Value 1 >SYMBOL bv 80 112 R0 >WINDOW 3 -33 155 Left 2 >SYMATTR InstName B1 >SYMATTR Value V=sqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20)) * cos(2pi * random(time*100e6+300e6)) >TEXT 48 232 Left 2 !.tran 0 1m 0 10n > > >-Lasse
That is very cool. I don't understand it, but it looks right and FFTs pretty flat to about 10 MHz. Cash? Zuni? -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation Picosecond-resolution Digital Delay and Pulse generators Custom timing and laser controllers Photonics and fiberoptic TTL data links VME analog, thermocouple, LVDT, synchro, tachometer Multichannel arbitrary waveform generators
Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin:
> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >=20 > <langwadt@fonz.dk> wrote: >=20 >=20 >=20 > >Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >=20 > >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >=20 > >>=20 >=20 > >> <robert.a.macy@gmail.com> wrote: >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs =20 >=20 > >>=20 >=20 > >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >>> ...snip... >=20 > >>=20 >=20 > >> >> It's pretty simple--the probability density of the sum of two =20 >=20 > >>=20 >=20 > >> >> uncorrelated variables (e.g. sines of incommensurate frequency) is =
the =20
>=20 > >>=20 >=20 > >> >> convolution of the two individual densities. So the nasty peaks at=
the =20
>=20 > >>=20 >=20 > >> >> ends get smoothed off. >=20 > >>=20 >=20 > >> >> >=20 > >>=20 >=20 > >> >> ..snip... >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >Isn't the distribution sometype of hyperbolic function? Looks like sp=
ires =20
>=20 > >>=20 >=20 > >> >on a suspension bridge. >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >HP used to make a histogram instrument, replicated the probably funct=
ion =20
>=20 > >>=20 >=20 > >> >of a sine wave pretty well. >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >Once I can get the function, I'll pop it through octave and see just =
how =20
>=20 > >>=20 >=20 > >> >'flat' the probability distribution goes. >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >> I'd love to see that. I haven't got around to learning how to drive >=20 > >>=20 >=20 > >> Matlab or its clones. Maybe try more than two uncorrelated sines? >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >> I tried adding a histogram block (swept window comparator and lowpass >=20 > >>=20 >=20 > >> filter) but it ran really slow, and I put that aside for now. That >=20 > >>=20 >=20 > >> would be a cool intrinsic for LT Spice. Or I guess I could export a >=20 > >>=20 >=20 > >> waveform and sic a PowerBasic program on it. The other thing I'd like >=20 > >>=20 >=20 > >> to have is a time-domain Gaussian noise generator. Anybody want to >=20 > >>=20 >=20 > >> write one? $100? Lunch at Zuni? >=20 > > >=20 > >in ltspice export the waveform, run something like this in scilab:=20 >=20 > > >=20 > >signal =3D csvRead('filename.txt',ascii(9), '.', 'double'); >=20 > >histplot(100,signal(:,2)) >=20 > > >=20 > > >=20 > >no guarantees but will this work? >=20 > > >=20 > >Version 4 >=20 > >SHEET 1 3688 680 >=20 > >WIRE 224 96 80 96 >=20 > >WIRE 224 112 224 96 >=20 > >WIRE 80 128 80 96 >=20 > >WIRE 224 208 224 192 >=20 > >FLAG 80 208 0 >=20 > >FLAG 224 208 0 >=20 > >SYMBOL res 208 96 R0 >=20 > >SYMATTR InstName R1 >=20 > >SYMATTR Value 1 >=20 > >SYMBOL bv 80 112 R0 >=20 > >WINDOW 3 -33 155 Left 2 >=20 > >SYMATTR InstName B1 >=20 > >SYMATTR Value V=3Dsqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi *=
random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20))= * cos(2pi * random(time*100e6+300e6))
>=20 > >TEXT 48 232 Left 2 !.tran 0 1m 0 10n >=20 > > >=20 > > >=20 > >-Lasse >=20 >=20 >=20 >=20 >=20 > That is very cool. I don't understand it, but it looks right and FFTs pre=
tty
>=20 > flat to about 10 MHz.=20
it was an attempt at a Box=96Muller transform, two of them to get it symmet= ric and some hacks on time to get some random numbers, I'm not sure how well it= works I'm not sure I understand the Time variable in ltspice
> Cash? Zuni? >=20
I'll look you up if I'm the neighborhood :P -Lasse
On Mon, 2 Dec 2013 17:35:21 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin: >> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >> >> <langwadt@fonz.dk> wrote: >> >> >> >> >Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >> >> >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >> >> >> >> >> >> <robert.a.macy@gmail.com> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs >> >> >> >> >> >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >> >> >> >> >> >> > >> >> >> >> >> >> >>> ...snip... >> >> >> >> >> >> >> It's pretty simple--the probability density of the sum of two >> >> >> >> >> >> >> uncorrelated variables (e.g. sines of incommensurate frequency) is the >> >> >> >> >> >> >> convolution of the two individual densities. So the nasty peaks at the >> >> >> >> >> >> >> ends get smoothed off. >> >> >> >> >> >> >> >> >> >> >> >> >> >> ..snip... >> >> >> >> >> >> > >> >> >> >> >> >> >Isn't the distribution sometype of hyperbolic function? Looks like spires >> >> >> >> >> >> >on a suspension bridge. >> >> >> >> >> >> > >> >> >> >> >> >> >HP used to make a histogram instrument, replicated the probably function >> >> >> >> >> >> >of a sine wave pretty well. >> >> >> >> >> >> > >> >> >> >> >> >> >Once I can get the function, I'll pop it through octave and see just how >> >> >> >> >> >> >'flat' the probability distribution goes. >> >> >> >> >> >> >> >> >> >> >> >> I'd love to see that. I haven't got around to learning how to drive >> >> >> >> >> >> Matlab or its clones. Maybe try more than two uncorrelated sines? >> >> >> >> >> >> >> >> >> >> >> >> I tried adding a histogram block (swept window comparator and lowpass >> >> >> >> >> >> filter) but it ran really slow, and I put that aside for now. That >> >> >> >> >> >> would be a cool intrinsic for LT Spice. Or I guess I could export a >> >> >> >> >> >> waveform and sic a PowerBasic program on it. The other thing I'd like >> >> >> >> >> >> to have is a time-domain Gaussian noise generator. Anybody want to >> >> >> >> >> >> write one? $100? Lunch at Zuni? >> >> > >> >> >in ltspice export the waveform, run something like this in scilab: >> >> > >> >> >signal = csvRead('filename.txt',ascii(9), '.', 'double'); >> >> >histplot(100,signal(:,2)) >> >> > >> >> > >> >> >no guarantees but will this work? >> >> > >> >> >Version 4 >> >> >SHEET 1 3688 680 >> >> >WIRE 224 96 80 96 >> >> >WIRE 224 112 224 96 >> >> >WIRE 80 128 80 96 >> >> >WIRE 224 208 224 192 >> >> >FLAG 80 208 0 >> >> >FLAG 224 208 0 >> >> >SYMBOL res 208 96 R0 >> >> >SYMATTR InstName R1 >> >> >SYMATTR Value 1 >> >> >SYMBOL bv 80 112 R0 >> >> >WINDOW 3 -33 155 Left 2 >> >> >SYMATTR InstName B1 >> >> >SYMATTR Value V=sqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20)) * cos(2pi * random(time*100e6+300e6)) >> >> >TEXT 48 232 Left 2 !.tran 0 1m 0 10n >> >> > >> >> > >> >> >-Lasse >> >> >> >> >> >> That is very cool. I don't understand it, but it looks right and FFTs pretty >> >> flat to about 10 MHz. > >it was an attempt at a Box&#2013266070;Muller transform, two of them to get it symmetric >and some hacks on time to get some random numbers, I'm not sure how well it works I'm not sure I understand the Time variable in ltspice > >> Cash? Zuni? >> > >I'll look you up if I'm the neighborhood :P > > >-Lasse
I can't find the "time" variable explained in the Help. It looks like it's, well, time: Version 4 SHEET 1 880 680 WIRE 320 64 128 64 WIRE 400 64 320 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 SYMBOL bv 128 80 R0 WINDOW 0 -99 36 Left 2 WINDOW 3 -135 82 Left 2 SYMATTR InstName B1 SYMATTR Value V=time SYMBOL res 304 96 R0 SYMATTR InstName R1 SYMATTR Value 1 TEXT 192 16 Left 2 !.tran 5 -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation Picosecond-resolution Digital Delay and Pulse generators Custom timing and laser controllers Photonics and fiberoptic TTL data links VME analog, thermocouple, LVDT, synchro, tachometer Multichannel arbitrary waveform generators
On Mon, 2 Dec 2013 17:35:21 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin: >> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >> >> <langwadt@fonz.dk> wrote: >> >> >> >> >Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >> >> >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >> >> >> >> >> >> <robert.a.macy@gmail.com> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs >> >> >> >> >> >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >> >> >> >> >> >> > >> >> >> >> >> >> >>> ...snip... >> >> >> >> >> >> >> It's pretty simple--the probability density of the sum of two >> >> >> >> >> >> >> uncorrelated variables (e.g. sines of incommensurate frequency) is the >> >> >> >> >> >> >> convolution of the two individual densities. So the nasty peaks at the >> >> >> >> >> >> >> ends get smoothed off. >> >> >> >> >> >> >> >> >> >> >> >> >> >> ..snip... >> >> >> >> >> >> > >> >> >> >> >> >> >Isn't the distribution sometype of hyperbolic function? Looks like spires >> >> >> >> >> >> >on a suspension bridge. >> >> >> >> >> >> > >> >> >> >> >> >> >HP used to make a histogram instrument, replicated the probably function >> >> >> >> >> >> >of a sine wave pretty well. >> >> >> >> >> >> > >> >> >> >> >> >> >Once I can get the function, I'll pop it through octave and see just how >> >> >> >> >> >> >'flat' the probability distribution goes. >> >> >> >> >> >> >> >> >> >> >> >> I'd love to see that. I haven't got around to learning how to drive >> >> >> >> >> >> Matlab or its clones. Maybe try more than two uncorrelated sines? >> >> >> >> >> >> >> >> >> >> >> >> I tried adding a histogram block (swept window comparator and lowpass >> >> >> >> >> >> filter) but it ran really slow, and I put that aside for now. That >> >> >> >> >> >> would be a cool intrinsic for LT Spice. Or I guess I could export a >> >> >> >> >> >> waveform and sic a PowerBasic program on it. The other thing I'd like >> >> >> >> >> >> to have is a time-domain Gaussian noise generator. Anybody want to >> >> >> >> >> >> write one? $100? Lunch at Zuni? >> >> > >> >> >in ltspice export the waveform, run something like this in scilab: >> >> > >> >> >signal = csvRead('filename.txt',ascii(9), '.', 'double'); >> >> >histplot(100,signal(:,2)) >> >> > >> >> > >> >> >no guarantees but will this work? >> >> > >> >> >Version 4 >> >> >SHEET 1 3688 680 >> >> >WIRE 224 96 80 96 >> >> >WIRE 224 112 224 96 >> >> >WIRE 80 128 80 96 >> >> >WIRE 224 208 224 192 >> >> >FLAG 80 208 0 >> >> >FLAG 224 208 0 >> >> >SYMBOL res 208 96 R0 >> >> >SYMATTR InstName R1 >> >> >SYMATTR Value 1 >> >> >SYMBOL bv 80 112 R0 >> >> >WINDOW 3 -33 155 Left 2 >> >> >SYMATTR InstName B1 >> >> >SYMATTR Value V=sqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20)) * cos(2pi * random(time*100e6+300e6)) >> >> >TEXT 48 232 Left 2 !.tran 0 1m 0 10n >> >> > >> >> > >> >> >-Lasse >> >> >> >> >> >> That is very cool. I don't understand it, but it looks right and FFTs pretty >> >> flat to about 10 MHz. > >it was an attempt at a Box&#2013266070;Muller transform, two of them to get it symmetric >and some hacks on time to get some random numbers, I'm not sure how well it works I'm not sure I understand the Time variable in ltspice > >> Cash? Zuni? >> > >I'll look you up if I'm the neighborhood :P > > >-Lasse
Try this one! 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 -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation Picosecond-resolution Digital Delay and Pulse generators Custom timing and laser controllers Photonics and fiberoptic TTL data links VME analog, thermocouple, LVDT, synchro, tachometer Multichannel arbitrary waveform generators
Den tirsdag den 3. december 2013 05.21.00 UTC+1 skrev John Larkin:
> On Mon, 2 Dec 2013 17:35:21 -0800 (PST), Lasse Langwadt Christensen >=20 > <langwadt@fonz.dk> wrote: >=20 >=20 >=20 > >Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin: >=20 > >> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >=20 > >>=20 >=20 > >> <langwadt@fonz.dk> wrote: >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >> >Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >=20 > >>=20 >=20 > >> >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> <robert.a.macy@gmail.com> wrote: >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs =20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> > >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >>> ...snip... >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> It's pretty simple--the probability density of the sum of two =
=20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> uncorrelated variables (e.g. sines of incommensurate frequency) =
is the =20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> convolution of the two individual densities. So the nasty peaks=
at the =20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> ends get smoothed off. >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >> ..snip... >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> > >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >Isn't the distribution sometype of hyperbolic function? Looks like=
spires =20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >on a suspension bridge. >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> > >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >HP used to make a histogram instrument, replicated the probably fu=
nction =20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >of a sine wave pretty well. >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> > >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >Once I can get the function, I'll pop it through octave and see ju=
st how =20
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> >'flat' the probability distribution goes. >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> I'd love to see that. I haven't got around to learning how to drive >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> Matlab or its clones. Maybe try more than two uncorrelated sines? >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> I tried adding a histogram block (swept window comparator and lowpa=
ss
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> filter) but it ran really slow, and I put that aside for now. That >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> would be a cool intrinsic for LT Spice. Or I guess I could export a >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> waveform and sic a PowerBasic program on it. The other thing I'd li=
ke
>=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> to have is a time-domain Gaussian noise generator. Anybody want to >=20 > >>=20 >=20 > >> >>=20 >=20 > >>=20 >=20 > >> >> write one? $100? Lunch at Zuni? >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >in ltspice export the waveform, run something like this in scilab:=20 >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >signal =3D csvRead('filename.txt',ascii(9), '.', 'double'); >=20 > >>=20 >=20 > >> >histplot(100,signal(:,2)) >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >no guarantees but will this work? >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >Version 4 >=20 > >>=20 >=20 > >> >SHEET 1 3688 680 >=20 > >>=20 >=20 > >> >WIRE 224 96 80 96 >=20 > >>=20 >=20 > >> >WIRE 224 112 224 96 >=20 > >>=20 >=20 > >> >WIRE 80 128 80 96 >=20 > >>=20 >=20 > >> >WIRE 224 208 224 192 >=20 > >>=20 >=20 > >> >FLAG 80 208 0 >=20 > >>=20 >=20 > >> >FLAG 224 208 0 >=20 > >>=20 >=20 > >> >SYMBOL res 208 96 R0 >=20 > >>=20 >=20 > >> >SYMATTR InstName R1 >=20 > >>=20 >=20 > >> >SYMATTR Value 1 >=20 > >>=20 >=20 > >> >SYMBOL bv 80 112 R0 >=20 > >>=20 >=20 > >> >WINDOW 3 -33 155 Left 2 >=20 > >>=20 >=20 > >> >SYMATTR InstName B1 >=20 > >>=20 >=20 > >> >SYMATTR Value V=3Dsqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2p=
i * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-2= 0)) * cos(2pi * random(time*100e6+300e6))
>=20 > >>=20 >=20 > >> >TEXT 48 232 Left 2 !.tran 0 1m 0 10n >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> > >=20 > >>=20 >=20 > >> >-Lasse >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >>=20 >=20 > >> That is very cool. I don't understand it, but it looks right and FFTs =
pretty
>=20 > >>=20 >=20 > >> flat to about 10 MHz.=20 >=20 > > >=20 > >it was an attempt at a Box=EF=BF=BDMuller transform, two of them to get =
it symmetric
>=20 > >and some hacks on time to get some random numbers, I'm not sure how well=
it works I'm not sure I understand the Time variable in ltspice
>=20 > > >=20 > >> Cash? Zuni? >=20 > >>=20 >=20 > > >=20 > >I'll look you up if I'm the neighborhood :P >=20 > > >=20 > > >=20 > >-Lasse >=20 >=20 >=20 >=20 >=20 > Try this one! >=20 >=20 >=20 >=20 >=20 > Version 4 >=20 > SHEET 1 880 680 >=20 > WIRE 320 64 128 64 >=20 > WIRE 368 64 320 64 >=20 > WIRE 400 64 368 64 >=20 > WIRE 128 96 128 64 >=20 > WIRE 320 112 320 64 >=20 > WIRE 128 208 128 176 >=20 > WIRE 320 208 320 192 >=20 > FLAG 128 208 0 >=20 > FLAG 320 208 0 >=20 > FLAG 368 64 NOISE >=20 > SYMBOL bv 128 80 R0 >=20 > WINDOW 0 -198 53 Left 2 >=20 > WINDOW 3 -336 104 Left 2 >=20 > SYMATTR InstName B1 >=20 > SYMATTR Value V=3Drandom(100*time) - 0.5 >=20 > SYMBOL res 304 96 R0 >=20 > WINDOW 0 -59 37 Left 2 >=20 > WINDOW 3 -56 73 Left 2 >=20 > SYMATTR InstName R1 >=20 > SYMATTR Value 1 >=20 > TEXT -96 64 Left 2 !.tran 5 >=20 >=20
might work, I assumed random was uniform not normal distributed random is just a lookup table, so unless you multiply time with a=20 number bigger than 1/timestep you get repeating numbers -Lasse
On Tue, 3 Dec 2013 01:08:43 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>Den tirsdag den 3. december 2013 05.21.00 UTC+1 skrev John Larkin: >> On Mon, 2 Dec 2013 17:35:21 -0800 (PST), Lasse Langwadt Christensen >> >> <langwadt@fonz.dk> wrote: >> >> >> >> >Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin: >> >> >> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >> >> >> >> >> >> <langwadt@fonz.dk> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >> >> >> >> >> >> >> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >> >> >> >> >> >> >> >> >> >> >> >> >> >> <robert.a.macy@gmail.com> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs >> >> >> >> >> >> >> >> >> >> >> >> >> >> ><pcdhSpamMeSenseless@electrooptical.net> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> ...snip... >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> It's pretty simple--the probability density of the sum of two >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> uncorrelated variables (e.g. sines of incommensurate frequency) is the >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> convolution of the two individual densities. So the nasty peaks at the >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ends get smoothed off. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ..snip... >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >Isn't the distribution sometype of hyperbolic function? Looks like spires >> >> >> >> >> >> >> >> >> >> >> >> >> >> >on a suspension bridge. >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >HP used to make a histogram instrument, replicated the probably function >> >> >> >> >> >> >> >> >> >> >> >> >> >> >of a sine wave pretty well. >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >Once I can get the function, I'll pop it through octave and see just how >> >> >> >> >> >> >> >> >> >> >> >> >> >> >'flat' the probability distribution goes. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I'd love to see that. I haven't got around to learning how to drive >> >> >> >> >> >> >> >> >> >> >> >> >> >> Matlab or its clones. Maybe try more than two uncorrelated sines? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> I tried adding a histogram block (swept window comparator and lowpass >> >> >> >> >> >> >> >> >> >> >> >> >> >> filter) but it ran really slow, and I put that aside for now. That >> >> >> >> >> >> >> >> >> >> >> >> >> >> would be a cool intrinsic for LT Spice. Or I guess I could export a >> >> >> >> >> >> >> >> >> >> >> >> >> >> waveform and sic a PowerBasic program on it. The other thing I'd like >> >> >> >> >> >> >> >> >> >> >> >> >> >> to have is a time-domain Gaussian noise generator. Anybody want to >> >> >> >> >> >> >> >> >> >> >> >> >> >> write one? $100? Lunch at Zuni? >> >> >> >> >> >> > >> >> >> >> >> >> >in ltspice export the waveform, run something like this in scilab: >> >> >> >> >> >> > >> >> >> >> >> >> >signal = csvRead('filename.txt',ascii(9), '.', 'double'); >> >> >> >> >> >> >histplot(100,signal(:,2)) >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> >no guarantees but will this work? >> >> >> >> >> >> > >> >> >> >> >> >> >Version 4 >> >> >> >> >> >> >SHEET 1 3688 680 >> >> >> >> >> >> >WIRE 224 96 80 96 >> >> >> >> >> >> >WIRE 224 112 224 96 >> >> >> >> >> >> >WIRE 80 128 80 96 >> >> >> >> >> >> >WIRE 224 208 224 192 >> >> >> >> >> >> >FLAG 80 208 0 >> >> >> >> >> >> >FLAG 224 208 0 >> >> >> >> >> >> >SYMBOL res 208 96 R0 >> >> >> >> >> >> >SYMATTR InstName R1 >> >> >> >> >> >> >SYMATTR Value 1 >> >> >> >> >> >> >SYMBOL bv 80 112 R0 >> >> >> >> >> >> >WINDOW 3 -33 155 Left 2 >> >> >> >> >> >> >SYMATTR InstName B1 >> >> >> >> >> >> >SYMATTR Value V=sqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20)) * cos(2pi * random(time*100e6+300e6)) >> >> >> >> >> >> >TEXT 48 232 Left 2 !.tran 0 1m 0 10n >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> >-Lasse >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> That is very cool. I don't understand it, but it looks right and FFTs pretty >> >> >> >> >> >> flat to about 10 MHz. >> >> > >> >> >it was an attempt at a Box&#65533;Muller transform, two of them to get it symmetric >> >> >and some hacks on time to get some random numbers, I'm not sure how well it works I'm not sure I understand the Time variable in ltspice >> >> > >> >> >> Cash? Zuni? >> >> >> >> >> > >> >> >I'll look you up if I'm the neighborhood :P >> >> > >> >> > >> >> >-Lasse >> >> >> >> >> >> Try this one! >> >> >> >> >> >> 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 >> >> > >might work, I assumed random was uniform not normal distributed
Some simple function will map uniform to almost-Gaussian. The random values could be squared up and then lowpass filtered; see AoE p 660.
> >random is just a lookup table, so unless you multiply time with a >number bigger than 1/timestep you get repeating numbers
Is it a finite table? Any idea of the size? It would be cool if Spice had more numeric operators, like "save these variables when..." or "stop if..." -- John Larkin Highland Technology Inc www.highlandtechnology.com jlarkin at highlandtechnology dot com Precision electronic instrumentation Picosecond-resolution Digital Delay and Pulse generators Custom timing and laser controllers Photonics and fiberoptic TTL data links VME analog, thermocouple, LVDT, synchro, tachometer Multichannel arbitrary waveform generators
Den tirsdag den 3. december 2013 17.13.53 UTC+1 skrev John Larkin:
> On Tue, 3 Dec 2013 01:08:43 -0800 (PST), Lasse Langwadt Christensen > > <langwadt@fonz.dk> wrote: > > > >might work, I assumed random was uniform not normal distributed > > > > Some simple function will map uniform to almost-Gaussian. > > > > The random values could be squared up and then lowpass filtered; see AoE p 660. > >
or the box-muller transform or just add enough independent random numbers several ways
> > > > > >random is just a lookup table, so unless you multiply time with a > > >number bigger than 1/timestep you get repeating numbers > > > > Is it a finite table? Any idea of the size? >
no idea, and it might not really be a table the help says: "rand(x) Random number between 0 and 1 depending on the integer value of x." "random(x) Similar to rand(), but smoothly transitions between values" so rand(time) will give you a new number every second, random(time) a smooth curve that connect those numbers -Lasse
On 12/3/2013 11:13 AM, John Larkin wrote:
> On Tue, 3 Dec 2013 01:08:43 -0800 (PST), Lasse Langwadt Christensen > <langwadt@fonz.dk> wrote: > >> Den tirsdag den 3. december 2013 05.21.00 UTC+1 skrev John Larkin: >>> On Mon, 2 Dec 2013 17:35:21 -0800 (PST), Lasse Langwadt Christensen >>> >>> <langwadt@fonz.dk> wrote: >>> >>> >>> >>>> Den tirsdag den 3. december 2013 02.20.37 UTC+1 skrev John Larkin: >>> >>>>> On Mon, 2 Dec 2013 15:35:32 -0800 (PST), Lasse Langwadt Christensen >>> >>>>> >>> >>>>> <langwadt@fonz.dk> wrote: >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>>> Den mandag den 2. december 2013 18.46.01 UTC+1 skrev John Larkin: >>> >>>>> >>> >>>>>>> On Mon, 02 Dec 2013 07:46:54 -0700, RobertMacy >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> <robert.a.macy@gmail.com> wrote: >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> On Sun, 01 Dec 2013 13:04:30 -0700, Phil Hobbs >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> <pcdhSpamMeSenseless@electrooptical.net> wrote: >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>>> ...snip... >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> It's pretty simple--the probability density of the sum of two >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> uncorrelated variables (e.g. sines of incommensurate frequency) is the >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> convolution of the two individual densities. So the nasty peaks at the >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> ends get smoothed off. >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>>> ..snip... >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> Isn't the distribution sometype of hyperbolic function? Looks like spires >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> on a suspension bridge. >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> HP used to make a histogram instrument, replicated the probably function >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> of a sine wave pretty well. >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> Once I can get the function, I'll pop it through octave and see just how >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>>> 'flat' the probability distribution goes. >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> I'd love to see that. I haven't got around to learning how to drive >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> Matlab or its clones. Maybe try more than two uncorrelated sines? >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> I tried adding a histogram block (swept window comparator and lowpass >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> filter) but it ran really slow, and I put that aside for now. That >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> would be a cool intrinsic for LT Spice. Or I guess I could export a >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> waveform and sic a PowerBasic program on it. The other thing I'd like >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> to have is a time-domain Gaussian noise generator. Anybody want to >>> >>>>> >>> >>>>>>> >>> >>>>> >>> >>>>>>> write one? $100? Lunch at Zuni? >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> in ltspice export the waveform, run something like this in scilab: >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> signal = csvRead('filename.txt',ascii(9), '.', 'double'); >>> >>>>> >>> >>>>>> histplot(100,signal(:,2)) >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> no guarantees but will this work? >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> Version 4 >>> >>>>> >>> >>>>>> SHEET 1 3688 680 >>> >>>>> >>> >>>>>> WIRE 224 96 80 96 >>> >>>>> >>> >>>>>> WIRE 224 112 224 96 >>> >>>>> >>> >>>>>> WIRE 80 128 80 96 >>> >>>>> >>> >>>>>> WIRE 224 208 224 192 >>> >>>>> >>> >>>>>> FLAG 80 208 0 >>> >>>>> >>> >>>>>> FLAG 224 208 0 >>> >>>>> >>> >>>>>> SYMBOL res 208 96 R0 >>> >>>>> >>> >>>>>> SYMATTR InstName R1 >>> >>>>> >>> >>>>>> SYMATTR Value 1 >>> >>>>> >>> >>>>>> SYMBOL bv 80 112 R0 >>> >>>>> >>> >>>>>> WINDOW 3 -33 155 Left 2 >>> >>>>> >>> >>>>>> SYMATTR InstName B1 >>> >>>>> >>> >>>>>> SYMATTR Value V=sqrt(-2 * log10(random(time*100e6)+1e-20)) * cos(2pi * random(time*100e6+100e6))-sqrt(-2 * log10(random(time*100e6+200e6)+1e-20)) * cos(2pi * random(time*100e6+300e6)) >>> >>>>> >>> >>>>>> TEXT 48 232 Left 2 !.tran 0 1m 0 10n >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> >>> >>>>> >>> >>>>>> -Lasse >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>> That is very cool. I don't understand it, but it looks right and FFTs pretty >>> >>>>> >>> >>>>> flat to about 10 MHz. >>> >>>> >>> >>>> it was an attempt at a Box&#65533;Muller transform, two of them to get it symmetric >>> >>>> and some hacks on time to get some random numbers, I'm not sure how well it works I'm not sure I understand the Time variable in ltspice >>> >>>> >>> >>>>> Cash? Zuni? >>> >>>>> >>> >>>> >>> >>>> I'll look you up if I'm the neighborhood :P >>> >>>> >>> >>>> >>> >>>> -Lasse >>> >>> >>> >>> >>> >>> Try this one! >>> >>> >>> >>> >>> >>> 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 >>> >>> >> >> might work, I assumed random was uniform not normal distributed > > Some simple function will map uniform to almost-Gaussian.
Two values at a time--it uses polar coordinates. Google "Box-Mueller". (Numerical Recipes has a good discussion.)
> > The random values could be squared up and then lowpass filtered; see AoE p 660. > >> >> random is just a lookup table, so unless you multiply time with a >> number bigger than 1/timestep you get repeating numbers > > Is it a finite table? Any idea of the size? > > It would be cool if Spice had more numeric operators, like "save these variables > when..." or "stop if..."
You can do a lot of that stuff by creative use of Boolean operators. (Old versions of Mathcad had a lot of the same limitations, so I'm pretty used to it.) I recently upgraded to the 2001i edition. [Mathsoft claims that it doesn't run on Win 7, but it actually runs fine if you copy the installation from XP and run the registry tool they supply (regtool.exe). Same with Wine. It just doesn't install there.] Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
On Tue, 03 Dec 2013 10:22:23 -0700, Phil Hobbs  
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>> ...snip.... > You can do a lot of that stuff by creative use of Boolean operators. > (Old versions of Mathcad had a lot of the same limitations, so I'm > pretty used to it.) I recently upgraded to the 2001i edition. >
20011 edition? now, THAT'S planning ahead!
On 12/3/2013 5:05 PM, RobertMacy wrote:
> On Tue, 03 Dec 2013 10:22:23 -0700, Phil Hobbs > <pcdhSpamMeSenseless@electrooptical.net> wrote: > >>> ...snip.... >> You can do a lot of that stuff by creative use of Boolean operators. >> (Old versions of Mathcad had a lot of the same limitations, so I'm >> pretty used to it.) I recently upgraded to the 2001i edition. >> > > 20011 edition? now, THAT'S planning ahead!
two-zero-zero-one-aye. Just about free, because it allegedly doesn't work on any Windows past XP, except that it does. Cheers Phil Hobbs