| RcdMathLib_doc
    Open Source Library  for Linear and Non-linear Algebra | 
 
 
 
Go to the documentation of this file.
   43                                       uint32_t exact_point[])
 
   46         pow((exact_point[0] - ref_point[0]), 2)
 
   47         + pow((exact_point[1] - ref_point[1]),
 
   49         + pow((exact_point[2] - ref_point[2]),
 
   57     for (
int i = 0; i < n; i++) {
 
   58         if (vector == multipath[i]) {
 
   68     for (uint8_t i = 0; i < m; i++) {
 
   69         if (point[0] == ref_matr[i][0] && point[1] == ref_matr[i][1]
 
   70             && point[2] == ref_matr[i][2]) {
 
   89     for (
int i = 0; i < m; i++) {
 
   93         if (
is_member(i + 1, n, multipath) == 
true) {
 
  104         r_noised_vec[i] = R + d;
 
  109                                     matrix_t ref_matrix[anchors_num][3],
 
  111                                     uint8_t optimal_anchors_comb[k],
 
  112                                     matrix_t opt_partial_ref_matrix[k][3])
 
  114     for (
int i = 0; i < k; i++) {
 
  115         for (
int j = 0; j < 3; j++) {
 
  116             opt_partial_ref_matrix[i][j] =
 
  117                 ref_matrix[optimal_anchors_comb[i]][j];
 
  124                                       uint8_t optimal_anchors_comb[k],
 
  127     for (
int i = 0; i < k; i++) {
 
  128         opt_sub_r_noised_vec[i] = r_noised_vec[optimal_anchors_comb[i]];
 
  135                               uint8_t anchors_optimal_combi[k],
 
  139     uint8_t combi_arr[k];
 
  143     uint8_t index_vector[k];
 
  152                 "Error: couldn't initialize the combination generator\n");
 
  159                                        part_opt_ref_matrix);
 
  162                                          opt_part_r_noised_vec);
 
  171         for (
int i = 0; i < m; i++) {
 
  173             vector_sub(3, pos_solution_x1 + 1, ref_matrix[i],
 
  191         for (
int i = 0; i < k; i++) {
 
  192             res_vec_copy_sum = res_vec_copy_sum
 
  193                                + residual_vec_copy[i];
 
  196         if (res_vec_copy_sum <= qres_optimal) {
 
  197             qres_optimal = res_vec_copy_sum;
 
  198             memcpy(anchors_optimal_combi, index_vector,
 
  199                    k * 
sizeof(uint8_t));
 
  200             vector_copy(3, pos_solution_x1 + 1, start_optimal_pos);
 
  
 
vector_t vector_get_norm2(uint8_t length, vector_t arr[])
Compute the 2-norm norm of a vector.
Implement the trilateration algorithm.
bool is_member(matrix_t vector, uint8_t n, matrix_t multipath[n])
Determine if a candidate is a multipath or not.
void shell_sort(vector_t *arr, uint8_t length)
Sort a data set of type utils_t by using the Shell sort algorithm.
void vector_square(uint8_t n, vector_t vec[n], vector_t square_vec[n])
Compute the square of a vector.
Functions of distance-based localization systems.
double get_rand_num(int seed)
Generate uniform (0.0, 1.0) random numbers by using the Linear Congruential Generator (LGC) algorithm...
Implement the Multipath Distance Detection and Mitigation (MDDM) algorithm.
void vector_get_index_vector(uint8_t k, uint8_t n, vector_t unsorted_vector[n], vector_t sorted_vector[n], uint8_t index_vector[n])
Determine the index of the vector elements before sorting.
void recog_mitigate_multipath(uint8_t k, uint8_t m, matrix_t ref_matrix[m][3], matrix_t noised_r_vec[m], uint8_t anchors_optimal_combi[k], matrix_t start_optimal_pos[3])
Implement the Multipath Distance Detection and Mitigation (MDDM) algorithm.
matrix_t get_exact_distance_to_anchor(matrix_t ref_point[], uint32_t exact_point[])
Computes the exact distance between a mobile station and a reference station.
void sim_UWB_dist(uint8_t m, matrix_t ref_matrix[m][3], uint32_t exact_point[], matrix_t sigma, uint8_t n, matrix_t multipath[n], int seed, matrix_t r_noised_vec[])
Simulate an UWB-based localization system.
#define COMBI_ERROR
Case of an error.
Calculate possible  without repetition in ascending order.
void vector_copy(uint8_t size, vector_t src_arr[], vector_t dest_arr[])
Copy the elements of the source vector to the destination vector.
double get_norm_distr_rand_num(double mean, double std_dev)
Get a normally distributed random number by applying the Box–Muller method.
void trilateration2(uint8_t anchor_num, matrix_t anchor_pos_matrix[anchor_num][3], matrix_t dist_arr[], matrix_t solution_x1[], matrix_t solution_x2[])
Implement the trilateration algorithm.
#define COMBI_SUCCESS
Case of successfully calculated combination set.
#define matrix_t
Define the data type of the matrix elements.
bool is_anchor(uint8_t m, matrix_t ref_matr[m][3], uint32_t point[3])
Determine if a point is an anchor or not.
void get_optimal_partial_r_noised_vec(uint8_t k, matrix_t r_noised_vec[], uint8_t optimal_anchors_comb[k], matrix_t opt_sub_r_noised_vec[k])
Compute noised distances corresponding to the optimal partial matrix.
Generating normally distributed random numbers.
Implement the Shell sort algorithm.
uint8_t combinatorics_init(uint8_t n, uint8_t k, uint8_t comb_arr[])
Initialize the combinations generator.
Compute the Position Dilution of Precision (PDOP).
uint8_t combinatorics_get_next_without_rep(uint8_t n, uint8_t k, uint8_t comb_arr[])
Generate the next combination.
void get_optimal_partial_ref_matrix(uint8_t anchors_num, matrix_t ref_matrix[anchors_num][3], uint8_t k, uint8_t optimal_anchors_comb[k], matrix_t opt_partial_ref_matrix[k][3])
Compute the optimal partial matrix including reference points.
void vector_sub(uint8_t size, vector_t a_vec[], vector_t b_vec[], vector_t a_minus_b[])
Compute the subtraction of two vectors.