GNU Radio's TEST Package
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
28/*! \defgroup cxvec Complex vectors
29 * @{
30 */
31
32/*! \file cxvec.h
33 * \brief Osmocom Complex vectors header
34 */
35
36#include <complex.h>
37
38#define CXVEC_FLG_REAL_ONLY (1<<0) /*!< \brief Real values only */
39
40/*! \brief Complex vector */
41struct osmo_cxvec {
42 int len; /*!< \brief Valid length */
43 int max_len; /*!< \brief Maximum length in data field */
44 int flags; /*!< \brief Flags, see CXVEC_FLG_xxx */
45 float complex *data; /*!< \brief Data field */
46 float complex _data[0]; /*!< \brief Optional inline data array */
47};
48
49void
51 float complex *data, int len);
52
53struct osmo_cxvec *
54osmo_cxvec_alloc_from_data(float complex *data, int len);
55
56struct osmo_cxvec *
58
59void
61
62void
63osmo_cxvec_dbg_dump(struct osmo_cxvec *cv, const char *fname);
64
65/*! @} */
66
67#endif /* __OSMO_DSP_CXVEC_H__ */
struct osmo_cxvec * osmo_cxvec_alloc_from_data(float complex *data, int len)
void osmo_cxvec_dbg_dump(struct osmo_cxvec *cv, const char *fname)
struct osmo_cxvec * osmo_cxvec_alloc(int max_len)
void osmo_cxvec_init_from_data(struct osmo_cxvec *cv, float complex *data, int len)
void osmo_cxvec_free(struct osmo_cxvec *cv)
Complex vector.
Definition cxvec.h:41
int len
Valid length.
Definition cxvec.h:42
int max_len
Maximum length in data field.
Definition cxvec.h:43
float complex _data[0]
Optional inline data array.
Definition cxvec.h:46
int flags
Flags, see CXVEC_FLG_xxx.
Definition cxvec.h:44
float complex * data
Data field.
Definition cxvec.h:45