diff --git a/Project.toml b/Project.toml index e67da22..7835bf1 100755 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,7 @@ FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" GNSSSignals = "52c80523-2a4e-5c38-8979-05588f836870" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" diff --git a/src/Acquisition.jl b/src/Acquisition.jl index a63feda..ab52abc 100755 --- a/src/Acquisition.jl +++ b/src/Acquisition.jl @@ -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))) + 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))) + + + @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); + end +end + + + end