System Information:
qucs-s version: 25.1.2
ngspice version: 44
1. FFT Magnitude Varies with Frequency Resolution (df)
I've observed that changing the FFT frequency resolution (df) from 10 MHz to 1 MHz causes a significant variation in the output magnitude, even though the input signal remains unchanged.
Could you explain how the FFT magnitude depends on df?
2. FFT Peak Shifts When Bandwidth (BW) is Narrowed
When I reduce the FFT analysis bandwidth (BW) to below the input signal frequency of 140 GHz, the FFT peak unexpectedly appears at other frequencies within the selected range, instead of showing a peak at 140 GHz. If the bandwidth is higher (e.g., 250 GHz), the FFT correctly shows a peak at 140 GHz, which is expected. But when the BW is set lower than 140 GHz, even though the input signal remains unchanged, the FFT displays peaks at incorrect frequencies within the selected range.
Since the input is a clean 1 mV sinusoid at 140 GHz, there should not be any spikes at other frequencies. Why does this happen?
Could you give some insights into this behavior?
3. Clarification Needed on FFT Magnitude Scaling
When applying a 1 mV peak sinusoidal input at 140 GHz, the resulting FFT magnitude is approximately 902 μV. This value does not correspond clearly to either the peak or RMS of the input signal. Could you please clarify how the FFT magnitude is computed and whether it represents the peak value, RMS, or a window-scaled quantity? Understanding this would help interpret the results more accurately.
This is the previous discussion on github
@dwarning could you please check this?
What should I answer for this pathological cases? Ask the internet or looking into textbooks the we see that if the parameters for fft are not sufficient then the results are not as expected. So rise the BW to 500GHz and you see something like 1mV. This also answered your third question.
For me surprising is the impact of use initial conditions UIC. Can't explain at the moment why the amplitude goes down significant without UIC.
BTW, you didn't mention if your ngspice is working with fftw3 or the built-in routines.
Last edit: AAli 2025-06-22
Just have a look at the sine wave you have been creating by
tran 2e-12 1e-06 0 UICWhat about
tran 1e-13 1e-07 0 UIC ?Regarding constructive discussion and technical groundings: You opened the case as an issue on IHP github, clearly to see that not any element of their PDK is involved (even you included unnecessary and confusing their lib's). And the issue is still open - you see it as needless to close it.
First, I opened the issue because the simulation was run using the toolchain supported by the IHP Open PDK, and the unexpected FFT behavior occurred within that environment. While the PDK itself may not be directly responsible, the issue emerged in the context of the full toolchain, which many users rely on.
Second, I understand if you feel the issue may not be directly related to the PDK itself, and I’m open to that perspective. But I would kindly suggest that we keep the discussion focused on technical clarity rather than questioning the intent behind opening the issue. Raising questions—even if they turn out to be miscategorized—is part of the learning and debugging process. Constructive dialogue helps everyone, especially in open-source environments where shared learning is the goal.