@mohamed hassan You could do that in 2 different ways:
1. FFT in ngspice, please refer to documentation.
2. Run ngspice transient simulation and read the data as a vector in numpy and apply fft on it: https://numpy.org/doc/stable/reference/routines.fft.html
m
mohamed hassan
02/02/2023, 12:02 PM
I tried to run fft in NGspice for an output signal but it seems to perform the fft for only one value of the signal, do you have any idea what may be the issue here?
a
Amro Tork
02/02/2023, 1:55 PM
@mohamed hassan What do you mean by one value?
Amro Tork
02/02/2023, 1:55 PM
I personally, prefer option 2, run ngspice, get the vectors and do whatever I want in Numpy + Scipy
Amro Tork
02/02/2023, 1:55 PM
@mohamed hassan such questions #analog-design is the right channel for that.
s
Stefan Schippers
02/02/2023, 6:02 PM
Remember to run the ngspice
linearize
command on vectors you want to export for python fft. By default ngspice raw files are not constant time step. They are after applying
linearize
.
š 1
r
Robin Tsang
02/05/2023, 10:44 PM
I use .option INTERP to get equidistant sample points.
The period is the time step specified in .tran
For example, in ā.tran 1u 100nā, the 100n will specify the period of samples.
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.