PDF in Spice

I've had a few instances where I was interested in seeing the probability density function of a waveform, the voltage histogram, in LT Spice. I never came up with a decent way to display that within Spice. Any ideas?

--

John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin
Loading thread data ...

You could make a subcircuit with a bunch of switches, capacitors, and current sources, which would integrate the amount of time the voltage spent between thresholds N and N+1.

It would get a bit clunky if you wanted more than about a dozen levels, of course.

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
Reply to
Phil Hobbs

Yeah, brute force. A quantizer and a decoder could fake a mess of window comparators, and integrators are easy, but a nice histogram display is messy.

I have done a single swept window comparator that scans the test waveform, but run times get insane.

I guess the thing to do is export the waveform to a file and analyze it with some other software. Seems inelegant.

--

John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Transient analysis in Spice has no noise. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

Not as inelegant as having MANY advantages.

You know this sequence, but here it is for 'lurkers':

In LTspice, set .options plotwinsize=0 to catch ALL the waveform

use LTsputil.exe to make all the samples uniformly spaced, I use a batch file to expedite.

Export the resulting evenly spaced trace to text file and edit that file by removing the 'header' and the first t=0 term, rename as something REALLY simple.

Then in octave

from there you can plot ANY number of bins in the histogram.

Sometimes it's worthwhile to explore different numbers of bins and this makes it super easy.

I sometimes 'overlay' the plots with larger and larger number of bins just looking for characteristics. Any bin that might have a 'bump' really shows up that way.

Reply to
RobertMacy

.tranoise does, but I'm usually working with white noise, sometimes 1/f but neither affect pdf ?!

Reply to
RobertMacy

I was going to mention your method, but figured you'd be right here shortly ;-) ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

That's OK, I'm building a noise generator! I want to see how Gaussian it might be, as I tweak things.

--

John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Yup. And noise analysis has no transients! What I really want is a negative resistor with pure imaginary noise.

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
Reply to
Phil Hobbs

Histogramming shouldn't care about even spacing.

Sure, but that hardly provides timely feedback.

--

John Larkin         Highland Technology, Inc 
picosecond timing   laser drivers and controllers 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

OK. I don't know if it exists in LTspice, but I'd look for an LTspice equivalent to PSpice's "Performance Analysis". ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

The noise isn't imaginary, it's just inverted.

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

In the Biblical sense ?>:-} ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

sqrt(-4kTR) !

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
Reply to
Phil Hobbs

You can easily make a 2-terminal negative resistor; I made one as a college EE project. It's fun to plug -R into all the usual circuit equations.

But the noise will be real!

--

John Larkin         Highland Technology, Inc 
picosecond timing   precision measurement  

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

True, but part of making 'histogramming' not care about spacing is to evenly space the data points, else many programs 'double' count.

Using that method enabled me to make LTspice create a multitude of independent gaussian white noise sources. And I mean FLAT white noise.

Example of one: sqrt(12/5/dt)*(rand(time/dt)

+rand(tstop/dt+1+2*int(time/dt)) +rand(3*(tstop/dt+1)+3*int(time/dt)) +rand(6*(tstop/dt+1)+4*int(time/dt)) +rand(10*(tstop/dt+1)+5*int(time/dt))-2.5) }

which only requires 5 rand() functions, normalized, and fairly close approx to gaussian pdf while remaining VERY spectrally flat.

The 'list' keeps going so I have up to 50 independant gaussian white noise sources to use. Just as long as the argument of rand() does NOT exceed

2^30, the sequences do not repeat.
Reply to
RobertMacy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.