Author Topic: Very small signals in LTSpice  (Read 478 times)

0 Members and 1 Guest are viewing this topic.

Offline mc172Topic starter

  • Frequent Contributor
  • **
  • Posts: 489
  • Country: gb
Very small signals in LTSpice
« on: March 31, 2024, 12:29:10 am »
When trying to run what in my mind is a really simple simulation - a 1 Hz, 1 uV sine wave into a 100 k resistor - I get some pretty strange results in LTSpice:

2090150-0

I'm expecting to see a sine wave but I see this bizarre triangle. Any idea what I'm doing wrong and/or how to manipulate LTSpice to properly simulate low voltages?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14464
  • Country: fr
Re: Very small signals in LTSpice
« Reply #1 on: March 31, 2024, 12:44:58 am »
Yes, I just tried in LTSpice 24 and can confirm I get the same result as you do.

The issue is a solver issue, more precisely, a timestep issue. The problem is that when using a sine voltage source with a very low amplitude and low frequency, the derivative of the signal respective to time is very small, and the basic solver behavior when faced with such a condition is to increase the timestep of the simulation to optimize it - that leads to, basically, aliasing in this case. (Conversely, the solver tends to shorten the timestep when the derivative of signals increases. That's basically done to improve the accuracy of integration.)

The fix is to define a maximum timestep value (in the transient analysis options) instead of leaving it empty. In your case, 1µs for the max timestep works. But depending on the case, you may of course need to adjust it to a lower value.
You can play with the max timestep parameter, and see that the higher you set it, and the fewer "points" the solver computes, so the "rougher" the simulated sine appears, until you get past a point where it aliases and you can't see a period anymore.

Yes, Spice can be ultra confusing even with what seems like excessively simple simulations.
« Last Edit: March 31, 2024, 12:50:12 am by SiliconWizard »
 
The following users thanked this post: shabaz, mc172

Offline mc172Topic starter

  • Frequent Contributor
  • **
  • Posts: 489
  • Country: gb
Re: Very small signals in LTSpice
« Reply #2 on: April 05, 2024, 07:42:55 pm »
Thank you very much!
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Very small signals in LTSpice
« Reply #3 on: April 05, 2024, 09:02:48 pm »
That's more of a kludge than a fix as it results in a rather slow simulation.  The problem appears to be due to waveform compression.  Turn that off with:
Code: [Select]
.opt plotwinsize=0or adjust its absolute voltage error limit with:
Code: [Select]
.opt plotvntol=1nand the original .tran 1 leaving the timestep to default, will display a good waveform without significant loss of speed.
 
The following users thanked this post: Someone, mc172


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf