You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
(18) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(6) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(13) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
| 2003 |
Jan
(2) |
Feb
(1) |
Mar
(12) |
Apr
(32) |
May
(9) |
Jun
(26) |
Jul
(2) |
Aug
(10) |
Sep
(6) |
Oct
(1) |
Nov
(5) |
Dec
(7) |
| 2004 |
Jan
(7) |
Feb
(10) |
Mar
(6) |
Apr
(6) |
May
(6) |
Jun
(49) |
Jul
(11) |
Aug
(5) |
Sep
(11) |
Oct
(13) |
Nov
(35) |
Dec
(11) |
| 2005 |
Jan
(4) |
Feb
(17) |
Mar
(47) |
Apr
(21) |
May
(17) |
Jun
(35) |
Jul
(10) |
Aug
(48) |
Sep
(39) |
Oct
(26) |
Nov
(8) |
Dec
(27) |
| 2006 |
Jan
(34) |
Feb
(46) |
Mar
(13) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(8) |
Aug
(24) |
Sep
(23) |
Oct
(47) |
Nov
(14) |
Dec
(32) |
| 2007 |
Jan
(20) |
Feb
(17) |
Mar
(28) |
Apr
(11) |
May
(20) |
Jun
(3) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
(2) |
Dec
(18) |
| 2008 |
Jan
(22) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(4) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(2) |
| 2009 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
(2) |
May
(3) |
Jun
(1) |
Jul
(7) |
Aug
(3) |
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
(25) |
| 2010 |
Jan
(23) |
Feb
(10) |
Mar
(7) |
Apr
|
May
(1) |
Jun
(34) |
Jul
(3) |
Aug
(19) |
Sep
(34) |
Oct
(15) |
Nov
(38) |
Dec
(22) |
| 2011 |
Jan
(10) |
Feb
(5) |
Mar
(15) |
Apr
(3) |
May
(10) |
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(20) |
Feb
(21) |
Mar
(18) |
Apr
(2) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
| 2013 |
Jan
(3) |
Feb
(3) |
Mar
(11) |
Apr
(13) |
May
(3) |
Jun
(9) |
Jul
(45) |
Aug
(26) |
Sep
(8) |
Oct
(52) |
Nov
(23) |
Dec
(9) |
| 2014 |
Jan
(12) |
Feb
(20) |
Mar
(9) |
Apr
(27) |
May
(6) |
Jun
(3) |
Jul
(14) |
Aug
(12) |
Sep
(44) |
Oct
(29) |
Nov
(22) |
Dec
(11) |
| 2015 |
Jan
(4) |
Feb
(23) |
Mar
(40) |
Apr
(13) |
May
(41) |
Jun
(14) |
Jul
(13) |
Aug
(14) |
Sep
(32) |
Oct
(23) |
Nov
(9) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(10) |
Mar
|
Apr
(7) |
May
(2) |
Jun
|
Jul
|
Aug
(6) |
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(5) |
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(5) |
Sep
(4) |
Oct
(1) |
Nov
(11) |
Dec
(9) |
| 2018 |
Jan
(14) |
Feb
(2) |
Mar
(9) |
Apr
(8) |
May
(35) |
Jun
(33) |
Jul
(23) |
Aug
(10) |
Sep
(16) |
Oct
(31) |
Nov
(3) |
Dec
(32) |
| 2019 |
Jan
(8) |
Feb
|
Mar
(33) |
Apr
(1) |
May
(1) |
Jun
(9) |
Jul
(30) |
Aug
(3) |
Sep
(18) |
Oct
(11) |
Nov
(10) |
Dec
(6) |
| 2020 |
Jan
(2) |
Feb
(2) |
Mar
(15) |
Apr
(24) |
May
(47) |
Jun
(7) |
Jul
(7) |
Aug
(9) |
Sep
(3) |
Oct
(10) |
Nov
(8) |
Dec
(1) |
| 2021 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
(12) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
| 2022 |
Jan
(3) |
Feb
(6) |
Mar
(19) |
Apr
|
May
(5) |
Jun
|
Jul
(14) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
| 2023 |
Jan
|
Feb
(3) |
Mar
(7) |
Apr
(1) |
May
(5) |
Jun
(4) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(3) |
Nov
(7) |
Dec
|
| 2024 |
Jan
(5) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(14) |
| 2026 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Patrick K. <p....@po...> - 2026-02-22 11:22:01
|
To Holger Vogt and Daniel Marks: Thanks for you quick advice on this question. Sorry for the delayed response. I had to work on other issues so I did not have to time to look into this more than superficially. I will check out what you have recommended and let you know the outcome. I am still busy with other things (I also have a tape-out coming up, that does not help :D), so it might be a while. I just wanted to let you know that I did not simply ignore your messages. Thanks, kind regards, Patrick On Sat, 2026-02-07 at 15:55 +0100, Holger Vogt wrote: > You are asking for a 'simple' way. Simplicity here depends on your > background know-how. > > You might use a circuit for the frequency measurement. > > In the ngspice distribution we offer a pll (phase locked loop) > circuit > ( > https://sourceforge.net/p/ngspice/ngspice/ci/pre-master-46/tree/exampl > es/xspice/pll/), > which probably could serve this task, but needs to be adapted to your > requirements (center frequency, frequency deviation). > > You might google for FM (frequency modulation) detectors. > > A (zero crossing) function may probably be constructed with > behavioural > sources like the B source (manual chapter 5). But this is tricky, as > the > transient simulation uses non-constant time steps, and the chosen > time > steps will not be exactly at the crossing. So one needs a sort of > interpolation. > > If you are fit in C programming, you might program a code model > (examples are described in chapter 8 of the manual) to fulfill > exactly > your requirements. > > > > > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users |
|
From: belliotp <bel...@ie...> - 2026-02-15 01:24:03
|
Hi, The question is regarding building ngspice. In the file configure.ac AC_PREREQ has been set to 2.70 since last year, it is not convenient. Should we update the linux autoconf ? Our linux system uses autoconf 2.69. Thank you. |
|
From: Daniel M. <pr...@gm...> - 2026-02-07 17:52:23
|
You can compute the complex analytic signal, which turns a real-valued signal into a complex-valued signal, and then take the derivative of the phase with respect to time to get the instantaneous frequency. The complex analytic signal can be obtained by taking the FFT of the signal, setting the negative frequencies to zero and doubling the positive frequencies, and taking the inverse FFT. For my guitar pedal design, I use zero crossings, the zero crossings being determined by a comparator with hysteresis. The frequency is determined by measuring the time during zero crossings and using these crossings to compute the 1-bit autocorrelation of the signal, choosing the lowest harmonic of the autocorrelation. Here's the code I wrote to do it: https://github.com/profdc9/GuitarPico/blob/main/Code/guitarpico/gpico/src/pitch.c It is very fast because it only needs to keep track of the time between edges and computes the autocorrelation based on those. It needs to be very fast because most of the time needs to be spent on the actual guitar effects. On Fri, Feb 6, 2026 at 2:34 PM Patrick Kurth <p....@po...> wrote: > Hi list, > > Is there a way of measuring the instantaneous frequency of a signal > over time? Something like the TRIG measurement, but as a waveform, as > if you would call the TRIG measurement repeatedly and concatenated all > results into a waveform. More precisely I am looking for a crossing > function. > Is there a simple way to achieve this? > > Kind regards, > Patrick > > > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users > |
|
From: Holger V. <hol...@un...> - 2026-02-07 15:12:14
|
You are asking for a 'simple' way. Simplicity here depends on your background know-how. You might use a circuit for the frequency measurement. In the ngspice distribution we offer a pll (phase locked loop) circuit (https://sourceforge.net/p/ngspice/ngspice/ci/pre-master-46/tree/examples/xspice/pll/), which probably could serve this task, but needs to be adapted to your requirements (center frequency, frequency deviation). You might google for FM (frequency modulation) detectors. A (zero crossing) function may probably be constructed with behavioural sources like the B source (manual chapter 5). But this is tricky, as the transient simulation uses non-constant time steps, and the chosen time steps will not be exactly at the crossing. So one needs a sort of interpolation. If you are fit in C programming, you might program a code model (examples are described in chapter 8 of the manual) to fulfill exactly your requirements. |
|
From: Patrick K. <p....@po...> - 2026-02-06 20:32:41
|
Hi list, Is there a way of measuring the instantaneous frequency of a signal over time? Something like the TRIG measurement, but as a waveform, as if you would call the TRIG measurement repeatedly and concatenated all results into a waveform. More precisely I am looking for a crossing function. Is there a simple way to achieve this? Kind regards, Patrick |
|
From: Holger V. <hol...@un...> - 2025-12-22 10:16:34
|
Unfortunately the images added to your email are truncated and thus unreadable. Better not add grphics, but copy the output and paste it a text. |
|
From: <362...@qq...> - 2025-12-21 13:44:54
|
Hello ngspice experts: I would need to usage xspice for digital models, but I met error for all example case: ngspice d_source.cir The version is 44, I tried 45 also the result is same. I have enabled xspice in configure, the command is: It seems the d_* model is not added into model list and can not be found. Do I miss something? Thanks . |
|
From: ngspice u. <d16...@ti...> - 2025-12-04 10:42:43
|
> Why not simulate like this: > tran 5e-11 1.00005e-6 9.9e-7 > ?Any workarounds are possible, thank you. I just need to understand the essence of the problems, and then I can work around them. I'm still just starting out and don't understand everything. The situation is a bit complicated by the fact that English is my native language, and reading documentation isn't always effective. |
|
From: Holger V. <hol...@un...> - 2025-12-04 10:15:12
|
Why not simulate like this: tran 5e-11 1.00005e-6 9.9e-7 ? |
|
From: ngspice u. <d16...@ti...> - 2025-12-04 10:07:14
|
> You are a victim of the precision of double values in C. > > Reading from the debugger: > The starting point is: 9.9000000000000005e-07 > The end point is: 9.9999999999997963e-07 > The difference is slightly less than 1e-8. > > This is somewhat unpredictable. > Thank you very much for your participation, attention and time :) |
|
From: Holger V. <hol...@un...> - 2025-12-04 10:04:51
|
> So, after simulating and linearizing the results, I get a time vector > that starts at 9.900000e-07 seconds and ends at 1.000000e-06 seconds. > The difference between the last and first time values is 1.00000e-08 > seconds, which corresponds to a frequency period of 100 MHz. Great, I'm > trying to perform a Fourier analysis with the fundamental frequency of > 100 MHz and getting the error "wavelength longer than time span" I don't > understand what's wrong this time. You are a victim of the precision of double values in C. Reading from the debugger: The starting point is: 9.9000000000000005e-07 The end point is: 9.9999999999997963e-07 The difference is slightly less than 1e-8. This is somewhat unpredictable. |
|
From: ngspice u. <d16...@ti...> - 2025-12-04 09:56:27
|
> Yes, it'll take some getting used to. > Perhaps you know why the Fourier transform doesn't work for a period of > 1.0e-8 with a fundamental frequency of 100 MHz? Oh, problem solved: 201 points are not enough to run Fourier analysis. |
|
From: ngspice u. <d16...@ti...> - 2025-12-04 09:52:17
|
> The simulation starts at a point in time (typically 0, if you give > TSTART, the simulation starts at 0 as well, but the data are saved from > TSTART on only). The simulation stops at another point in time, given by > TSTOP. There is no simulation data after TSTOP. All Spices behave the > same, and you have to get accustomed to it. Yes, it'll take some getting used to. Perhaps you know why the Fourier transform doesn't work for a period of 1.0e-8 with a fundamental frequency of 100 MHz? |
|
From: Holger V. <hol...@un...> - 2025-12-04 09:38:22
|
> It still looks odd, but maybe it's a quirk of ngspice. It does not look odd, and its not a quirk of ngspice. The simulation starts at a point in time (typically 0, if you give TSTART, the simulation starts at 0 as well, but the data are saved from TSTART on only). The simulation stops at another point in time, given by TSTOP. There is no simulation data after TSTOP. All Spices behave the same, and you have to get accustomed to it. |
|
From: ngspice u. <d16...@ti...> - 2025-12-04 09:12:01
|
02.12.2025 01:37, Holger Vogt пишет:
> start at 1, end at 2.
> How many vector points do you have after linearization? 101
> How many intervals of 10ms each do you have between start and end? 100
Thanks for your reply.
It still looks odd, but maybe it's a quirk of ngspice. It seems obvious
to me that a specific time reference (and its surroundings within the
step duration) corresponds to a parameter value. You're describing a
different logic, which is probably at work in ngspice.
I've reworked the example, or rather, removed the simplifications I made
to ask the question on the mailing list with minimal details, and now it
still has oddities with the time scale even in the version you're
describing, if I understand correctly.
Perhaps you'd have a moment to look at my example? Thank you.
-------
* 1.sch
.PARAM freq = 100e6 omega = freq*3.14159265*2
.PARAM RK = 20
.PARAM Q = 4
.PARAM LK = RK/(omega*Q) CK = Q/(omega*RK)
QKT922B_1 Uk Ub 0 QMOD_KT922B_1 AREA=1
.MODEL QMOD_KT922B_1 npn (Is=292.3F Nf=1 Nr=1 Ikf=2.359 Ikr=1.68
Vaf=81.41 Var=0 Ise=4.199P Ne=1.406 Isc=17.13P Nc=1.803 Bf=84.63 Br=1
Rbm=0 Irb=0 Rc=0.9759 Re=0 Rb=2 Cje=153.3P Vje=0.75 Mje=0.33 Cjc=48.58P
Vjc=0.75 Mjc=0.33 Xcjc=1 Cjs=0 Vjs=0.75 Mjs=0 Fc=0.5 Tf=211.6P Xtf=0.45
Vtf=40 Itf=8 Tr=141.3N Kf=0 Af=1 Ptf=0 Xtb=1.5 Xti=3 Eg=1.11 Tnom=26.85 )
V2 _net0 0 DC 12
VIk _net1 Uk DC 0
VIb _net2 Ub DC 0
V3 _net2 0 DC 0 SIN(0 1.5 100MEG 0 0 0) AC 1.5 ACPHASE 0
C_K _net1 _net0 {CK}
R_K _net1 _net0 {RK} tc1=0.0 tc2=0.0
L_K _net0 _net1 {LK}
.control
; -- ~200 steps per period: 5e-11 --
; -- 99-th period starts with: 9.9e-7 --
; -- 100-th period starts with: 1e-6 --
; -- analyze 99-th period --
tran 5e-11 1e-6 9.9e-7
linearize vik#branch
fourier 100MEG vik#branch
exit
.endc
.END
-------
So, after simulating and linearizing the results, I get a time vector
that starts at 9.900000e-07 seconds and ends at 1.000000e-06 seconds.
The difference between the last and first time values is 1.00000e-08
seconds, which corresponds to a frequency period of 100 MHz. Great, I'm
trying to perform a Fourier analysis with the fundamental frequency of
100 MHz and getting the error "wavelength longer than time span" I don't
understand what's wrong this time.
Do you have any thoughts on this?
Thank you.
|
|
From: Holger V. <hol...@un...> - 2025-12-01 20:37:41
|
start at 1, end at 2. How many vector points do you have after linearization? 101 How many intervals of 10ms each do you have between start and end? 100 |
|
From: Holger V. <hol...@un...> - 2025-12-01 20:29:07
|
Use the .csparam command to send a .param into the .control section like
.PARAM pippo=100 po=20
.PARAM pp={pippo + po}
.csparam pp = {pp} ; you might choose any other name
R1 0 _net0 {pp} tc1=0.0 tc2=0.0
V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0
.control
print pp
.endc
.end
|
|
From: ngspice u. <d16...@ti...> - 2025-12-01 09:41:18
|
Hello, dear community.
Could you please tell me how to view the calculated parameters in the
.PARAM section?
For example, I have the following definitions in a circuit with a
voltage source and a resistor:
---
.PARAM pippo=100 po=20
.PARAM pp={pippo + po}
R1 0 _net0 {pp} tc1=0.0 tc2=0.0
V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0
---
Is there a way to view the value of the calculated 'pp' parameter? For
example, using commands in the .control block?
Thank you.
|
|
From: ngspice u. <d16...@ti...> - 2025-12-01 09:28:29
|
> What about the following: > > * sch1 > R1 0 _net0 1 tc1=0.0 tc2=0.0 > V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0 > .control > tran 0.01 1.99 .99 > linearize > fourier 1 v1#branch > .endc > .END Thank you for your reply. In my example, the starting point of .99 seconds (command ' tran 0.01 1.99 .99' ) was chosen solely to obtain 100 intervals of 10 millisecond duration, starting at 1.00: the uneven step size and .OPTION INTERP produced the desired set of time vector values: 1.00, 1.01, 1.02 ... 1.99 – exactly 100 intervals with a step of 10 milliseconds, that is, exactly 1 second of the periodic signal period. If I run the simulation without .OPTION INTERP, as you recommend, I get a vector with 101 values of 10 milliseconds each. If I understand the logic correctly, then 0.99, 1.00 ... 1.99. 101 * 0.010 = 1.01 seconds. This isn't equal to one signal cycle, which is 1 second long, and the harmonic analysis appears inaccurate at the initial stage. If I understand correctly, the 'fourier' command, when checking for self-starting, checks the duration of the time segment by subtracting the start time from the end time, but doesn't take into account the duration of the interval (in my case, 10 milliseconds), which seems incorrect. |
|
From: Florian B. <flo...@an...> - 2025-11-30 20:32:37
|
Hello d162810f461, You can just simulate a bit more time than theoretically required by replacing "tran 0.01 1.99 .99" by "tran 0.01 2.00 .99". As the signal in your example is a perfect sinus, the result of the fourier analysis has all the energy in the fundamental frequency (noted as the "first" harmonic), except for the small numerical errors. Best regards, Florian __ Le 2025-11-30T20:34:24.000+01:00, ngspice user <d16...@ti...> a écrit : > Greetings, dear community. > I'm trying to use ngspice 45.2 on ArchLinux. > I'm unable to use the 'fourier' command: I get the error "wavelength > longer than time span." > My goal is to perform a harmonic analysis of a signal on the N-th period > of a periodic signal source in a circuit. For example, I want to perform > a transient analysis of 100 signal periods, but only perform a harmonic > analysis on the 100th period. > For this example, I created a circuit with a sine wave voltage source > and a resistor. The sine wave frequency is 1 Hz. The number of intervals > (I apologize for any incorrect terminology: English is not my native > language and I use Google Translate) is 100 for each period, meaning the > time scale step is 10 milliseconds. Purely theoretically, if we break > down each N-th period of a 1-second signal into 100 intervals, we get: > 1: 0.00, 0.01, 0.02 ... 0.99; > 2: 1.00, 1.01, 1.02 ... 1.99; and so on. Each interval starts at .00 and > ends at .99. > If I try to run the following circuit in simulation: > ----- > * sch1 > .OPTION INTERP > R1 0 _net0 1 tc1=0.0 tc2=0.0 > V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0 > .control > tran 0.01 1.99 .99 > fourier 1 v1#branch > exit > .endc > .END > ----- > Then I get an output voltage vector (relative to which, for example, I > want to perform a harmonic analysis), tied to a time vector. The time > vector ranges from 1.00 to 1.99 seconds with a step of 10 milliseconds, > and the number of intervals is 100. To obtain aligned values in this > example, I had to set the transient analysis start point to 0.99, which > actually means 1, and use the INERP option. > I suspect that the 'fourier' command assumes the period of the first > harmonic is greater than the measurement interval, subtracting the start > time from the end time (1.99 - 1.00 = 0.99). However, this approach > seems a bit inaccurate, since one 10-millisecond interval needs to be > added to the subtraction result. > > Does anyone know how to properly process/interpolate the output vector > so that the 'fourier' command produces the correct result for my task: > harmonic analysis of the N-th period of a signal? > Thank you. > > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users |
|
From: Holger V. <hol...@un...> - 2025-11-30 20:07:52
|
What about the following: * sch1 R1 0 _net0 1 tc1=0.0 tc2=0.0 V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0 .control tran 0.01 1.99 .99 linearize fourier 1 v1#branch .endc .END |
|
From: ngspice u. <d16...@ti...> - 2025-11-30 18:18:18
|
Greetings, dear community. I'm trying to use ngspice 45.2 on ArchLinux. I'm unable to use the 'fourier' command: I get the error "wavelength longer than time span." My goal is to perform a harmonic analysis of a signal on the N-th period of a periodic signal source in a circuit. For example, I want to perform a transient analysis of 100 signal periods, but only perform a harmonic analysis on the 100th period. For this example, I created a circuit with a sine wave voltage source and a resistor. The sine wave frequency is 1 Hz. The number of intervals (I apologize for any incorrect terminology: English is not my native language and I use Google Translate) is 100 for each period, meaning the time scale step is 10 milliseconds. Purely theoretically, if we break down each N-th period of a 1-second signal into 100 intervals, we get: 1: 0.00, 0.01, 0.02 ... 0.99; 2: 1.00, 1.01, 1.02 ... 1.99; and so on. Each interval starts at .00 and ends at .99. If I try to run the following circuit in simulation: ----- * sch1 .OPTION INTERP R1 0 _net0 1 tc1=0.0 tc2=0.0 V1 _net0 0 DC 0 SIN(0 1 1 0 0 0) AC 1 ACPHASE 0 .control tran 0.01 1.99 .99 fourier 1 v1#branch exit .endc .END ----- Then I get an output voltage vector (relative to which, for example, I want to perform a harmonic analysis), tied to a time vector. The time vector ranges from 1.00 to 1.99 seconds with a step of 10 milliseconds, and the number of intervals is 100. To obtain aligned values in this example, I had to set the transient analysis start point to 0.99, which actually means 1, and use the INERP option. I suspect that the 'fourier' command assumes the period of the first harmonic is greater than the measurement interval, subtracting the start time from the end time (1.99 - 1.00 = 0.99). However, this approach seems a bit inaccurate, since one 10-millisecond interval needs to be added to the subtraction result. Does anyone know how to properly process/interpolate the output vector so that the 'fourier' command produces the correct result for my task: harmonic analysis of the N-th period of a signal? Thank you. |
|
From: David <bou...@gm...> - 2025-06-01 00:57:58
|
On Sat, 31 May 2025 at 07:54, Dave Flogeras via Ngspice-users <ngs...@li...> wrote: > I'm fairly new to ngspice (I used some spice variant a bit 25+ years ago > in school, but very little since). I am attempting to use (or abuse?) it > as a learning tool by getting it to solve systems that are effectively > block diagrams of Laplace transforms that describe electro/mechanical > systems. > I have the usual growing pains, and wondered if I could share a simple > example or two to discuss. I'm not sure the best way to do this. > Ideally I'd submit a couple of pictures showing my block diagrams, and > boiled down circuit file(s) that I've used to attempt to model the > system. I don't want to abuse the mailing list etiquette though so > I thought I'd as first how best to post. I'm sure just by using gmail > I'm annoying people with HTML. Hi, Ngspice has active discussion forums on the web at: https://sourceforge.net/p/ngspice/discussion/ where posting image files for discussion is very common. The developers are active there and very helpful. Is that what you are looking for? Also, I think there is a way to disable HTML in Gmail, I believe I have done that, so I hope there is no html in this message :) |
|
From: Dave F. <da...@re...> - 2025-05-06 12:41:08
|
Hi list: I'm fairly new to ngspice (I used some spice variant a bit 25+ years ago in school, but very little since). I am attempting to use (or abuse?) it as a learning tool by getting it to solve systems that are effectively block diagrams of Laplace transforms that describe electro/mechanical systems. I have the usual growing pains, and wondered if I could share a simple example or two to discuss. I'm not sure the best way to do this. Ideally I'd submit a couple of pictures showing my block diagrams, and boiled down circuit file(s) that I've used to attempt to model the system. I don't want to abuse the mailing list etiquette though so I thought I'd as first how best to post. I'm sure just by using gmail I'm annoying people with HTML. Please advise, Thanks, Dave |
|
From: Holger V. <hol...@un...> - 2025-01-19 13:24:51
|
I have had a look at the source code. The following is added to the manual: When a new simulation (op, dc, ac, tran etc.) is started, a new 'plot' structure (see [sec:Plots]) with its vectors is set up. Several data structures, as described above, are set up as well, belonging to this 'plot': pvecinfo with vecinfo for each vector, vecinfoall, vecvaluesall, pvecvalues, and vecvalues for each vector. Their pointers are kept constant during the current simulation, they are created anew when another simulation is executed. You might find this code in sharedspice.c, lines 2241 ff., in function sh_vecinit(). |