Bob Cordell Interview: BJT vs. MOSFET

It's probably well known to those here, but you can parameterize the tricks that andy_c is talking about. I.e., rather than manually calculate the timestep, start and end time, you can add .param directives to calculate the required values for you based on frequency, cycles, etc. The attached circuit shows an example of this. 'freq' is the frequency of interest. 'cycles' is the number of cycles to capture. 'points' is the "Number of data point samples in time" from the FFT dialog. 'burn' is the number of cycles to skip before saving data.

Since the FFT requires that the number of points be a power of 2, I usually end up multiplying two smaller number together (i.e. 2048*2048 is easier to type and remember than 4194304).

As mentioned, make sure you turn off compression.

I think maybe I still have some sort of off-by-one issue or somesuch, since I only get 160db or so down from the fundamental at 200kHz for the simulation shown, but it's probably overkill at that point anyway. ;)
 

Attachments

  • ltspicesample.jpg
    ltspicesample.jpg
    44 KB · Views: 682
I get plenty of FFT precision in LTSpice simply by turning off compression and then selecting an integer multiple of the period to analyze. You may set the sim time to 10ms, but it won't sim exactly that much, you must select an exact multiple of the period of interest from within the FFT window.

I usually only sim 6 cycles of whatever frequency I'm using, then I throw out the first 1 and the last 1. 160-180db "noise" floor is typical.

P.S. I just pulled a random complete amplifier from my personal archive, 180db noise floor from a 6ms sim completed in 0.251 real time seconds.
 
LTSpice

Reading the last couple of posts about LTSpice, I get the impression that this simulator is a potential candidate for a hate/love relationship. Running a FFT in Micro-Cap is much simpler. Just specify the starting and ending time of one cycle of the fundamental frequency and pick the number of FFT points from a table (of course powers of two).
You can use any time step, however, the smaller the time step the smaller the noise floor. When using 1ns and 20kHz, for example, the noise is 250dB down.

Cheers,
 
One more tip

One more tip.

I had lately been working out simulations for a 2MW igbt inverter, 3 level. Rather complex circuits with multiple subcircuits can easily make for hugh waveform files (*.raw), hundreds of Mb to over a Gb. Space considerations nonwithstanding, screen refresh may be a pain as well as addition of traces to display.

What I do then is to specify the time to start capturing data to the begining of the last cycle, where I will be doing detailed analysis and FFT. This way, the *.raw files only grow to the actual usefull amount of data.

Rodolfo
 
imo the wiki will remain useless until there is a method for including inline images, schematics, graphs, ect

I assume diyAudio is unwilling to take on the possible bandwidth demand, and isn't allowing inline image links in the wiki

maybe a organization can have a photo hosting account on one of the free services?
 
Administrator
Joined 2004
Paid Member
Hi jcx,
I assume diyAudio is unwilling to take on the possible bandwidth demand, and isn't allowing inline image links in the wiki
Well, disk and bandwidth cost money and there are no membership fees here. A free file hosting service was the direction I suggested earlier. Providing a forum would be our pleasure and we can see the value in this.

I tried to start a thread that would have distilled information on fake transistors. It got filled with garbage eventually. We would have to be ruthless with any thread to keep it useful for our members. Just one of a few concerns. Our members help in identifying trash would be required simply to keep up with everything. We need everyone's help on this one I think.

-Chris
 
That is, in my opinion, the whole point of a wiki. It takes all the good stuff that one finds in the forum and let's the users clean, rearrange and organize it. Threads like this one are perfect examples of why the wiki could be useful; there have been so many interesting things said in this thread, but unless you know exactly what you're looking for you have to drudge through 2489 posts to find it.