From c03a337fd5bc07abd4b0d7b3e8e50a7b466d468b Mon Sep 17 00:00:00 2001 From: Soeren Schoenbrod Date: Wed, 10 Aug 2022 17:05:54 +0200 Subject: [PATCH] Add back PRN to acquisition results --- .github/workflows/CompatHelper.yml | 0 .github/workflows/TagBot.yml | 0 .github/workflows/register.yml | 0 Project.toml | 4 ++-- src/Acquisition.jl | 15 ++++++++++++++- test/runtests.jl | 2 ++ 6 files changed, 18 insertions(+), 3 deletions(-) mode change 100644 => 100755 .github/workflows/CompatHelper.yml mode change 100644 => 100755 .github/workflows/TagBot.yml mode change 100644 => 100755 .github/workflows/register.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/register.yml b/.github/workflows/register.yml old mode 100644 new mode 100755 diff --git a/Project.toml b/Project.toml index 7b819f1..af86577 100755 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Acquisition" uuid = "d4bbf60b-102b-5ffb-8f97-a7ea5817e69f" authors = ["Soeren Schoenbrod "] -version = "0.0.3" +version = "0.0.4" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" @@ -13,7 +13,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" [compat] -DocStringExtensions = "0.6, 0.7, 0.8" +DocStringExtensions = "0.6, 0.7, 0.8, 0.9" FFTW = "1.0" GNSSSignals = "0.15, 0.16" Unitful = "0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 1.0" diff --git a/src/Acquisition.jl b/src/Acquisition.jl index 8eb4cac..f4c7580 100755 --- a/src/Acquisition.jl +++ b/src/Acquisition.jl @@ -7,6 +7,7 @@ module Acquisition struct AcquisitionResults{S<:AbstractGNSS} system::S + prn::Int sampling_frequency::typeof(1.0Hz) carrier_doppler::typeof(1.0Hz) code_phase::Float64 @@ -25,6 +26,12 @@ module Acquisition acq_res.dopplers, y, log_scale ? 10 * log10.(acq_res.power_bins) : acq_res.power_bins end + """ + $(SIGNATURES) + Perform the aquisition of the satellite `sat_prn` in System `S` in signal `signal` + sampled at rate `sampling_freq`. The aquisition is performed as parallel code phase + search using the doppler frequencies `dopplers`. + """ function acquire(S::AbstractGNSS, signal, sampling_freq, sat_prn; interm_freq = 0.0Hz, max_doppler = 7000Hz, dopplers = -max_doppler:1 / 3 / (length(signal) / sampling_freq):max_doppler) code_period = get_code_length(S) / get_code_frequency(S) powers = power_over_doppler_and_code(S, signal, sat_prn, dopplers, sampling_freq, interm_freq) @@ -32,9 +39,15 @@ module Acquisition CN0 = 10 * log10(signal_power / noise_power / code_period / 1.0Hz) doppler = (doppler_index - 1) * step(dopplers) + first(dopplers) code_phase = (code_index - 1) / (sampling_freq / get_code_frequency(S)) - AcquisitionResults(S, sampling_freq, doppler, code_phase, CN0, powers, dopplers / 1.0Hz) + AcquisitionResults(S, sat_prn, sampling_freq, doppler, code_phase, CN0, powers, dopplers / 1.0Hz) end + """ + $(SIGNATURES) + Performs a coarse aquisition and fine acquisition of the satellite `sat_prn` in System `S` in signal `signal` + sampled at rate `sampling_freq`. The aquisition is performed as parallel code phase + search using the doppler frequencies `dopplers`. + """ function coarse_fine_acquire(S::AbstractGNSS, signal, sampling_freq, sat_prn; interm_freq = 0.0Hz, max_doppler = 7000Hz) coarse_step = 1 / 3 / (length(signal) / sampling_freq) acq_res = acquire(S, signal, sampling_freq, sat_prn; interm_freq, dopplers = -max_doppler:coarse_step:max_doppler) diff --git a/test/runtests.jl b/test/runtests.jl index f908cd4..05ef982 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -108,12 +108,14 @@ end @test acq_res.code_phase ≈ code_phase atol = 1e-3 @test acq_res.CN0 ≈ CN0 + 10 * log10(integration_time / 1e-3s) atol = 2 + @test acq_res.prn == 1 coarse_fine_acq_res = coarse_fine_acquire(gpsl1, signal, sample_freq, 1) @test coarse_fine_acq_res.carrier_doppler == 1000Hz @test coarse_fine_acq_res.code_phase ≈ code_phase atol = 1e-3 @test coarse_fine_acq_res.CN0 ≈ CN0 + 10 * log10(integration_time / 1e-3s) atol = 2 + @test coarse_fine_acq_res.prn == 1 #doppler_step = 2 / 3 / integration_time #doppler_steps = -7000:doppler_step:7000