Version 4 SHEET 1 1740 680 WIRE 304 32 112 32 WIRE 112 64 112 32 WIRE 112 160 112 144 WIRE 352 160 112 160 WIRE 352 192 352 160 FLAG 304 32 rampout FLAG 352 192 0 SYMBOL bv 112 48 R0 WINDOW 3 -194 144 Left 0 SYMATTR Value V=idt((if(sin(2*pi*time)+.5,2,-2)),0) SYMATTR InstName B1 TEXT 176 0 Left 0 !.tran 0 5 0 TEXT 616 -96 Left 0 ;This is very simple triangular wave generator totally contained in a behavioral source.\nThe sin argument generates a wave with periodicity of 1 second. The if statement\naround it generates a square wave from the polarity of the sine wave. The .5 \noffsets the .5 comparison point of the if statement. The idt function integrates alternately \nthe +2 and -2 from the if statement to generate the triangular waveform. Higher frequency \nramps may be produced by multiplying time by a factor. Higher amplitudes may be produced \nby changing the +2 and -2 in the if statement to larger values. The offset of the triangular \nwave can be manipulated by changing the second argument of the idt function. \nFor example, a -.5 will center the triangular wave around zero.\n \n \nRun the simulation and plot the rampout voltage!