Use of physiological signals in circuit simulations

(Guest) Gleb Shenkerman

27/09/2019

As an engineering service provider in the medical technology sector, we cannot avoid working with physiological signals such as ECGs. We often want to take a closer look at how these signals affect a particular circuit.

For the simulation of our circuits we use, among other things, the program LTspice® from Analog Devices (formerly Linear Technology).

LTspice is a free simulation tool for electrical and electronic circuits. It offers a range of options for signal generation, temporal measurement of voltages and currents, and simulation of amplitude and phase responses (also known as Bode plots).

How exactly the implementation of a physiological signal in LTspice works will be explained in more detail in this article using the example of an ECG signal.

In LTspice there is the possibility to save any signal as a so-called PWL signal (English: piecewise linear function – In this case, arbitrary voltage values are assigned to a specific point in time. To understand how PWL works, let's consider the following example:

At time t = 0 seconds, we assign the value 0 volts, at time t = 1 second, the value 2 volts, and so on. Let's take a look at what this signal looks like over time:

We get a trapezoidal signal that rises linearly to 2 volts for one second, stays at 2 volts for one second, and falls linearly to 0 volts for one second.

Following this principle, we can now generate any signal using the PWL function in LTspice. For physiological signals, it's easier to use appropriate sources, such as the PWL. https://physionet.org/ to use.

What we need from there in this case is the .txt file containing the value pairs for the voltages and their corresponding time points. To use this in LTspice, it must be formatted as follows:

The file must contain two columns separated by a space. The left column contains the time points, the right column the voltage values. The "m" after the number is the unit prefix "milli." So, "80m" means 80 ms, "1.5m" means 1.5 mV, and so on.

To use these value pairs, we open LTspice and first create a circuit diagram as shown in the following figure:

Next, we right-click on the voltage source (to open the settings), after which the following window appears:

We click on “Advanced” and this window appears:

In this we select the item “PWL FILE:” and specify the directory of our previously created .txt file and confirm with “OK”.

This is what it should initially look like. To start the simulation, click on the black figure in the top left.

Another window will open. All we need to do is enter the "stop time" parameter (the simulation duration in seconds) and confirm with "OK."

Our PWL signal is repeated exactly once:

To repeat our signal several times, we right-click on the PWL instruction in the schematic and this window opens:

Now we bracket the entire statement and write

PWL repeat for X (PWL file = “ *File path* “) endrepeat

Where X stands for the number of repetitions, for example 2. It then looks like this:

Now our signal is repeated twice. However, if we want our signal to repeat infinitely, we change the PWL instruction to:

PWL repeat forever (PWL file = “ *File path* “) endrepeat

Our signal is now repeated infinitely.

You now know how to integrate physiological signals, such as an ECG, into LTspice and simulate or test your circuits.

 

If you have any further questions, please leave a comment.
We are happy to help you.


Gleb Shenkerman worked as a student engineer at MEDtech. His responsibilities included simulating circuits in LTSpice and designing them.


More articles

  • 26/11/2025
  • General, Hardware, Standards, Quality, Testing

Why EMC testing is vital in medical technology: Imagine a patient is lying in the hospital during critical monitoring. Suddenly, a visitor's smartphone rings – and the monitoring device... ...

Read more
  • 20/11/2025
  • General, Hardware, Quality, Technology, Testing

Have you ever considered sourcing inexpensive components from China? The temptation is strong, we know that. And we've already gained some experience, from which I... ...

Read more
  • 25/09/2025
  • General, Electrodermal Activity, Hardware, Production

May I introduce you? This is EDA – our owl for electrodermal activity. This is EDA, our little owl with a special talent. EDA can measure electrodermal activity (EDA for short) – ...

Read more
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.