Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LT Spice - How to simulate a repetitive signal

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
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!
 
I've been struggling with this for a while myself, unfortunatly there is no quick and easy method in ltspice itself to do it, there is a repeat function in spice and I have gotten it to function on several occasions to repeat a PWL list infinitly but I haven't touched it in a while. Try google or whatever search engine you want and look for SPICE PWL and REPEAT

I found the following link that has some Spice code examples at the bottom which might be useful, also check out the various functions and equations that are available in the ltspice help files and you should be able to work it out.
https://www.spectrum-soft.com/news/fall97/noise.shtm

The code example at the bottom of the page should be modifiable to let you use a list instead of the random function but I didn't read it closely enough to determine it's syntax.
 
Problem solved

:) Using PULSE function.:)

Anyone insterested in the .asc file, please PM.
 
Problem solved better

OK, I really hope the original poster solved his problem since now 5 years has passed, but I thought I'd post this to help the others out there who might have the same problem.

There is a quick and easy way to do this actually. Set the voltage source up as a PWL, with one period's worth of data. A PWL string will appear next to the voltage source in the GUI - e.g. for a signal stepping between 0, 1 and 2V every second the string would say PWL(0 0 0.99 0 1 1 1.99 1 2 2 2.99 2 3 0). Right click on this string and stick in a "repeat forever" and a "endrepeat", so it looks like this: PWL(repeat forever 0 0 0.99 0 1 1 1.99 1 2 2 2.99 2 3 0 endrepeat). Done!

If you want the signal to repeat only 5 times, for instance, you would put "repeat for 5" instead of "repeat forever".
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top