25#ifndef __OSMO_DSP_CXVEC_MATH_H__
26#define __OSMO_DSP_CXVEC_MATH_H__
45#define M_PIf (3.14159265358979323846264338327f)
56 if ((x >= 0.01f) || (x <= -0.01f))
return (sinf(x)/x);
67 return crealf(c) * crealf(c) + cimagf(c) * cimagf(c);
122 float complex *peak_val_p);
126 int decim,
float freq_shift,
Osmocom Complex vectors header.
static float osmo_normsqf(float complex c)
Squared norm of a given complex.
Definition: cxvec_math.h:65
osmo_cxvec_conv_type
Various possible types of convolution span.
Definition: cxvec_math.h:86
struct osmo_cxvec * osmo_cxvec_convolve(const struct osmo_cxvec *f, const struct osmo_cxvec *g, enum osmo_cxvec_conv_type type, struct osmo_cxvec *out)
Convolve two complex vectors.
Definition: cxvec_math.c:228
struct osmo_cxvec * osmo_cxvec_sig_normalize(const struct osmo_cxvec *sig, int decim, float freq_shift, struct osmo_cxvec *out)
'Normalize' an IQ signal and apply decimation/frequency shift
Definition: cxvec_math.c:613
struct osmo_cxvec * osmo_cxvec_rotate(const struct osmo_cxvec *in, float freq_shift, struct osmo_cxvec *out)
Rotate a complex vector (frequency shift)
Definition: cxvec_math.c:112
float osmo_cxvec_peak_energy_find(const struct osmo_cxvec *cv, int win_size, enum osmo_cxvec_peak_alg alg, float complex *peak_val_p)
Find the maximum energy ( ) peak in a sequence.
Definition: cxvec_math.c:484
static float osmo_sinc(float x)
Unnormalized sinc function.
Definition: cxvec_math.h:54
struct osmo_cxvec * osmo_cxvec_scale(const struct osmo_cxvec *in, float complex scale, struct osmo_cxvec *out)
Scale a complex vector (multiply by a constant)
Definition: cxvec_math.c:55
osmo_cxvec_peak_alg
Various possible peak finding algorithms.
Definition: cxvec_math.h:110
struct osmo_cxvec * osmo_cxvec_correlate(const struct osmo_cxvec *f, const struct osmo_cxvec *g, int g_corr_step, struct osmo_cxvec *out)
Cross-correlate two complex vectors.
Definition: cxvec_math.c:335
struct osmo_cxvec * osmo_cxvec_delay(const struct osmo_cxvec *v, float delay, struct osmo_cxvec *out)
Fractionally delay a vector while maintaining its length.
Definition: cxvec_math.c:146
float complex osmo_cxvec_interpolate_point(const struct osmo_cxvec *cv, float pos)
Interpolate any fractional position in a vector using sinc filtering.
Definition: cxvec_math.c:399
int osmo_cxvec_peaks_scan(const struct osmo_cxvec *cv, int *peaks_idx, int N)
Find the index of the N highest energy ( ) peaks.
Definition: cxvec_math.c:438
@ CONV_NO_DELAY
Center f sequence on every g sample.
Definition: cxvec_math.h:92
@ CONV_OVERLAP_ONLY
Every possible full overlap of f onto g.
Definition: cxvec_math.h:90
@ CONV_FULL_SPAN
Full span (every possible overlap of f onto g)
Definition: cxvec_math.h:88
@ PEAK_EARLY_LATE
Early-Late balancing around peak.
Definition: cxvec_math.h:116
@ PEAK_WEIGH_WIN_CENTER
Weighted position of the peak centered window.
Definition: cxvec_math.h:114
@ PEAK_WEIGH_WIN
Weigthed position for the max pwr window.
Definition: cxvec_math.h:112
Complex vector.
Definition: cxvec.h:41