Skip to content
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

Add spectrum analysis simulation for Nsgpice #88

Closed
2 tasks done
ra3xdh opened this issue May 9, 2022 · 7 comments
Closed
2 tasks done

Add spectrum analysis simulation for Nsgpice #88

ra3xdh opened this issue May 9, 2022 · 7 comments
Assignees
Milestone

Comments

@ra3xdh
Copy link
Owner

ra3xdh commented May 9, 2022

Currently the FFT analysis is possible using the Nutmeg scripting https://qucs-s-help.readthedocs.io/en/latest/ASim.html#spectrum-analysis-with-ngspice-and-nutmeg-scripting It would be more user-friendly way if we add a special simulation type that generates this Nutmeg script automatically.

  • Add FFT analysis component
  • Add simulation examples
@ra3xdh ra3xdh added this to the 0.0.24 milestone May 9, 2022
@ra3xdh ra3xdh self-assigned this May 9, 2022
@ra3xdh
Copy link
Owner Author

ra3xdh commented May 12, 2022

The attached screenshot illustrates the concept of the new FFT simulation. This simulation type is available on the current branch.
image

@ra3xdh
Copy link
Owner Author

ra3xdh commented Jun 29, 2022

Added ring diode mixer example ´examples/Mixer_FFT.sch´ by commit 9457952 The FFT simulation type will be presented in 0.0.24 release. Closing issue for now.

@ra3xdh ra3xdh closed this as completed Jun 29, 2022
@tomhajjar
Copy link

I have never gotten the example in Figure 5.8 to work using the following Nutmeg script. No data is generated.

tran 1n 10u 0
linearize v(out)
fft V(out)
let S = db(v(out))

This new method will save time as well.
mixer

@ra3xdh
Copy link
Owner Author

ra3xdh commented Aug 5, 2022

Hello Tom, the schematic from the manual works on my machine as expected. Probably you have something wrong with the Nutmeg script setting. Please check the following attached schematic:
Mixer.zip

@tomhajjar
Copy link

When I copy your Nutmeg script and tran statement into my schematic, it still didn't work. The only difference I found was my schematic name has spaces in it. Changing name to remove spaces fixed it. Not sure why this happens. I have many schematics with names using spaces.

Changed:
Double Balanced Diode Mixer 7-15MHz.sch

To:
DBM_Mixer.sch

Your schematic has two different tran statements. I assume using Nutmeg script this is allowed?

@ra3xdh
Copy link
Owner Author

ra3xdh commented Aug 5, 2022

Yes, I can reproduce this bug now. The space in the schematic name breaks the custom simulation and produce the string like this in the netlist:

write Mixer 1_custom.txt V(out) S

The write command become invalid. I will fix this bug in the next release. As workaround you may save your schematic using scripting simulation without the space in the file name. Other simulation types are not affected.

@ra3xdh
Copy link
Owner Author

ra3xdh commented Aug 5, 2022

I have created a separate issue #129 instead of writing to the closed issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants