Skip to content

Commit

Permalink
Merge pull request #22 from JuliaGNSS/resize-downconverted-signal-bug
Browse files Browse the repository at this point in the history
Fix bug with resizing downconverted signal and add tests
  • Loading branch information
dominformant committed Feb 9, 2021
2 parents 3dc74ca + b773e55 commit 1c0eb71
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
@@ -1,7 +1,7 @@
name = "Tracking"
uuid = "10b2438b-ffd4-5096-aa58-44041d5c8f3b"
authors = ["Soeren Zorn <soeren.zorn@nav.rwth-aachen.de>"]
version = "0.14.0"
version = "0.14.1"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
2 changes: 1 addition & 1 deletion src/tracking_state.jl
Expand Up @@ -46,7 +46,7 @@ end

function DownconvertedSignalCPU(num_ants::NumAnts{N}) where N
DownconvertedSignalCPU(
StructArray{Complex{Float32}}(undef, 0),
StructArray{Complex{Float32}}(undef, 0, N),
StructArray{Complex{Float64}}(undef, 0, N)
)
end
Expand Down
26 changes: 26 additions & 0 deletions test/tracking_loop.jl
Expand Up @@ -8,6 +8,32 @@
@test @inferred(post_corr_filter(SVector(1.0 + 0.0im, 2.0 + 0.0im))) == 1.0 + 0.0im
end

@testset "Resize downconverted signal for multiple ants" for type in (Float32, Float64)
downconverted_signal_temp = Tracking.DownconvertedSignalCPU(NumAnts(4))
signal = StructArray(ones(Complex{type}, 2500, 4))
downconverted_signal = Tracking.resize!(downconverted_signal_temp, 2500, signal)
if type == Float32
@test size(downconverted_signal.downconverted_signal_f32) == (2500, 4)
@test size(downconverted_signal.downconverted_signal_f64) == (0, 4)
else
@test size(downconverted_signal.downconverted_signal_f32) == (0, 4)
@test size(downconverted_signal.downconverted_signal_f64) == (2500, 4)
end
end

@testset "Resize downconverted signal for single ant" for type in (Float32, Float64)
downconverted_signal_temp = Tracking.DownconvertedSignalCPU(NumAnts(1))
signal = StructArray(ones(Complex{type}, 2500))
downconverted_signal = Tracking.resize!(downconverted_signal_temp, 2500, signal)
if type == Float32
@test size(downconverted_signal.downconverted_signal_f32) == (2500,)
@test size(downconverted_signal.downconverted_signal_f64) == (0,)
else
@test size(downconverted_signal.downconverted_signal_f32) == (0,)
@test size(downconverted_signal.downconverted_signal_f64) == (2500,)
end
end

@testset "Integration time" begin
gpsl1 = GPSL1()
galileo_e1b = GalileoE1B()
Expand Down

2 comments on commit 1c0eb71

@dominformant
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

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/29706

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 the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.1 -m "<description of version>" 1c0eb719f46ff1ab29cc588573c1d795d23b11fe
git push origin v0.14.1

Please sign in to comment.