-
Notifications
You must be signed in to change notification settings - Fork 5
Use PrecompileTools to precompile Acquisition.jl #13
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,8 @@ using DocStringExtensions, | |||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| import Unitful: s, Hz | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| using PrecompileTools | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export acquire, | ||||||||||||||||||||||||||||||||||||||||||
| plot_acquisition_results, | ||||||||||||||||||||||||||||||||||||||||||
| coarse_fine_acquire, | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -35,4 +37,43 @@ include("plot.jl") | |||||||||||||||||||||||||||||||||||||||||
| include("calc_powers.jl") | ||||||||||||||||||||||||||||||||||||||||||
| include("est_signal_noise_power.jl") | ||||||||||||||||||||||||||||||||||||||||||
| include("acquire.jl") | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @setup_workload begin | ||||||||||||||||||||||||||||||||||||||||||
| # Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the | ||||||||||||||||||||||||||||||||||||||||||
| # precompile file and potentially make loading faster. | ||||||||||||||||||||||||||||||||||||||||||
| rate = 2.048e6 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| #common real data | ||||||||||||||||||||||||||||||||||||||||||
| data_i8 = rand(Int8,Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
| data_i16 = rand(Int16,Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
| data_f32 = rand(Float32,Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
| data_f64 = rand(Float64,Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| #common complex data | ||||||||||||||||||||||||||||||||||||||||||
| data_ci8 = rand(Complex{Int8},Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the same as in my previous comment. There isn't an automatic test for Int8. So either remove that or add an automatic test? |
||||||||||||||||||||||||||||||||||||||||||
| data_ci16 = rand(Complex{Int16},Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
| data_cf32 = rand(Complex{Float32},Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
| data_cf64 = rand(Complex{Float64},Int(round(rate*0.01))) | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+58
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is fine if we just hard code the number of samples to something like a
Suggested change
We probably also need different The GPSL1 should be initialized before |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @compile_workload begin | ||||||||||||||||||||||||||||||||||||||||||
| # all calls in this block will be precompiled, regardless of whether | ||||||||||||||||||||||||||||||||||||||||||
| # they belong to your package or not (on Julia 1.8 and higher) | ||||||||||||||||||||||||||||||||||||||||||
| #TODO add support for other GNSS constellations | ||||||||||||||||||||||||||||||||||||||||||
| samplerate = rate*Hz | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_ci8[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_ci16[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_cf32[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_cf64[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_i8[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_i16[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_f32[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
| acquire(GPSL1(),data_f64[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+65
to
+73
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(It is enough to acquire a single satellite) I haven't tested the code, though ;) |
||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've actually never tested acquisition with real valued data. Does that actually work?
If yes, I think we should add automatic test first. Otherwise just remove those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen it work with Int8 and Int16 IF data from NordNav frontend, CYGNSS and TDS-1 missions.
It need to be at an intermediate frequency of course, you can't have real-valued baseband / zero-IF signal
The
downconvert!function will promote any non-ComplexF32 data into ComplexF32 thoughWill add the tests