The LTspice waveform viewer is a handy way to perform basic measurements, but there are times when you need to export data from, or import data into LTspice to further evaluate a circuit.
To export waveform data to an ACSII text file:
- Click to select the waveform viewer
- Choose Export from the File menu.
- Select the traces you want exported.
- Click browse to specifiy the file location and name to save the text file
Once this file is created you can analyze it further in applications like Microsoft Excel or MATLAB. Note that some applications like MATLAB expect imported files to contain only data, with no header information. If you need to remove the header, open the text file in a text editor or Excel and delete the header information.
To import waveform data into LTspice IV you must attach a text file as a piecewise linear (PWL) function in a voltage or current source.
The imported file must contain a list of two-dimensional points that represent time and value data pairs in a tab or comma delimited format—with no header information. The PWL function connects the dots in the data, constructing a waveform based on straight-line segments between the points defined in the text file.
To add a text file as a PWL function to a voltage or current source:
- Right-click the symbol in the schematic editor
- Choose advance
- Select PWL FILE: and click Browse to choose the text file.
The PWL statement is discussed in more depth is available in the previous LTspice blog.