# LTspice sinusoidal voltage source with offset much larger than amplitude broken?

I've been troubleshooting an analog circuit and have just come to the realization that Sine Voltage sources at mV are broken.

Here is one that is supposed to provide a 1mV 1Hz sine wave on top of a 300mV DC signal. Instead I get complete garbage.

Running LTSpice version 4.22. Anyone else seen this issue or can advise what is the problem?

• I got a somewhat similar result. Waveform is more uniform, but not a sine wave. Disabling compression fixed it for me. (as per Lorenzo's answer below). – mkeith Nov 6 '17 at 7:01

Most probably you have waveform compression enabled and the compression algorithm has too high a relative tolerance to process such a signal correctly, since the AC component is so small compared to the DC offset.

Open the control panel and decrease the relative tolerance:

LTspice usually performs waveform compression to avoid generating huge data files for waveforms. The compression algorithm is lossy, so you might lose details and have artifacts like those you see on your simulation.

LTspice compresses the raw data files as they are generated. A compressed file can be 50 times smaller than the un-compressed one. This is a lossy compression. This pane of the control panel allows you to control how lossy the compression runs.

Sometimes it is useful to disable compression entirely, for complex waveforms, but expect GB size .raw files (these are the files where LTspice saves waveform data). Neverthelss, usually it is sufficient to play around with compression settings, but only when you reasonably know what to expect from a simulation.

Some commenters have pointed out that increasing tolerances, or specifically, reltol SPICE parameter will increase simulation time. This is true, but compression relative tolerance has nothing to do with the reltol SPICE parameter, which is found in another tab of the control panel:

To further reinforce my point, I'll cite the whole section of LTspice's help concerning the compression tab of the control panel (emphasis mine):

LTspice compresses the raw data files as they are generated. A compressed file can be 50 times smaller than the un-compressed one. This is a lossy compression. This pane of the control panel allows you to control how lossy the compression runs.

Window Size(No. of Points): Maximum number of points that can be compressed into two end points.

Relative Tolerance: The relative error allowed between the compressed data and the uncompressed data.

Absolute Voltage tolerance[V]: The voltage error allowed by the compression algorithm.

Absolute Current tolerance[A]: The current error allowed be the compression algorithm.

These compression settings are not remembered between program invocations to encourage use of the defaults. They are available on the control panel for diagnostic purposes. The tolerances and window size can be specified with option parameters plotreltol, plotvntol, plotabstol and plotwinsize in .option statements placed as SPICE directives on the schematic.

You will probably want to turn of compression when using .four statements or doing FFT's in post analysis of your data with the SPICE directive:

.options plotwinsize=0

Again, the last directive just amounts to disable compression as you would do using the control panel. As I've already said above, this is just what you want to do to avoid artifacts, but huge files will be generated.

• been using LTSpice for years, and never been bitten by that one (yet), thx for the gotcha alert. – Neil_UK Nov 6 '17 at 7:18
• @Neil_UK You're welcome! I'm one of those refman freaks that like to read the whole manual (the problem is remembering where I saw something!) ;-) – Lorenzo Donati -- Codidact.com Nov 6 '17 at 7:22
• @LorenzoDonati Thanks for the quick response! I was loosing my mind. You are a scholar and a gentleman :) – EasyOhm Nov 6 '17 at 7:30
• @Gonzik007 You're Welcome! :-) – Lorenzo Donati -- Codidact.com Nov 6 '17 at 7:34
• Word of warning: reducing the tolerance will make your simulations go slower. It won't be felt for smaller schematics, but for larger... As long as the dynamic range is not that great (e.g. 1mV sine on top of 1kV DC, or similar/lower), you're better using opt plotwinsize=0 than reducing tolerances. In general, dynamic range is a problem since everything is mathematically calculated using machine precision. – a concerned citizen Nov 6 '17 at 8:38

I had this problem with my very first, super simple circuit... This issue is particularly hard on starters. It looks to me like a bug , spice seems to be taking corners in the simulator.

A solution is to add another power supply with a 1kHz (or higher as needed) 1 volt into your scheme. It seems it somehow kicks the simulator to work correctly

• The already accepted answer has what you need to solve this "problem", it seems that you didn't even look at it. TLDR? Welcome to the site. – a concerned citizen Sep 27 '20 at 16:10