libosmodsp
0.4.0.1-d7d9
Osmocom DSP library
|
Osmocom .cfile helpers header.
More...
Go to the source code of this file.
|
struct | cfile |
| Structure representing a currently mapped .cfile. More...
|
|
Osmocom .cfile helpers header.
@ PEAK_EARLY_LATE
Early-Late balancing around peak.
Definition: cxvec_math.h:116
Processing options for the IQ balance optimization algorithm.
Definition: iqbal.h:62
@ PEAK_WEIGH_WIN_CENTER
Weighted position of the peak centered window.
Definition: cxvec_math.h:114
Complex vector.
Definition: cxvec.h:41
static float _osmo_iqbal_estimate(const float complex *data, int fft_size, int fft_count, struct _iqbal_estimate_state **state_p)
Objectively estimate IQ balance in a given complex buffer.
Definition: iqbal.c:144
int max_len
Maximum length in data field.
Definition: cxvec.h:43
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
fftwf_plan fft_plan
FFTW plan.
Definition: iqbal.c:115
int osmo_iqbal_cxvec_optimize(const struct osmo_cxvec *sig, float *mag, float *phase, const struct osmo_iqbal_opts *opts)
Finds the best IQ balance correction parameters for a given signal.
Definition: iqbal.c:301
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
static void _iqbal_objfn_gradient(struct _iqbal_state *state, float x[2], float v, float grad[2])
Optimization objective function - Gradient estimation.
Definition: iqbal.c:260
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
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
float osmo_iqbal_cxvec_estimate(const struct osmo_cxvec *sig, int fft_size, int fft_count)
Objectively estimate IQ balance in a given complex vector.
Definition: iqbal.c:206
@ CONV_FULL_SPAN
Full span (every possible overlap of f onto g)
Definition: cxvec_math.h:88
void osmo_cxvec_dbg_dump(struct osmo_cxvec *cv, const char *fname)
Save the data contained of a vector into a .cfile for debug.
Definition: cxvec.c:119
Osmocom Complex vectors header.
void osmo_cxvec_init_from_data(struct osmo_cxvec *cv, float complex *data, int len)
Initialize a vector structure with a given data array.
Definition: cxvec.c:48
unsigned int len
Length (in samples) of the data.
Definition: cfile.h:41
int feval
# of function evaluation
Definition: iqbal.c:234
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
const struct osmo_cxvec * org
Original vector.
Definition: iqbal.c:232
float complex * fft
Temporary memory for FFT.
Definition: iqbal.c:114
const struct osmo_iqbal_opts osmo_iqbal_default_opts
Default values for the optimization algorithm.
Definition: iqbal.c:221
int len
Valid length.
Definition: cxvec.h:42
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
Osmocom IQ balance utils header.
int start_at_prev
Use prev values as starting point.
Definition: iqbal.h:66
const struct osmo_iqbal_opts * opts
Options.
Definition: iqbal.c:231
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
struct cfile * cfile_load(const char *filename)
.cfile loader: mmap() the data into memory (read-only)
Definition: cfile.c:50
float complex * data
Data field.
Definition: cxvec.h:45
@ PEAK_WEIGH_WIN
Weigthed position for the max pwr window.
Definition: cxvec_math.h:112
static float _iqbal_objfn_val_gradient(struct _iqbal_state *state, float x[2], float grad[2])
Optimization objective function - Value & Gradient estimation.
Definition: iqbal.c:282
struct osmo_cxvec * osmo_iqbal_cxvec_fix(const struct osmo_cxvec *in, float mag, float phase, struct osmo_cxvec *out)
Apply IQ balance correction to a given complex vector.
Definition: iqbal.c:94
Structure representing a currently mapped .cfile.
Definition: cfile.h:39
Internal state structure for the IQ balance optimization algorithm.
Definition: iqbal.c:230
struct osmo_cxvec * osmo_cxvec_alloc(int max_len)
Allocate a complex vector of a given maximum length.
Definition: cxvec.c:83
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
static float _iqbal_objfn_value(struct _iqbal_state *state, float x[2])
Optimization objective function - Value.
Definition: iqbal.c:244
void cfile_release(struct cfile *cf)
Release all resources associated with a mapped .cfile.
Definition: cfile.c:102
Cache for _osmo_iqbal_estimate when doing lots of calls.
Definition: iqbal.c:113
float complex _data[0]
Optional inline data array.
Definition: cxvec.h:46
int max_iter
Max # iterations per pass.
Definition: iqbal.h:65
int flags
Flags, see CXVEC_FLG_xxx.
Definition: cxvec.h:44
@ CONV_NO_DELAY
Center f sequence on every g sample.
Definition: cxvec_math.h:92
int fft_count
Number of FFT to use.
Definition: iqbal.h:64
osmo_cxvec_peak_alg
Various possible peak finding algorithms.
Definition: cxvec_math.h:110
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
float osmo_iqbal_estimate(const float complex *data, int fft_size, int fft_count)
Objectively estimate IQ balance in a given complex buffer.
Definition: iqbal.c:194
int fft_size
FFT size to use.
Definition: iqbal.h:63
size_t _blen
Length (in bytes) of the data.
Definition: cfile.h:42
@ CONV_OVERLAP_ONLY
Every possible full overlap of f onto g.
Definition: cxvec_math.h:90
Osmocom Complex vectors math header.
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
static void _osmo_iqbal_estimate_release(struct _iqbal_estimate_state *state)
Release a cache object created by _osmo_iqbal_estimate.
Definition: iqbal.c:120
void osmo_iqbal_fix(float complex *out, float complex *in, unsigned int len, float mag, float phase)
Apply IQ balance correction to a given complex buffer.
Definition: iqbal.c:71
struct _iqbal_estimate_state * cache
Cache for estimate func.
Definition: iqbal.c:235
float complex * data
Data array (read only !)
Definition: cfile.h:40
Osmocom .cfile helpers header.
static float osmo_sinc(float x)
Unnormalized sinc function.
Definition: cxvec_math.h:54
struct osmo_cxvec * osmo_cxvec_alloc_from_data(float complex *data, int len)
Allocate a complex vector referencing a given data array.
Definition: cxvec.c:63
struct osmo_cxvec * tmp
Temporary vector.
Definition: iqbal.c:233
void osmo_cxvec_free(struct osmo_cxvec *cv)
Free a complex vector (and possibly associated data)
Definition: cxvec.c:109