Isotel.net
Isotel DAQ & Metering Forums
Member
Joined: Feb 04 2019
Posts: 1

Hi,

I have a problem to simulate first example "Digital Sine Generator with PRS and Low-Pass Filter". Problem is that Out signal isn't sine (is on 0 volts level). I tried to simulate this project on Linux Ubuntu (virtual machine). I downloaded all packages with simple command "sudo apt install", except ngspice (I downloaded latest version of ngspice-30). I couldn't even simulate example with end time 50ms, because these points took to much memory. So i changded line
tran 10ns 50ms uic
to
tran 10ns 10ms uic

Any explanation what was wrong? I hope for answer.

Administrator
Joined: Oct 28 2018
Posts: 5

Hi,

It will take up to 2.1 GB of memory to simulate it.

However you may reduce consumption for a bit (300 MB for 50 ms transient analysis) by adding the save command to list the nodes of interest and discard the rest into the prssine.cir:

.control
save clk rst prsout out

after simulation is done you should have got the plots to the screen immediately (?)

Anyway you might be getting v(out) 0 since you're looking at the wrong plot:

No. of Data Rows : 5734581
FFT: Time span: 0.05 s, input length: 5000001, zero padding: 3388607
FFT: Frequency resolution: 20 Hz, output length: 4194305
ngspice 169 -> setplot
List of plots available:

Current sp2 * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Spectrum)
    tran2   * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Transient Analysis (linearized))
    tran1   * mixed signal simulation demo project - digital sine generator with 8-bit prs and a low-pass filter, <uros@isotel.eu> (Transient Analysis)
    const   Constant values (constants)
ngspice 170 -> setplot tran1
ngspice 171 -> plot v(out)
Warning: Missing charsets in String to FontSet conversion

Doing 10 ms is also fine, it will show most of the harmonics.

BR Uros

Administrator
Joined: Oct 28 2018
Posts: 5

I should have mentioned that you do not need to explicitly set the other plot to plot a signal in ngspice, you may refer to a plot by its name, like:

ngspice 174 -> plot tran1.out

That's how different runs (plots) can be easily compared to each other.