Xiaomi S400: use 50 kHz for estimation equations - #1508
Conversation
The S400 is dual-frequency (50 / 250 kHz). Sun 2003 (TBW) and Janssen 2000 (SMM) were both derived on 50 kHz single-frequency BIA, but S400BodyComposition.compute() fed them the high-frequency band — the smaller of the two magnitudes after the Cole-Cole sort. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzAUUMVb6dWAshRJ9U6RY5
|
Before I go further into this one, a few questions — I'd like to understand the change before judging it.
@DanyPM, since the pipeline and the spec are yours, your view on 1 and 4 would help a lot. |
Problem
S400BodyComposition(added in #1367 / #1376, cc: @DanyPM ) feeds the high-frequencyimpedance band to the Sun 2003 (TBW) and Janssen 2000 (SMM) equations. Both were
derived on 50 kHz single-frequency BIA, and the S400's high-frequency band is
250 kHz.
For my setup this caused FFM and TBW values to be pushed out of range and suppressed.
Change
compute()already computesrL(the corrected low-frequency band) for theHanai ECW step. This PR feeds
rLto Sun 2003 and Janssen 2000 as well, insteadof
rH.Testing
./gradlew :app:testDebugUnitTest— full suite green. The newusesLowFrequencyForPredictiontest fails without the one-line fix.Generated and reasoned through with AI. Validated and edited by a human.