Skip to content

Adding Improve DC Noise Rejection example in NI-DMM - #2217

Open
divakar-selvam07 wants to merge 19 commits into
ni:masterfrom
NI-velmurugan:users/diva/add-nidmm-improve-dc-noise-rejection-example
Open

divakar-selvam07 wants to merge 19 commits into
ni:masterfrom
NI-velmurugan:users/diva/add-nidmm-improve-dc-noise-rejection-example

Conversation

@divakar-selvam07

Copy link
Copy Markdown
Contributor
  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

  • Adds nidmm_improve_dc_noise_rejection.py, a Python adaptation of the LabVIEW “Improve DC Noise Rejection” example.
  • Updates CHANGELOG.md to call out the new examples in the unreleased section.

List issues fixed by this Pull Request below, if any.

None

What testing has been done?

  • Manually validated with a simulated instrument and an actual hardware instrument.

@codecov-commenter

codecov-commenter commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (49c8447) to head (a793aa8).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2217      +/-   ##
==========================================
+ Coverage   86.40%   88.12%   +1.71%     
==========================================
  Files          86       88       +2     
  Lines       21563    22832    +1269     
==========================================
+ Hits        18631    20120    +1489     
+ Misses       2932     2712     -220     
Flag Coverage Δ
codegenunittests 84.78% <ø> (ø)
nidcpowersystemtests 94.36% <ø> (ø)
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.04% <ø> (ø)
nidigitalunittests 68.43% <ø> (ø)
nidmmsystemtests 92.33% <ø> (ø)
nifakeunittests 86.08% <ø> (ø)
nifgensystemtests 94.34% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsasystemtests 82.71% <ø> (?)
nirfsaunittests 63.40% <ø> (ø)
nirfsgsystemtests 81.22% <ø> (ø)
niscopesystemtests 89.99% <ø> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 81.66% <ø> (ø)
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@divakar-selvam07

Copy link
Copy Markdown
Contributor Author

This PR is ready for @Avinash2Suresh 's review.

Comment thread CHANGELOG.md Outdated
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py Outdated
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py Outdated
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py Outdated
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py Outdated
@divakar-selvam07

divakar-selvam07 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@jarnoldNI , the PR is ready for your review.

Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py
Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py
@divakar-selvam07
divakar-selvam07 marked this pull request as ready for review October 12, 2026 16:46
@ni-jfitzger

Copy link
Copy Markdown
Collaborator

If we're going to copy the example, should we adapt the example description, too?
"""
By varying the weighting of the samples that compose a single measurement, noise can be removed from the measurement. The DC Noise Rejection attribute controls the sample weighting. The signal frequencies removed from the measurement are related to the aperture time selected.
"""

@marcoskirsch What do you think?

@jarnoldNI

Copy link
Copy Markdown

If we're going to copy the example, should we adapt the example description, too? """ By varying the weighting of the samples that compose a single measurement, noise can be removed from the measurement. The DC Noise Rejection attribute controls the sample weighting. The signal frequencies removed from the measurement are related to the aperture time selected. """

@marcoskirsch What do you think?

@ni-jfitzger @marcoskirsch - I like the idea of adding a description like this to the examples. If we do it for this one, we should do it for all of the ones we're working on.

Comment on lines +18 to +20
# For aperture times over 100 ms, enable AutoZero to compensate for drift.
# The DMM takes shorter measurements, applies a new AutoZero offset to each,
# averages them, and returns one value.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're setting auto_zero, way up above. Does this comment need to be split?
Or maybe we set auto_zero down here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm nitpicking, but I feel like this comment could also be clearer. The property that gets set is auto_zero. AutoZero is the enum and it's not like we have a feature with that spelling. The user manual page title it "Auto Zero".
https://www.ni.com/docs/en-US/bundle/ni-dmm/page/auto-zero.html

@marcoskirsch Do you have any thoughts on this?

@divakar-selvam07 divakar-selvam07 Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ni-jfitzger That makes sense. I’ve split the comment, placed the Auto Zero explanation beside auto_zero, and kept the averaging explanation beside number_of_averages. I’ve also corrected the spelling to “Auto Zero.”

Comment thread src/nidmm/examples/nidmm_improve_dc_noise_rejection.py Outdated
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.

6 participants