Skip to content

Commit

Permalink
Revert "try to compute a channel even if it is as large as the number…
Browse files Browse the repository at this point in the history
… of pilots"

This reverts commit 3a8ac3d.
  • Loading branch information
marenz2569 committed Jan 5, 2025
1 parent 5ed028c commit 6b41870
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,14 @@ find_package(fmt REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(prometheus-cpp CONFIG REQUIRED)
find_package(cpr REQUIRED)
find_package(Armadillo REQUIRED)

include_directories(${ARMADILLO_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/include)

if (NOT NIX_BUILD)
target_link_libraries(tetra-decoder-library cxxopts::cxxopts)
endif()

target_link_libraries(tetra-decoder-library ZLIB::ZLIB fmt::fmt nlohmann_json::nlohmann_json viterbi prometheus-cpp::pull cpr::cpr ${ARMADILLO_LIBRARIES})
target_link_libraries(tetra-decoder-library ZLIB::ZLIB fmt::fmt nlohmann_json::nlohmann_json viterbi prometheus-cpp::pull cpr::cpr)
target_link_libraries(tetra-decoder tetra-decoder-library)
target_link_libraries(tetra-viterbi viterbi)

Expand Down
2 changes: 0 additions & 2 deletions derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
, prometheus-cpp
, curlFull
, libcpr
, armadillo
}:
clangStdenv.mkDerivation {
name = "tetra-decoder";
Expand All @@ -24,7 +23,6 @@ clangStdenv.mkDerivation {
curlFull
prometheus-cpp
libcpr
armadillo
];

cmakeFlags = [ "-DNIX_BUILD=ON" ];
Expand Down
17 changes: 0 additions & 17 deletions src/iq_stream_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "iq_stream_decoder.hpp"
#include "l2/lower_mac.hpp"
#include <armadillo>
#include <memory>

IQStreamDecoder::IQStreamDecoder(
Expand Down Expand Up @@ -95,19 +94,6 @@ std::vector<std::complex<float>> IQStreamDecoder::channel_estimation(std::vector
return stream;
}

static auto solve_channel(const std::vector<std::complex<float>>& pilots,
const FixedQueue<std::complex<float>, 300>& signal_queue, const std::size_t signal_offset)
-> arma::cx_fvec {
auto arma_pilots = arma::cx_fvec(pilots);
auto arma_signal = arma::cx_fvec(pilots.size());
for (auto i = 0; i < arma_signal.size(); i++) {
arma_signal[i] = signal_queue[signal_offset + i];
}
auto arma_conj_pilots = arma::conj(arma_pilots);
auto h_vec = arma::solve(arma_conj_pilots * arma_pilots, arma_conj_pilots * arma::conj(arma_signal));
return h_vec;
}

void IQStreamDecoder::process_complex(std::complex<float> symbol) noexcept {
if (is_uplink_) {
float detectedN;
Expand Down Expand Up @@ -137,9 +123,6 @@ void IQStreamDecoder::process_complex(std::complex<float> symbol) noexcept {
if (detectedX >= SEQUENCE_DETECTION_THRESHOLD) {
// std::cout << "Potential CUB found" << std::endl;

auto channel = solve_channel(training_seq_x_, symbol_buffer_hard_decision_, 44);
std::cout << channel << std::endl;

auto len = 103;

std::vector<uint8_t> bits(len * 2);
Expand Down

0 comments on commit 6b41870

Please sign in to comment.