Skip to content

Conversation

@eriksandgren
Copy link
Contributor

No description provided.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 7, 2025

CI Information

To view the history of this post, click the 'edited' button above
Build number: 4

Inputs:

Sources:

more details

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (0)

Outputs:

Toolchain

Version:
Build docker image:

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ❌ Toolchain
  • ❌ Build twister
  • ❌ Integration tests

Note: This message is automatically posted and updated by the CI

@eriksandgren eriksandgren force-pushed the cs_de_ifft_issue_offset_by_1_bin branch 2 times, most recently from b9fc43f to 3b981f1 Compare November 7, 2025 14:08
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

You can find the documentation preview for this PR here.

This commit fixes an issue where the computed IFFT magnitude was offset
by 1 index due to an implementation error when using FFT to compute the
IFFT.

The implementation is changed to a different approach which should solve
this issue. The new approach is tested and verified to be equal to the
output of numpy IFFT:
`np.abs(np.fft.ifft(iq_tones_comb, n=512))`

This commit also splits refactors `calculate_dist_ifft` with the
intention of making it easier to follow. The function has been split up
into multiple sub-functions with comments trying to explain the logic of
each sub-function.

Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
This commit adds unittests for the cs_de module.

Three unittests are added for the `cs_de_calc` function:

`test_cs_de_calc_empty_report` and `test_cs_de_calc_bad_tone_quality`
tests that the returned result is `CS_DE_QUALITY_DO_NOT_USE` when the
input is empty or has bad tone quality.

`test_cs_de_calc_with_ideal_iq_data` tests that given ideal measurement
data (which is generated by the UT itself) the `cs_de_calc` function can
estimate the correct distance using both `ifft` and `phase_slope`
algorithm.

Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
As only one size (512, 1024 or 2048) can be used at a time.

Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
Noticed that this was missing when adding ownership
of the unittest for cs_de.

Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
It might happen that the ToF is negative because the RTT measurements
are in CS are not perfectly accurate and may have a statisical
distribution around its true value.

It might also happen that the ToF is negative because the devices
involved in the CS RTT measurements are not perfectly calibrated for
internal delays.

In these cases it makes more sense to just set the estimated distance to
0.0f, since it is the best estimate we can make, given that we do not
want to use negative distances.

Signed-off-by: Erik Sandgren <erik.sandgren@nordicsemi.no>
@eriksandgren eriksandgren force-pushed the cs_de_ifft_issue_offset_by_1_bin branch from 3b981f1 to 9df0709 Compare November 8, 2025 12:33
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.

2 participants