Skip to content

Nopy Tests#66

Closed
drowe67 wants to merge 25 commits into
mainfrom
dr_nopy
Closed

Nopy Tests#66
drowe67 wants to merge 25 commits into
mainfrom
dr_nopy

Conversation

@drowe67

@drowe67 drowe67 commented Feb 4, 2026

Copy link
Copy Markdown
Owner

This branch supports testing of the RADE V1 C port https://github.com/peterbmarks/radae_nopy, by applying the same suite of tests that is applied to the Python version of RADE V1.

This branch is currently not for merge, but we could consider merging if the C Port tests are set up to be optional, e.g. via a cmake variable.

Instructions

  1. Build radae_nopy. (optionally use cmake -DCMAKE_BUILD_TYPE=Release .. for faster, optimised code)
  2. Build this repo, setting a path to radae_nopy/build (default ~/radae_nopy/build)
    cd radae
    mkdir build
    cmake -DRADAE_NOPY_BUILD_DIR=/your/radae_nopy/build ..
    make
    
  3. Run all nopy ctests:
    ctest -V -R radae_nopy
    

Comment thread .github/workflows/run_ctest.yml Outdated
shell: bash
working-directory: ${{github.workspace}}
run: |
git clone https://github.com/tmiw/radae_nopy.git

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@tmiw - so is this the right repo to be testing? Like is it synced with Peter's latest and greatest?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Also = should we be building with the optimisation flags? The C version still runs pretty slow unoptimised (especially the acquisition)

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.

Might be better to put this back on Peter's repo. Will do so now.

Re: optimization, we probably should do at least a bit of work to make sure the difference between optimized and not optimized isn't crazy huge. After the current round of testing?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Sure. I've already run the ctests with radae_nopy configued with cmake -DCMAKE_BUILD_TYPE=Release .. and they passed 👍

drowe67 and others added 3 commits March 15, 2026 06:21
…Python receivers

check_snr.py: use re.search(r'state:\s+sync') instead of literal 'state: sync' to
match both Python radae_rxe.py (single space) and C radae_rx (padded spaces) formats.

CMakeLists.txt: replace hardcoded --snr3k targets with the Measured SNR3k parsed
dynamically from inference.sh stdout.  The hardcoded values were Target SNR3k which
is ~0.8 dB higher than Measured due to PAPR under --peak normalisation.  Tighten
tolerance from 3.0 to 2.0 dB now that the correct reference is used (worst observed
error 1.43 dB).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three new ctests exercising the modem equalization code via QPSK BER:
- radae_nopy_ber: noiseless check (BER must be 0.0000)
- radae_nopy_ber_awgn: AWGN at EbNodB=0, BER < theoretical QPSK target
  with 2 dB implementation loss allowance
- radae_nopy_ber_mpp: MPP two-path Rayleigh at EbNodB=0, BER < theoretical
  two-path target with 2 dB implementation loss allowance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drowe67

drowe67 commented Mar 14, 2026

Copy link
Copy Markdown
Owner Author

@tmiw - I have some radae_nopy code to support a nopy version of the inference_ber* tests that I'd like to push to the main branch of your fork please. So I'd need permission (added as a collaborator) to push to that repo.

Or happy to put it somewhere else (Peter's repo?) if that's easier. Just let me know.

This completes all of the tests I can think of to sign off on the nopy C Port.

@tmiw

tmiw commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

@tmiw - I have some radae_nopy code to support a nopy version of the inference_ber* tests that I'd like to push to the main branch of your fork please. So I'd need permission (added as a collaborator) to push to that repo.

Or happy to put it somewhere else (Peter's repo?) if that's easier. Just let me know.

This completes all of the tests I can think of to sign off on the nopy C Port.

I'd say to make a PR on Peter's repo with these changes.

EDIT: Peter still needs to merge peterbmarks/radae_nopy#2.

drowe67 and others added 2 commits April 27, 2026 10:22
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The LS pseudo-inverse for pilot channel estimation was using regular
transpose A^T (torch.transpose) instead of conjugate transpose A^H
(torch.conj(torch.transpose)) for the complex A matrix.  The Octave
reference implementation (equaliser.m) correctly uses A' which is A^H
in Octave.  Python's torch.transpose is A^T, not A^H.

The bug was invisible in practice because:
- EQ quality is unaffected (dominant G1 term estimated identically)
- SNR calibration coefficients were fitted against the biased estimator

With A^H the phase estimator noise alpha is reduced, so S2 more
accurately estimates N/2, giving a more accurate SNR estimate.

Recalibrate m and c by running est_snr.py --eq_ls for AWGN, MPG, MPP
and averaging the polyfit slopes and intercepts:
  AWGN: m=0.8872 c=3.8355
  MPG:  m=0.7627 c=4.6551
  MPP:  m=0.6452 c=3.9124
  mean: m=0.7650 c=4.1343

Also fix missing model.Pend arg in est_snr.py receiver_one() call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drowe67

drowe67 commented Apr 29, 2026

Copy link
Copy Markdown
Owner Author

This functionality is being merged into main #68

@drowe67 drowe67 closed this Apr 29, 2026
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