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

Develop initial proof-of-concept unit test for FrequencyMeasurement filter #242

Closed
azonenberg opened this issue Oct 21, 2020 · 0 comments
Closed
Labels
build Build system and infrastructure

Comments

@azonenberg
Copy link
Collaborator

Depends on ngscopeclient/scopehal#313.

The test case should do the following:

  1. Use a hard coded random seed to initialize a PRNG (we want tests to be deterministic)
  2. Use Filter::CreateFilter() to create a FrequencyMeasurement
  3. Repeat many times in a loop:
    1. Pick a random amplitude, phase, period, and sample rate. Ensure sample frequency is high enough to avoid aliasing.
    2. Call GenerateNoisySinewave() to generate a waveform containing at least a few hundred cycles of the test signal
    3. Apply the test signal to the filter
    4. Run the filter
    5. Sanity check that all calculated values are close to the actual input frequency
@azonenberg azonenberg added the build Build system and infrastructure label Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system and infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant