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

Avoiding spectral leakage in time domain (brute force) simulation #16

Closed
noelhallemans opened this issue Jul 4, 2024 · 2 comments
Closed

Comments

@noelhallemans
Copy link
Contributor

Hi,

To compute the impedance in the time domain in examples/compare_methods.py the model response to a sinusoidal current is computed.

To avoid spectral leakage when taking the FFT I recommend to simulate an integer number of periods.

This can be solved by removing the 1+ on line 38 and -1 on lines 41 to 43.

The difference between frequency domain and time domain simulations will then become smaller!

Kind regards,

Noël

@rtimms
Copy link
Collaborator

rtimms commented Jul 8, 2024

Sounds good, thanks for spotting this! Can you open a PR with the fix?

@rtimms
Copy link
Collaborator

rtimms commented Jul 21, 2024

Fixed by #17

@rtimms rtimms closed this as completed Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants