Electronic – Stepped Sine Wave in Spice

frequencyltspicesimulationsine

I'm interested in simulating a circuit using a stepped sine wave input. I want to sample a sine wave at regular intervals and have the output constant during each interval, making an output that looks like:

enter image description here

(pardon my silly Excel plot!)

What's the best way to do this? Is there an easy way to create a source that generates an output like this? Am I better off carefully looking at the frequency response of my circuit and comparing it to the frequency content of this input?

A solution relevant to LTSpice or Orcad would be ideal.

Best Answer

LTspice has a 'sample' block which implements a simple sample-and-hold. E.g. the below circuit

enter image description here

gives this waveform: enter image description here