Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pretty printer for acquisition results #12

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

minecraft2048
Copy link
Contributor

This will show a table of PRNs with CN0, carrier doppler and code phases instead of raw Julia struct dump

Before:

julia> acquire(GPSL1(), mmap_buf_raw[1:4096], sample_rate*Hz, 1:32, max_doppler=40000Hz)
32-element Vector{Acquisition.AcquisitionResults{GPSL1{Matrix{Int16}}, Float32}}:
GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}() GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()Acquisition.AcquisitionResults{GPSL1{Matrix{Int16}}, Float32}(, 1, 4.096e6 Hz, 6333.3333333333285 Hz, 975.796142578125, 46.81863125100185, 11038.363f0, Float32[18572.95 15015.173 … 6065.8623 2548.818; 19040.5 4524.363 … 7934.0605 4817.4497; … ; 8162.4614 14175.911 … 8782.8 5482.5293; 12551.445 17593.104 … 4964.5303 4034.6843], -40000.0:333.3333333333333:40000.0)
 GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()Acquisition.AcquisitionResults{GPSL1{Matrix{Int16}}, Float32}(, 2, 4.096e6 Hz, 12666.666666666664 Hz, 809.208984375, 41.87030576943526, 11038.363f0, Float32[2749.5 3845.736 … 9135.486 17222.809; 1170.8043 922.0265 … 16994.95 40483.47; … ; 24079.648 4738.8716 … 1592.0038 495.50058; 8905.348 6122.51 … 2255.3472 2553.3147], -40000.0:333.3333333333333:40000.0)
 GPSL1{Matrix{Int16}}()GPSL1{Matrix{Int16}}()Acquisition.AcquisitionResults{GPSL1{Matrix{Int16}}, Float32}(, 3, 4.096e6 Hz, 10333.333333333328 Hz, 215.28955078125, 45.01535691963892, 11038.363f0, Float32[19694.23 47327.785 … 12565.127 14924.086; 29930.008 67733.555 … 8196.492 9384.577; … ; 2724.7097 4526.7773 … 3299.5862 1436.8499; 5161.059 7676.764 … 10543.941 11131.6875], -40000.0:333.3333333333333:40000.0)
...

After:

image

Text version:

julia> acquire(GPSL1(), mmap_buf_raw[1:4096], sample_rate*Hz, 1:32, max_doppler=40000Hz)
┌─────┬─────────┬──────────────────────┬────────────────────┐
│ PRN │     CN0 │ Carrier doppler (Hz) │ Code phase (chips) │
├─────┼─────────┼──────────────────────┼────────────────────┤
│   1 │ 46.8186 │           6333.33 Hz │            975.796 │
│   2 │ 41.8703 │           12666.7 Hz │            809.209 │
│   3 │ 45.0154 │           10333.3 Hz │             215.29 │
│   4 │ 47.9493 │           16333.3 Hz │            81.1707 │
│   5 │ 40.7673 │          -5666.67 Hz │            40.2107 │
│   6 │ 40.7517 │          -17333.3 Hz │            742.774 │
│   7 │  41.894 │          -10666.7 Hz │            191.063 │
│   8 │ 40.8489 │          -9666.67 Hz │            947.324 │
│   9 │ 41.0482 │           19333.3 Hz │            401.358 │
│  10 │ 41.1133 │          -3333.33 Hz │            230.525 │
│  11 │  46.765 │           21333.3 Hz │            222.033 │
│  12 │ 41.3941 │          -21000.0 Hz │            332.925 │
│  13 │ 40.9514 │          -28333.3 Hz │             982.04 │
│  14 │ 43.3714 │          -25333.3 Hz │            566.696 │
│  15 │ 41.0788 │          -30666.7 Hz │            335.422 │
│  16 │  41.468 │           35666.7 Hz │            44.2068 │
│  17 │ 41.9595 │           7333.33 Hz │            294.962 │
│  18 │ 40.6438 │          -30666.7 Hz │             838.68 │
│  19 │ 40.6003 │          -38666.7 Hz │            493.268 │
│  20 │ 41.0764 │          -4666.67 Hz │            2.49756 │
│  21 │ 41.0419 │           21333.3 Hz │            585.428 │
│  22 │ 40.0897 │          -666.667 Hz │            615.648 │
│  23 │ 40.8109 │           15000.0 Hz │            943.328 │
│  24 │ 41.0855 │           40000.0 Hz │            16.4839 │
│  25 │ 41.6787 │           26666.7 Hz │            892.378 │
│  26 │ 41.5415 │           17000.0 Hz │            723.293 │
│  27 │ 41.3723 │           31000.0 Hz │            79.6721 │
│  28 │ 42.0714 │           37000.0 Hz │            638.376 │
│  29 │ 40.7247 │           20333.3 Hz │            268.488 │
│  30 │ 41.2057 │          -33333.3 Hz │            974.298 │
│  31 │ 46.9644 │           11333.3 Hz │             470.54 │
│  32 │ 44.2343 │          -1666.67 Hz │            513.998 │
└─────┴─────────┴──────────────────────┴────────────────────┘


