1
\$\begingroup\$

I'm looking to model a repeating sinc pulse in LTSPICE, however I can only get it to fire once. I'm looking to delay it by x many ms, and trigger the pulse the again.

Is this possible with LTSPICE ?

\$\endgroup\$
  • \$\begingroup\$ you mean sin(x)/x? What are you using for the pulse? \$\endgroup\$ – Spehro Pefhany May 31 '15 at 23:23
  • \$\begingroup\$ @SpehroPefhany ya sin(x)/x, I'm using a behavioral voltage source (BV) \$\endgroup\$ – efox29 May 31 '15 at 23:23
  • \$\begingroup\$ A simple sin wave voltage source and a comparator would be my first approximation... \$\endgroup\$ – Spoon Jun 1 '15 at 7:42
  • \$\begingroup\$ @Spoon elaborate ? \$\endgroup\$ – efox29 Jun 1 '15 at 8:40
  • \$\begingroup\$ @efox29, do you just want a repeating pulse? I know it may seem silly but the Voltage source with Pulse and the following parameters as an example... PULSE(0 1 0 0 0 0.01 0.1) or a pulse you can adjust to test the sync function of your circuit? \$\endgroup\$ – Spoon Jun 1 '15 at 12:04
4
\$\begingroup\$

Just similar to what I wrote in this answer you can do almost anything repetitive by using the time variable and a modulus. So let us set this up step by step. First just a sinc function for convenience:

.function sinc(x) { sin(x)/x }

Using this together with the time variable and a little scaling we can get this b source:

V=sinc(time*100)

to produce this here:

This isn't repetetive so let us create a modulo function and use that to bring back the parameter into range:

.function mod(x,y) { (x/y)-int(x/y) }
V=sinc(mod(time,1)*100)

Better, but not quite nice as the "pulse" starts at 0 of the sinc again. It would be better if it started a bit lower, so lets shift and align it a little bit nicer:

V=sinc(mod(time,pi/3)*100-pi)

You should now be able to take this as a starting point to calculate a waveform that matches your needs.

\$\endgroup\$
  • \$\begingroup\$ oh.. em.. gee :o \$\endgroup\$ – efox29 Jun 1 '15 at 9:21
  • \$\begingroup\$ perhaps you would want to shift the basic sinc left more \$\endgroup\$ – Mike Jun 1 '15 at 10:04
  • 1
    \$\begingroup\$ @Mike: maybe. This is just showing how to do it, the exact amount of shifting and scaling is up to whatever the OP wants in detail. \$\endgroup\$ – PlasmaHH Jun 1 '15 at 10:09
1
\$\begingroup\$

I'm not sure if this is helpful in the context of your simulation, but you can produce an approximation to a series of sinc pulses with a slight negative DC bias by simply summing together a set of cosine waves. Start with one at the pulse repetition frequency, and add integer harmonics of that frequency, all at the same amplitude:

$$pulse(t) = \sum_{i=1}^N cos (2\pi i f t)$$

The value you select for N will determine the width of the individual pulses; a higher value will create narrower pulses. Also, as N increases, the peak amplitude of the pulses increases linearly as well; scale by \$\frac{1}{N}\$ if desired.

See an example on Wolfram Alpha

\$\endgroup\$
  • \$\begingroup\$ You know, it's not the ideal approach because LTSPICE doesn't have a way to sum up multiple terms, but that Wolfram link pointed me in the write direction, that I can just write a macro that will create as many terms as I need and delay it by the value I want. It's a bit more work, but it beats typing out the series with a + in between each term. \$\endgroup\$ – efox29 Jun 1 '15 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.