-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
137 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "GNSSSignals" | ||
uuid = "52c80523-2a4e-5c38-8979-05588f836870" | ||
authors = ["Soeren Zorn <[email protected]>"] | ||
version = "0.10.1" | ||
version = "0.10.2" | ||
|
||
[deps] | ||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
function read_from_documentation(raw_code) | ||
raw_code_without_spaces = replace(replace(raw_code, " " => ""), "\n" => "") | ||
code_hex_array = map(x -> parse(UInt16, x, base = 16), collect(raw_code_without_spaces)) | ||
code_bit_string = string(string.(code_hex_array, base = 2, pad = 4)...) | ||
map(x -> parse(Int8, x, base = 2), collect(code_bit_string)) .* Int8(2) .- Int8(1) | ||
end | ||
|
||
const GALILEO_E1B_CODES = read_in_codes(joinpath(dirname(pathof(GNSSSignals)), "..", "data", "codes_galileo_e1b.bin"), 50, 4092) | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get codes of type GalileoE1B as a Matrix where each column | ||
represents a PRN. | ||
```julia-repl | ||
julia> get_code(GalileoE1B) | ||
``` | ||
""" | ||
function get_codes(::Type{GalileoE1B}) | ||
GALILEO_E1B_CODES | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get code length of GNSS system GalileoE1B. | ||
```julia-repl | ||
julia> get_code_length(GalileoE1B) | ||
``` | ||
""" | ||
@inline function get_code_length(::Type{GalileoE1B}) | ||
4092 | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get shortest code length of GNSS system GalileoE1B. | ||
```julia-repl | ||
julia> get_shortest_code_length(GalileoE1B) | ||
``` | ||
""" | ||
@inline function get_shortest_code_length(::Type{GalileoE1B}) | ||
get_code_length(GalileoE1B) | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get center frequency of GNSS system GalileoE1B. | ||
```julia-repl | ||
julia> get_center_frequency(GalileoE1B) | ||
``` | ||
""" | ||
@inline function get_center_frequency(::Type{GalileoE1B}) | ||
1.57542e9Hz | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get code frequency of GNSS system GalileoE1B. | ||
```julia-repl | ||
julia> get_code_frequency(GalileoE1B) | ||
``` | ||
""" | ||
@inline function get_code_frequency(::Type{GalileoE1B}) | ||
1023e3Hz | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get data frequency of GNSS system GalileoE1B. | ||
```julia-repl | ||
julia> get_data_frequency(GalileoE1B) | ||
``` | ||
""" | ||
@inline function get_data_frequency(::Type{GalileoE1B}) | ||
250Hz | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get code of type GalileoE1B at phase `phase` of prn `prn`. | ||
The phase will not be wrapped by the code length. The phase has to smaller | ||
than the code length. Includes only BOC(1,1) at the moment. | ||
```julia-repl | ||
julia> get_code_unsafe(GalileoE1B, 10.3, 1) | ||
``` | ||
""" | ||
Base.@propagate_inbounds function get_code_unsafe(::Type{GalileoE1B}, phase, prn::Int) | ||
floored_2phase = floor(Int, 2 * phase) | ||
get_code_unsafe(GalileoE1B, floored_2phase >> 1, prn::Int) * | ||
(iseven(floored_2phase) * 2 - 1) | ||
end | ||
|
||
""" | ||
$(SIGNATURES) | ||
Get code of GNSS system GalileoE1B at phase `phase` of prn `prn`. | ||
The phase will not be wrapped by the code length. The phase has to smaller | ||
than the code length and must be an integer. | ||
```julia-repl | ||
julia> get_code_unsafe(GalileoE1B, 10, 1) | ||
``` | ||
""" | ||
Base.@propagate_inbounds function get_code_unsafe(::Type{GalileoE1B}, phase::Int, prn::Int) | ||
GALILEO_E1B_CODES[1 + phase, prn] | ||
end |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@testset "Galileo E1B" begin | ||
|
||
@test @inferred(get_center_frequency(GalileoE1B)) == 1.57542e9Hz | ||
@test @inferred(get_code_length(GalileoE1B)) == 4092 | ||
@test @inferred(get_shortest_code_length(GalileoE1B)) == 4092 | ||
@test @inferred(get_code(GalileoE1B, 0, 1)) == 1 | ||
@test @inferred(get_code(GalileoE1B, 0.0, 1)) == 1 | ||
@test @inferred(get_code(GalileoE1B, 0.5, 1)) == -1 | ||
@test @inferred(get_code(GalileoE1B, 1.0, 1)) == 1 | ||
@test @inferred(get_code(GalileoE1B, 1.5, 1)) == -1 | ||
@test @inferred(get_code_unsafe(GalileoE1B, 0.0, 1)) == 1 | ||
@test @inferred(get_data_frequency(GalileoE1B)) == 250Hz | ||
@test @inferred(get_code_frequency(GalileoE1B)) == 1023e3Hz | ||
|
||
end |
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
fcf99c8
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.
@JuliaRegistrator register()
fcf99c8
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.
Registration pull request created: JuliaRegistries/General/4175
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via: