-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFT and AC are not allowed on the same schematic #463
Comments
I stumbled upon that issue too. |
Pull request #463? Attached is ngspice netlist of 100 watt audio amp from the ngspice examples folder with simultaneous AC, Trans and FFT. It works and the FFT looks good. I would like to be able to do this with Qucs-S. |
Only for information - not an answer, sorry: The difference to capabilities of other popular simulators is that ngspice VDMOS model has true self-heating built-in. So you can investigate how the impact is on distortion if the cooling chain is insufficient. E.g. look for the both thermal nodes of the power mosfets in transient analysis. |
I am aware about this problem. The usage of FFT and AC in the same time is not allowed. @ivandi69 PR #412 has effect only for script simulation type and doesn't help to resolve this issue. The reason of the conflict of AC and FFT is that both are using |
The source for DuSpice is available. Maybe it will reveal how Holger does it. The analysis % done is also in the code. I opened the Pascal source in Lazarus but was lost... https://ngspice.sourceforge.io/experimental/ng_gui_sources.7z |
I did more testing. The Nutmeg script required to do AC, Trans and FFT is very simple. In addition Trans and FFT can use different tran statements allowing independent analysis. As you know inside Qucs-S, FFT frequency "span" is "locked" to the AC analysis start/stop frequency and FFT frequency "resolution" and the Transient analysis are "restricted" to the same Tran statement. These limitations don't exist in ngspice and DuSpice and KiCAD don't have them. My attempt using a Nutmeg script inside Qucs-S was a failure... |
@tomhajjar This could be recommended only as the workaround. It's need to find a way to resolve conflict of the X-axis variable name for AC and FFT. This should be fixed in C++ level but not in documentation level. |
Wouldn't the source for DuSpice reveal how Holger did it? |
The sources of DuSpice will not help. DuSpice doesn't convert schematic to netlist. It only provides an interface for the console Ngspice. You can run Ngspice in terminal and obtain the same result as using DuSpice. |
I'm confused... I tested OpAmp_ac_trans_fft.sch and generated a netlist -> OpAmp_ac_trans_fft.qucs Edited OpAmp_ac_trans_fft.qucs by adding plot statements and deleting destroy all and reset creating -> OpAmp_ac_trans_fft.sp. Used DuSpice on OpAmp_ac_trans_fft.sp creating the three data files for ac/tran/fft and multiple plots which are all correct. If the data files "ac", "fft" and "tran" are correct and "frequency" and # of points is different for the ac and fft txt files, why are the ac and fft plots BOTH using "frequency" and # of points from ac.txt when fft should be using frequency and # of points from fft.txt? Isn't the problem that the Qucs-S FFT plot is using the amplitude data from OpAmp_ac_trans_fft_fft.txt but the frequency data from OpAmp_ac_trans_fft_ac.txt? Not only is the fft "frequency" wrong, thousands of data points in OpAmp_ac_trans_fft_fft.txt are missing from the plot. |
All SPICE datasets are assembled into one Qucs XML dataset. If there exists two X-variables with the same name, it will be conflict. It is not a straightforward task to resolve this issue. I don't expect this to be fixed by the next release. |
I created a test project. It compares data files from Qucs-S and ngspice. I had DuSpice generate data using netlist "OpAmp_ac_trans_fft.sp". Comparison shows the FFT data set size and the v(in), v(out) data is the same for the Qucs file "OpAmp_ac_trans_fft.dat.ngspice" and ngspice file "OpAmp_ac_trans_fft_fft.txt". In "OpAmp_ac_trans_fft.dat.ngspice", "frequency" is stated on the following lines: indep frequency 607 Can the 2nd "indep frequency" and 129 versus 607 be used to help solve this issue? Obviously more examples need to be created. |
@dwarning I found a number of issues with it. Gain and Phase plots are wrong and the use of "fourier 1K V(out)" doesn't seem to do anything. Deleting it doesn't effect the plots. I recreated the schematic in LTspice and Qucs-S. I assume due to the extra voltage source V3 in 100W.sp is set up to use the Tian probe method. It is used to calculate Gain/Phase and the results are wrong. |
Fixed via #513 |
I cannot get AC, Trans and FFT (Spectrum Analysis) data in the same analysis while AC, Trans and FOUR works.
Comparing C300_FFT plots to C300_FOUR plots:
For C300_FFT:
ac.v(in), ac.v(out) and frequency are listed twice. "frequency" has 301 and 8193 data points. How is Qucs discerning the AC versus FFT data?
Why does FFT use the same start/stop as the AC analysis regardless of settings? FOUR doesn't have this restriction. I can set the start and stop.
The FFT plot is garbage unless I delete the AC analysis.
Why does FFT take much longer than FOUR?
Why do I need the Nutmeg equation, S=db(v(out))?
Also attached is a simple OpAmp inverter with the same issues.
Attached is ngspice netlist of 100watt amp with simultaneous AC, Trans and FFT. It works but the FFT looks OK has low resolution. The ngspice netlist below (100W_ac_tran_fft.sp) is how I would I would the plots to look with Qucs-S.
The text was updated successfully, but these errors were encountered: