Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

LT Spice generating a repetitive signal 1

Status
Not open for further replies.

atferrari

Marine/Ocean
Dec 18, 2003
30
0
0
AR
Using LT Spice, how could I simulate a repetitive signal with 12 levels between +2V and -2V?

Intention to use it as the input for a passband filter.

Initially I tried a voltage cell with PWL output but found that it does not repeat! My fault.

Any help out there? I will appreciate that!


Agustín Tomás
 
Replies continue below

Recommended for you

Stick in a voltage source.
Edit it.
Fill in the table as shown in this picture.
Have a blast.

6aujdzk.jpg


Keith Cress
Flamin Systems, Inc.-
 
Hola Keith,

I found that even if able to repeat, PWL is not what I need.

I think is a step-like function for I want to generate a 24 steps signal following a sine-like law.

And that signal has to repeat continuously to test a filter response. See the thread about "lowpass active filter" that I started today somewhere here in this forum.

Somebody adviced to use "REPEAT" command(?) but LT Spice doesn't explain the syntax for that.

Because of my job I use to stay away from internet, sometimes for more than 24 hours. Don't worry. I will revert sooner or later.

Thanks for replying.

Agustín Tomás
 
PWL can do that if it allows you enough points. Pairs of points at the same voltage seperated by the time you want, then another pair following very closely in time. For example:

0 V 0.0 Sec
0 V 0.99999 Sec
1 V 1 Sec
1 V 1.99999 Sec
2 V 2 Sec
2 V 2.99999 Sec

Will approximate a waveform stepping up by one volt every second. Unfortunately many SPICEs only allow 8 or 10 points, so you may not get 12 levels.

An uglier approach I've used for that sort of thing with no limit on the number of steps (unless there's a maximum number of circuit elements) is by putting several PULSE sources in series.

Set the voltage of each pulse to a voltage you want in the sequence. Set the Ton and Period appropriately. Use the minimum Trise and Tfall. Then tinker with the Tdelay to sequence the pulses in order so they add up to the output you want. Looks like you also have a number of pulses parameter as well, set that to some very large number if necessary. You might need to add a small RC filter to remove spikes that might remain as the step edges transition from one to another.

 
I found this in the above LTSPICE forum, from "Rick". Apparently, pwl has a hidden file option:

A pwl (piece wise linear) file should work for this. Place a voltage or current source on the schematic. Then put the cursor over the source and the press Ctrl right click. Now in the value field enter:
pwl file=mydata.txt

mydata.txt should be a test file of the form

time1 data1
time2 data2
timen datan

This file should be in the same folder as your circuit. pwl is only briefly mentioned in the LTspice help file.

Rick
 
Is there some reason everyone is ignoring the PULSE command? Doesn't anyone bother reading the manual?

Syntax: Vxxx n+ n- PULSE(V1 V2 Tdelay Trise Tfall Ton
Tperiod Ncycles )
Time-dependent pulsed voltage source


TTFN

FAQ731-376
 

After reading the manual (yes I do/did!) found that STEP is closer to what I need. And as I said already I just need to find how to employ REPEAT to get a string of steps, repeted forever.

Agustín Tomás
 
STEP is a batch command; it basically changes some sort of DC condition for a particular run.

Since you haven't really described what you're trying to do, I can only guess. You need sum up a bunch of different PULSES, each pulse for its particular time slot in your waveshape, allowing to you configure the voltages independently.

TTFN

FAQ731-376
 
I think you'd need to sum a bunch of PULSEs together, hence, 20 minutes of calculation time.

Each Pulse would cover a particular time slot in the composite signal.

TTFN

FAQ731-376
 
Status
Not open for further replies.
Back
Top