libosmodsp 0.4.0.12-f6f4 Osmocom DSP library

cxvec.h
Go to the documentation of this file.
1/*
2 * cxvec.h
3 *
4 * Complex vectors handling
5 *
6 * Copyright (C) 2011 Sylvain Munaut <tnt@246tNt.com>
7 *
8 * All Rights Reserved
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 */
24
25#ifndef __OSMO_DSP_CXVEC_H__
26#define __OSMO_DSP_CXVEC_H__
27
36#include <complex.h>
37
38#define CXVEC_FLG_REAL_ONLY (1<<0)
41 struct osmo_cxvec {
42 int len;
43 int max_len;
44 int flags;
45 float complex *data;
46 float complex _data[0];
47};
48
49void
50 osmo_cxvec_init_from_data(struct osmo_cxvec *cv,
51 float complex *data, int len);
52
53struct osmo_cxvec *
54 osmo_cxvec_alloc_from_data(float complex *data, int len);
55
56struct osmo_cxvec *
57 osmo_cxvec_alloc(int max_len);
58
59void
60 osmo_cxvec_free(struct osmo_cxvec *cv);
61
62void
63 osmo_cxvec_dbg_dump(struct osmo_cxvec *cv, const char *fname);
64
67#endif /* __OSMO_DSP_CXVEC_H__ */
osmo_cxvec_alloc_from_data
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
osmo_cxvec_dbg_dump
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
osmo_cxvec_alloc
struct osmo_cxvec * osmo_cxvec_alloc(int max_len)
Allocate a complex vector of a given maximum length.
Definition: cxvec.c:83
osmo_cxvec_init_from_data
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
osmo_cxvec_free
void osmo_cxvec_free(struct osmo_cxvec *cv)
Free a complex vector (and possibly associated data)
Definition: cxvec.c:109
osmo_cxvec
Complex vector.
Definition: cxvec.h:41
osmo_cxvec::len
int len
Valid length.
Definition: cxvec.h:42
osmo_cxvec::max_len
int max_len
Maximum length in data field.
Definition: cxvec.h:43
osmo_cxvec::_data
float complex _data[0]
Optional inline data array.
Definition: cxvec.h:46
osmo_cxvec::flags
int flags
Flags, see CXVEC_FLG_xxx.
Definition: cxvec.h:44
osmo_cxvec::data
float complex * data
Data field.
Definition: cxvec.h:45