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

PowerSpectrum: improve diagnostic value power spectrum api #695

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JoepVanlier
Copy link
Member

@JoepVanlier JoepVanlier commented Sep 27, 2024

Why this PR?

  • A simpler constructor will allow easier construction of a PowerSpectrum. The benefits of this may not be evident in this PR, but a followup one will have pathological spectra constructed directly rather than ifft'ing the spectrum only to immediately fft it again.
  • Keeping track of the uncut data will allow us to plot what we excluded.
  • Keeping track of the high frequency data and performing the downsampling and exclusion/fit ranges lazily will allow us to do multiple analyses without the requirement to always recompute the expensive part (the FFT) or keep two separate power spectra around. It also means that we will be getting the full spectrum in the calibration routine, which will allow us to apply some improvements going forward.
  • Plotting the driving peak for an active calibration result gives a feel for how far above the noise floor it sits.
image

Tradeoffs

Increased size

Keeping the high frequency spectrum around does come at a cost, namely the increased memory footprint. For a typical calibration (100 kHz sample rate) this is about 4 MB worth of data per axis for passive, 8 for active.

Downsampling and frequency exclusion ranges

There is one annoying issue with showing the frequency exclusion ranges. Exclusion ranges are applied prior to downsampling, which means that downsampling can subsequently pull a point outside the exclusion ranges into it. This is not really a bug, as this allows us to make cuts smaller than the blocking size, but it can look weird.

image

@JoepVanlier JoepVanlier force-pushed the lazy_power branch 11 times, most recently from ba1a1a5 to aea2040 Compare October 2, 2024 16:40
@JoepVanlier JoepVanlier changed the title PowerSpectrum: simplify constructor and keep track of high frequency spectra PowerSpectrum: improve diagnostic value power spectrum api Oct 7, 2024
@JoepVanlier JoepVanlier marked this pull request as ready for review October 7, 2024 15:18
@JoepVanlier JoepVanlier requested review from a team as code owners October 7, 2024 15:18
@JoepVanlier JoepVanlier changed the base branch from main to expose_diode_model October 10, 2024 11:53
Base automatically changed from expose_diode_model to main October 18, 2024 14:20
Three reasons for doing this
- A simpler constructor will allow easier construction of tests.
- Keeping track of the high frequency data and performing the downsampling and exclusion/fit ranges lazily will allow us to do multiple analyses without the requirement to always recompute the expensive part (the FFT).
- Keeping track of the uncut data will allow us to plot what we excluded.
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

Successfully merging this pull request may close these issues.

1 participant