Electronics > Projects, Designs, and Technical Stuff
Setting the bounds for integration LTSpice
(1/1)
Etesla:
Hi all
Is it possible to set the bounds for the LTSpice idt() function? I am trying to use the average value of a waveform. The average I am talking about is the moving average calculated from the most recent 5 seconds of the waveform. It would be easy if I could integrate the waveform from (time-5) to (time), but I don't see an easy way to do it. Any suggestions?
SiliconWizard:
The idt() function integrates from the beginning of the simulation, although there are means of resetting the integration (see the online help, 'a' parameter). There's also an alternate way of resetting it with the idtmod() function.

For a moving average, neither would be very helpful. (You could use them to compute averages in "chunks", but that's not what you asked for.)

I think you could use the following "trick" though (assuming 'x' here is the expression in question):


--- Code: ---idt(x - delay(x, 5))
--- End code ---

The delay() function yields a delayed version of its parameter. The above would just be equivalent to subtracting the integral of the signal 'x' delayed by 5s from the integral of the signal 'x', which should give you what you want.

Don't hesitate to report back if it works fine or if you need further help.
iMo:
Not sure this is what you are looking for, but you may do average from time A to B in the waveform viewer (ctrl leftclick on the waveform's label on top).
Navigation
Message Index
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod