Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ process:
ambiguity:
delayMin: -10
delayMax: 400
dopplerMin: -300
dopplerMax: 300
dopplerMin: -1000
dopplerMax: 1000
clutter:
enable: true
delayMin: -10
Expand Down
2 changes: 1 addition & 1 deletion src/process/detection/CfarDetector1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ std::unique_ptr<Detection> CfarDetector1D::process(Map<std::complex<double>> *x)
// The training window and the false-alarm factor depend on the delay bin
// only, not on Doppler, so they are the same for every row. Building them
// once per CPI replaces one heap allocation and one pow() per cell, which at
// the shipped geometry is 123,711 of each.
// the shipped geometry (1001 Doppler x 411 delay bins) is 411,411 of each.
//
// The left window uses k >= 0 like the right one. The original used k > 0,
// silently excluding bin 0 from the left window while including it on the
Expand Down
28 changes: 28 additions & 0 deletions test/unit/process/ambiguity/TestAmbiguity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,34 @@ TEST_CASE("Constructor_Round", "[constructor]")
CHECK(ambiguity.get_nfft() == 6750);
}

/// @brief Test constructor at the shipped geometry, +/-1000 Hz.
/// @details The span every node runs (retina-node's default.yml, mirrored in
/// config/config.yml for standalone use). 2 Hz bins give 1001 Doppler bins and
/// nCorr 999, and the delay window must fit inside nCorr. The FFT length rounds
/// 1997 up to 2000 = 2^4 * 5^3.
TEST_CASE("Constructor_Round_Shipped", "[constructor]")
{
int32_t delayMin{-10};
int32_t delayMax{400};
int32_t dopplerMin{-1000};
int32_t dopplerMax{1000};

uint32_t fs{2'000'000};
float tCpi{0.5};
uint32_t nSamples = tCpi * fs; // narrow on purpose

Ambiguity ambiguity(delayMin, delayMax, dopplerMin,
dopplerMax, fs, nSamples, true);

CHECK_THAT(ambiguity.get_cpi(), Catch::Matchers::WithinAbs(tCpi, 0.02));
CHECK(ambiguity.get_doppler_middle() == 0);
CHECK(ambiguity.get_n_corr() == 999);
CHECK(ambiguity.get_n_delay_bins() == 411);
CHECK(ambiguity.get_n_delay_bins() < ambiguity.get_n_corr());
CHECK(ambiguity.get_n_doppler_bins() == 1001);
CHECK(ambiguity.get_nfft() == 2000);
}

/// @brief Test simple ambiguity processing.
TEST_CASE("Process_Simple", "[process]")
{
Expand Down
Loading