This will show a table of PRNs with CN0, carrier doppler and code phases
instead of raw Julia struct dump
AcquisitionResults.code_phase is in chips not samples
Copy link
Member

@zsoerenm zsoerenm left a comment

Choose a reason for hiding this comment

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

Very cool!
Just some small comments.

I wonder if we could add a Unicode heatmap at some time:
https://github.com/JuliaPlots/UnicodePlots.jl#user-content-heatmap-plot
But that's probably overkill and definitely not part of this PR.

src/Acquisition.jl Outdated Show resolved Hide resolved
src/Acquisition.jl Outdated Show resolved Hide resolved
src/Acquisition.jl Outdated Show resolved Hide resolved
minecraft2048 and others added 3 commits June 6, 2024 20:10
Co-authored-by: Soeren Schoenbrod <soeren.schoenbrod@outlook.de>
Co-authored-by: Soeren Schoenbrod <soeren.schoenbrod@outlook.de>
Co-authored-by: Soeren Schoenbrod <soeren.schoenbrod@outlook.de>
@minecraft2048
Copy link
Contributor Author

I think there's a regression with julia nightly:

WARNING: llvmcall with integer pointers is deprecated.
Use actual pointers instead, replacing i32 or i64 with i8* or ptr
in downconvert!(Array{Base.Complex{T}, 1}, AbstractArray{Base.Complex{TS}, 1}, Any, Any) where {T, TS} at /home/runner/work/Acquisition.jl/Acquisition.jl/src/downconvert.jl
Test Summary: | Pass  Total  Time
Downconvert   |    1      1  5.2s
Test Summary:                 | Pass  Total  Time
Estimate signal / noise power |   12     12  0.7s
Test Summary:             | Pass  Total  Time
Power over code for GPSL1 |    1      1  1.8s
Test Summary:                  | Pass  Total  Time
Power over code for GalileoE1B |    1      1  0.5s
Test Summary:                         | Pass  Total  Time
Power over code and Doppler for GPSL1 |    2      2  2.6s
Test Summary:                              | Pass  Total  Time
Power over code and Doppler for GalileoE1B |    2      2  0.7s
Acquire signal GPSL1 and signal type Float64: Test Failed at /home/runner/work/Acquisition.jl/Acquisition.jl/test/acquire.jl:47
  Expression: ≈(acq_res.CN0, CN0, atol = 6)
   Evaluated: 51.29622203029129 ≈ 45 (atol=6)

Something broke the CN0 estimation, and LoopVectorization looks a bit suspicious...

@zsoerenm
Copy link
Member

zsoerenm commented Jun 13, 2024

Let's not care about nightly too much. I think this is fine for now.
Thank you!

@zsoerenm zsoerenm merged commit 4c4ca8a into JuliaGNSS:master Jun 13, 2024
2 of 3 checks passed
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