mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
4.1 KiB
C
105 lines
4.1 KiB
C
4 years ago
|
/**
|
||
11 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
11 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
11 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
11 years ago
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: interp.h
|
||
|
*
|
||
|
* Description: Linear and vector interpolation
|
||
|
*
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_INTERP_H
|
||
|
#define SRSRAN_INTERP_H
|
||
10 years ago
|
|
||
9 years ago
|
#include <stdbool.h>
|
||
5 years ago
|
#include <stdint.h>
|
||
11 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
11 years ago
|
|
||
10 years ago
|
/************* STATIC LINEAR INTERPOLATION FUNCTIONS */
|
||
|
|
||
4 years ago
|
SRSRAN_API cf_t srsran_interp_linear_onesample(cf_t input0, cf_t input1);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API cf_t srsran_interp_linear_onesample_cabs(cf_t input0, cf_t input1);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_offset_cabs(cf_t* input,
|
||
5 years ago
|
cf_t* output,
|
||
|
uint32_t M,
|
||
|
uint32_t len,
|
||
|
uint32_t off_st,
|
||
10 years ago
|
uint32_t off_end);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_f(float* input, float* output, uint32_t M, uint32_t len);
|
||
10 years ago
|
|
||
|
/* Interpolation between vectors */
|
||
|
|
||
|
typedef struct {
|
||
5 years ago
|
cf_t* diff_vec;
|
||
7 years ago
|
uint32_t vector_len;
|
||
|
uint32_t max_vector_len;
|
||
4 years ago
|
} srsran_interp_linsrsran_vec_t;
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_interp_linear_vector_init(srsran_interp_linsrsran_vec_t* q, uint32_t vector_len);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_vector_free(srsran_interp_linsrsran_vec_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_interp_linear_vector_resize(srsran_interp_linsrsran_vec_t* q, uint32_t vector_len);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_vector(srsran_interp_linsrsran_vec_t* q,
|
||
5 years ago
|
cf_t* in0,
|
||
|
cf_t* in1,
|
||
|
cf_t* between,
|
||
|
uint32_t in1_in0_d,
|
||
|
uint32_t M);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_vector2(srsran_interp_linsrsran_vec_t* q,
|
||
5 years ago
|
cf_t* in0,
|
||
|
cf_t* in1,
|
||
|
cf_t* start,
|
||
|
cf_t* between,
|
||
|
uint32_t in1_in0_d,
|
||
|
uint32_t M);
|
||
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_vector3(srsran_interp_linsrsran_vec_t* q,
|
||
5 years ago
|
cf_t* in0,
|
||
|
cf_t* in1,
|
||
|
cf_t* start,
|
||
|
cf_t* between,
|
||
|
uint32_t in1_in0_d,
|
||
|
uint32_t M,
|
||
|
bool to_right,
|
||
|
uint32_t len);
|
||
10 years ago
|
|
||
10 years ago
|
/* Interpolation within a vector */
|
||
|
|
||
|
typedef struct {
|
||
5 years ago
|
cf_t* diff_vec;
|
||
|
cf_t* diff_vec2;
|
||
|
float* ramp;
|
||
|
uint32_t vector_len;
|
||
7 years ago
|
uint32_t M;
|
||
|
uint32_t max_vector_len;
|
||
|
uint32_t max_M;
|
||
4 years ago
|
} srsran_interp_lin_t;
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_interp_linear_init(srsran_interp_lin_t* q, uint32_t vector_len, uint32_t M);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_interp_linear_free(srsran_interp_lin_t* q);
|
||
7 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_interp_linear_resize(srsran_interp_lin_t* q, uint32_t vector_len, uint32_t M);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API void
|
||
|
srsran_interp_linear_offset(srsran_interp_lin_t* q, cf_t* input, cf_t* output, uint32_t off_st, uint32_t off_end);
|
||
11 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_INTERP_H
|