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

Unnecessary ffts in BaseTrace class #737

Open
fschlueter opened this issue Oct 21, 2024 · 2 comments
Open

Unnecessary ffts in BaseTrace class #737

fschlueter opened this issue Oct 21, 2024 · 2 comments

Comments

@fschlueter
Copy link
Collaborator

When looking at the base_trace.py class it seems to me that we unnecessarily "resetting" either the time domain trace or frequency spectrum with the goal of "to much security".

In the getter functions get_trace() and get_frequency_spectrum() we set the other representation to None. This of course avoids to store "the same data twice" but unless we perform any operation on either of them we have to perform unnecessary FFTs if we back and forth request both representations. Since we only can change the data with the setter function (we only return copies of the arrays in the getter functions) it would be sufficient to only set the other representation to None in the setter functions.

However, as I said this will increase memory consumption. Is that a limiting factor and the reason for the current implementation or did I miss something?
Maybe @cg-laser, @shallmann or @sjoerd-bouma

@cg-laser
Copy link
Collaborator

we should loop in @christophwelling . We added more security due to unintended changes by reference that could occur otherwise.

@fschlueter
Copy link
Collaborator Author

I see, but I think the copy calls in the getter functions should prevent this. We could also add unit tests to catch this

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