Skip to content

Use PrecompileTools to precompile Acquisition.jl#13

Open
minecraft2048 wants to merge 1 commit into
JuliaGNSS:masterfrom
minecraft2048:precompile
Open

Use PrecompileTools to precompile Acquisition.jl#13
minecraft2048 wants to merge 1 commit into
JuliaGNSS:masterfrom
minecraft2048:precompile

Conversation

@minecraft2048

Copy link
Copy Markdown
Contributor

We precompile common signal formats, such as ComplexF32, ComplexF64, Int16, Float32 to reduce time to first acquisition

We precompile common signal formats, such as ComplexF32, ComplexF64,
Int16, Float32 to reduce time to first acquisition

@zsoerenm zsoerenm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for looking into this!
I have some comments, but otherwise looks good.
I haven't tested the code below. Could you test that? ;)

Comment thread src/Acquisition.jl
Comment on lines +48 to +51
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)))

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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 though

Will add the tests

Comment thread src/Acquisition.jl


#common complex data
data_ci8 = rand(Complex{Int8},Int(round(rate*0.01)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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?

Comment thread src/Acquisition.jl
Comment on lines +56 to +58
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)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 1000:

Suggested change
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)))
signal_types = (Int16, Float32, Float64)
signals = map(T -> rand(Complex{T}, 1000), signal_types)

We probably also need different sample_rates types, interm_freq types and max_doppler types

samplerates = (10000Hz, 10000.0Hz, 1000u"kHz", 1000.0u"kHz", 10u"MHz", 10.0u"MHz")
interm_freqs = (100Hz, 100.0Hz, 100u"kHz", 100.0u"kHz", 1u"MHz", 1.0u"MHz")
max_dopplers = (1000Hz, 1000.0Hz, 1u"kHz", 1.0u"kHz")

The GPSL1 should be initialized before @compile_workload because it isn't part of Acquisition.jl .

systems = (GPSL1(), GPSL5(), GalileoE1B())

Comment thread src/Acquisition.jl
Comment on lines +65 to +73
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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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);
foreach(systems) do system
foreach(signals) do signal
foreach(samplerates) do samplerate
foreach(interm_freqs) do interm_freq
foreach(max_dopplers) do max_doppler
acquire(system, signal, samplerate, 1:1; interm_freq, max_doppler)
end
end
end
end
end

(It is enough to acquire a single satellite)

I haven't tested the code, though ;)
You can delete the comments, IMHO

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