Skip to content

Commit

Permalink
Add possibility to change beamformer in state
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoerenm committed Sep 6, 2022
1 parent 1753f62 commit fe68069
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/tracking_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,33 @@ struct TrackingState{
code::COR
end

function TrackingState(
track_state::TrackingState;
post_corr_filter,
)
TrackingState(
track_state.prn,
track_state.system,
post_corr_filter,
track_state.init_carrier_doppler,
track_state.init_code_doppler,
track_state.carrier_doppler,
track_state.code_doppler,
track_state.carrier_phase,
track_state.code_phase,
track_state.correlator,
track_state.carrier_loop_filter,
track_state.code_loop_filter,
track_state.sc_bit_detector,
track_state.integrated_samples,
track_state.prompt_accumulator,
track_state.cn0_estimator,
track_state.downconverted_signal,
track_state.carrier,
track_state.code
)
end

"""
$(SIGNATURES)
Expand Down
2 changes: 2 additions & 0 deletions test/cuda/tracking_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@
state = TrackingState(1, gpsl1, carrier_doppler, code_phase, num_samples = num_samples, num_ants = NumAnts(2))
@test @inferred(Tracking.get_correlator(state)) == EarlyPromptLateCorrelator(NumAnts(2))

changed_state = @inferred(TrackingState(state, post_corr_filter = Tracking.DefaultPostCorrFilter()))
@test get_post_corr_filter(changed_state) == Tracking.DefaultPostCorrFilter()
end
3 changes: 3 additions & 0 deletions test/tracking_state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@
@test @inferred(Tracking.get_code_loop_filter(state)) == SecondOrderBilinearLF()
@test @inferred(Tracking.get_prompt_accumulator(state)) == 0.0
@test @inferred(Tracking.get_integrated_samples(state)) == 0

changed_state = @inferred(TrackingState(state, post_corr_filter = Tracking.DefaultPostCorrFilter()))
@test get_post_corr_filter(changed_state) == Tracking.DefaultPostCorrFilter()
end

0 comments on commit fe68069

Please sign in to comment.