Hi,
I am trying to simulate a S&H circuit that has a resettable integrator at its input that averages the signal in between the sampling instances. Simulating with an integrator caused “timestep too small”, while embedded in a large circuit. So, I replaced it with the continuous time moving average filter, using a B-source with V=(idt(V(in), 0) - delay(idt(V(in), 0), Tw)) / Tw, where Tw=1/fsampling. However, this produced memory allocation error.
Then I replaced the delay in the B-source by a lossless T-line, having the same delay - this brought me back to the “timestep too small” error…
Is there any robust and QSPICE-friendly realization of integrate&dump or moving average filter?
Thank you very much!
Please review if my Symbol library can help. I have digital resettable integrator, also analog integrator with Reset. Here is a post of my z-domain subcircuit library.
Z-domain discrete time control subcircuit symbols library - QSPICE - Qorvo Tech Forum
Refer to this post.
Realloc error mesage - QSPICE - Qorvo Tech Forum
1 Like
For continuous-time moving RMS and mean, I have a symbol you can download. Qspice/Symbols-KSKelvin/probes and measure/Measure-RMS-MEAN.qsym · KSKelvin-Github/Qspice
A related discussion post refers to
Behavioral True RMS to DC Converter - QSPICE - Qorvo Tech Forum
Here is an example of the performance of this symbol.
example2.Measure-RMS-MEAN.qsch (4.7 KB)
Thank you very much, Kelvin! The delay(x,y,2*y) solved the problem.
1 Like
