"Piecewise" waveform arithmetics in ltspice? - diyAudio
Go Back   Home > Forums > Design & Build > Software Tools

Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 3rd April 2011, 04:02 PM   #1
teemuk is offline teemuk  Finland
diyAudio Member
 
Join Date: Nov 2004
Location: Suomi, Finland
Default "Piecewise" waveform arithmetics in ltspice?

Is there a way to combine several waveform arithmetic functions so that they would work at specific ranges of input x?

for example:
With values of x < -1 the waveform would be processed with function #1,
with values of x >-1 and <1 the waveform would be processed with function #2, and with values of x >1 the waveform would be processed with function #3.

  Reply With Quote
Old 3rd April 2011, 04:50 PM   #2
teemuk is offline teemuk  Finland
diyAudio Member
 
Join Date: Nov 2004
Location: Suomi, Finland
Nevermind, I can wrap it up with IF sentences.

If someone has a better solution let's hear ya.
  Reply With Quote
Old 10th April 2011, 04:59 PM   #3
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
the U() function can be used to turn on/off terms in an equation

my Spice simulation
sim uses the U() function to select different periods of a waveform for parts of the calculation:

V=u(time-{(ncycles-3)*period})*u({(ncycles-2)*period}-time) is unit pulse for one cycle of a waveform and can be multiplied by the funciton you want to select for that time range - other functions of I,V can be used as "window" control arguments

Last edited by jcx; 10th April 2011 at 05:03 PM.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Randy Slone's "Fig 11.4" (Self's "Blameless"?): PCB layout tcpip Solid State 128 23rd September 2013 04:45 PM
What makes an amplifier "bright", "warm", or "neutral"? JohnS Solid State 51 13th December 2009 06:42 PM
LTSpice "World Tour" jackinnj Software Tools 4 6th August 2009 12:31 PM
Need help; I have "dog leg" shaped waveform on my amp andjur78 Tubes / Valves 1 3rd April 2007 08:23 AM


New To Site? Need Help?

All times are GMT. The time now is 09:38 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2