fix: adaptive envelope analysis tolerance for low-resolution FFT datasets#17
fix: adaptive envelope analysis tolerance for low-resolution FFT datasets#17TasfinMahmud wants to merge 1 commit into
Conversation
19c3589 to
5a35935
Compare
|
@abhiprd2000 This implements the physics layer tightening we discussed. The core issue was the FFT bin width on CWRU (11.7 Hz) exceeding the rigid 4% tolerance band (~4.1 Hz), which caused the search band to fall below a single FFT bin. This PR fixes that mathematically by introducing an adaptive tolerance that dynamically widens to guarantee at least 2 FFT bins, capped at 8% to prevent fault-frequency band overlap. As requested, here is the full console output from the CWRU threshold sweep after the fix, proving that it preserves the ~20% accuracy gap while massively improving the engine's ability to confidently Click to view full CWRU threshold sweep log |
|
@TasfinMahmud , Can you go deep down into the mathematical derivation. Also, as far as I can see, there is a narrow increase. What do you think , how will you frame it on the paper? Can we say that physics wins everywhere? Or, should try on another dataset? Have you checked if PU holds in this change as earlier? |
What this PR does
Fixes the root cause of the CWRU physics verification gap by mathematically correcting the FFT search band tolerance.
The Problem
On low-sampling datasets like CWRU (12 kHz, 1024 samples), the FFT bin width is 11.7 Hz.
The physics engine hardcodes a
rel_tol=0.04(4%) tolerance band around the expected fault frequencies. For an outer race fault at 1730 RPM, the BPFO is ~103 Hz. A 4% band around 103 Hz is ±4.1 Hz.This means the search band is narrower than a single FFT bin (0.7 bins), making the physics engine essentially blind on CWRU. It was trying to compare single adjacent bins instead of actually measuring band energy.
The Fix
This PR introduces Adaptive FFT Tolerance in
cnsd/physics/bearing.pyandcnsd/physics/gear.py.fsandn_samples.rel_tolto guarantee the search band covers at least 2 FFT bins.The Result (CWRU Test Set)
This single mathematical fix restores the physics verification capability on CWRU without destroying the peak distributions.
Before:
(Notice the huge number of CONFLICTS — the physics engine was just guessing)
After (This PR):
(Notice the CONFIRMED count skyrockets to 1232, while CONFLICT drops to 284. The engine is now correctly detecting the actual fault frequencies because the search band is wide enough to capture the energy!)
The ~20% Accuracy GAP is preserved, but the physics engine is now operating from a position of mathematical soundness rather than luck. This makes our claim of "domain-agnostic physics verification" defensible to reviewers.
Checklist
band_energy)_prominence)