2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2014-03-03 11:09:26 -08:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2014-03-03 11:09:26 -08:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
2014-03-03 11:09:26 -08:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* 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.
|
2014-03-03 11:09:26 -08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-04-03 05:49:12 -07:00
|
|
|
/******************************************************************************
|
|
|
|
* File: interp.h
|
|
|
|
*
|
|
|
|
* Description: Linear and vector interpolation
|
|
|
|
*
|
|
|
|
* Reference:
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSLTE_INTERP_H
|
|
|
|
#define SRSLTE_INTERP_H
|
2014-07-21 07:19:17 -07:00
|
|
|
|
2016-04-21 07:26:28 -07:00
|
|
|
#include <stdbool.h>
|
2019-12-16 07:04:22 -08:00
|
|
|
#include <stdint.h>
|
2014-06-13 04:42:29 -07:00
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2014-03-03 11:09:26 -08:00
|
|
|
|
2014-11-11 10:20:09 -08:00
|
|
|
/************* STATIC LINEAR INTERPOLATION FUNCTIONS */
|
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API cf_t srslte_interp_linear_onesample(cf_t input0, cf_t input1);
|
2014-11-11 10:20:09 -08:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API cf_t srslte_interp_linear_onesample_cabs(cf_t input0, cf_t input1);
|
2014-11-11 10:20:09 -08:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API void srslte_interp_linear_offset_cabs(cf_t* input,
|
|
|
|
cf_t* output,
|
|
|
|
uint32_t M,
|
|
|
|
uint32_t len,
|
|
|
|
uint32_t off_st,
|
2015-03-18 11:14:24 -07:00
|
|
|
uint32_t off_end);
|
2014-11-11 10:20:09 -08:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API void srslte_interp_linear_f(float* input, float* output, uint32_t M, uint32_t len);
|
2014-11-11 10:20:09 -08:00
|
|
|
|
|
|
|
/* Interpolation between vectors */
|
|
|
|
|
|
|
|
typedef struct {
|
2019-12-16 07:04:22 -08:00
|
|
|
cf_t* diff_vec;
|
2017-09-01 04:29:11 -07:00
|
|
|
uint32_t vector_len;
|
|
|
|
uint32_t max_vector_len;
|
2015-03-18 11:14:24 -07:00
|
|
|
} srslte_interp_linsrslte_vec_t;
|
2014-07-21 07:19:17 -07:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API int srslte_interp_linear_vector_init(srslte_interp_linsrslte_vec_t* q, uint32_t vector_len);
|
|
|
|
|
|
|
|
SRSLTE_API void srslte_interp_linear_vector_free(srslte_interp_linsrslte_vec_t* q);
|
|
|
|
|
|
|
|
SRSLTE_API int srslte_interp_linear_vector_resize(srslte_interp_linsrslte_vec_t* q, uint32_t vector_len);
|
|
|
|
|
|
|
|
SRSLTE_API void srslte_interp_linear_vector(srslte_interp_linsrslte_vec_t* q,
|
|
|
|
cf_t* in0,
|
|
|
|
cf_t* in1,
|
|
|
|
cf_t* between,
|
|
|
|
uint32_t in1_in0_d,
|
|
|
|
uint32_t M);
|
|
|
|
|
|
|
|
SRSLTE_API void srslte_interp_linear_vector2(srslte_interp_linsrslte_vec_t* q,
|
|
|
|
cf_t* in0,
|
|
|
|
cf_t* in1,
|
|
|
|
cf_t* start,
|
|
|
|
cf_t* between,
|
|
|
|
uint32_t in1_in0_d,
|
|
|
|
uint32_t M);
|
|
|
|
|
|
|
|
SRSLTE_API void srslte_interp_linear_vector3(srslte_interp_linsrslte_vec_t* q,
|
|
|
|
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);
|
2014-11-05 05:19:35 -08:00
|
|
|
|
2014-11-11 10:20:09 -08:00
|
|
|
/* Interpolation within a vector */
|
|
|
|
|
|
|
|
typedef struct {
|
2019-12-16 07:04:22 -08:00
|
|
|
cf_t* diff_vec;
|
|
|
|
cf_t* diff_vec2;
|
|
|
|
float* ramp;
|
|
|
|
uint32_t vector_len;
|
2017-09-01 04:29:11 -07:00
|
|
|
uint32_t M;
|
|
|
|
uint32_t max_vector_len;
|
|
|
|
uint32_t max_M;
|
2015-03-18 05:41:50 -07:00
|
|
|
} srslte_interp_lin_t;
|
2014-11-11 10:20:09 -08:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API int srslte_interp_linear_init(srslte_interp_lin_t* q, uint32_t vector_len, uint32_t M);
|
2014-11-11 10:20:09 -08:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API void srslte_interp_linear_free(srslte_interp_lin_t* q);
|
2017-09-01 04:29:11 -07:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API int srslte_interp_linear_resize(srslte_interp_lin_t* q, uint32_t vector_len, uint32_t M);
|
2014-07-21 07:19:17 -07:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
SRSLTE_API void
|
|
|
|
srslte_interp_linear_offset(srslte_interp_lin_t* q, cf_t* input, cf_t* output, uint32_t off_st, uint32_t off_end);
|
2014-06-13 04:42:29 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSLTE_INTERP_H
|