\doxysection{Complex vectors} \label{group__cxvec}\index{Complex vectors@{Complex vectors}} \doxysubsection*{Modules} \begin{DoxyCompactItemize} \item \textbf{ Complex vectors math and signal processing} \end{DoxyCompactItemize} \doxysubsection*{Files} \begin{DoxyCompactItemize} \item file \textbf{ cxvec.\+h} \begin{DoxyCompactList}\small\item\em Osmocom Complex vectors header. \end{DoxyCompactList}\item file \textbf{ cxvec.\+c} \begin{DoxyCompactList}\small\item\em Osmocom Complex vectors implementation. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Data Structures} \begin{DoxyCompactItemize} \item struct \textbf{ osmo\+\_\+cxvec} \begin{DoxyCompactList}\small\item\em Complex vector. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item void \textbf{ osmo\+\_\+cxvec\+\_\+init\+\_\+from\+\_\+data} (struct \textbf{ osmo\+\_\+cxvec} $\ast$cv, float complex $\ast$data, int len) \begin{DoxyCompactList}\small\item\em Initialize a vector structure with a given data array. \end{DoxyCompactList}\item struct \textbf{ osmo\+\_\+cxvec} $\ast$ \textbf{ osmo\+\_\+cxvec\+\_\+alloc\+\_\+from\+\_\+data} (float complex $\ast$data, int len) \begin{DoxyCompactList}\small\item\em Allocate a complex vector referencing a given data array. \end{DoxyCompactList}\item struct \textbf{ osmo\+\_\+cxvec} $\ast$ \textbf{ osmo\+\_\+cxvec\+\_\+alloc} (int max\+\_\+len) \begin{DoxyCompactList}\small\item\em Allocate a complex vector of a given maximum length. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+cxvec\+\_\+free} (struct \textbf{ osmo\+\_\+cxvec} $\ast$cv) \begin{DoxyCompactList}\small\item\em Free a complex vector (and possibly associated data) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+cxvec\+\_\+dbg\+\_\+dump} (struct \textbf{ osmo\+\_\+cxvec} $\ast$cv, const char $\ast$fname) \begin{DoxyCompactList}\small\item\em Save the data contained of a vector into a .cfile for debug. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} \doxysubsection{Function Documentation} \mbox{\label{group__cxvec_ga9461ac13f1d77ca832b140461e599caa}} \index{Complex vectors@{Complex vectors}!osmo\_cxvec\_alloc@{osmo\_cxvec\_alloc}} \index{osmo\_cxvec\_alloc@{osmo\_cxvec\_alloc}!Complex vectors@{Complex vectors}} \doxysubsubsection{osmo\_cxvec\_alloc()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+cxvec} $\ast$ osmo\+\_\+cxvec\+\_\+alloc (\begin{DoxyParamCaption}\item[{int}]{max\+\_\+len }\end{DoxyParamCaption})} Allocate a complex vector of a given maximum length. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em max\+\_\+len} & Maximum length of data\\ \hline \end{DoxyParams} Data array is allocated along with the structure, but is uninitialized. Length is set to 0. References \textbf{ osmo\+\_\+cxvec\+::\+\_\+data}, \textbf{ osmo\+\_\+cxvec\+::data}, \textbf{ osmo\+\_\+cxvec\+::flags}, \textbf{ osmo\+\_\+cxvec\+::len}, and \textbf{ osmo\+\_\+cxvec\+::max\+\_\+len}. Referenced by \textbf{ osmo\+\_\+cxvec\+\_\+convolve()}, \textbf{ osmo\+\_\+cxvec\+\_\+correlate()}, \textbf{ osmo\+\_\+cxvec\+\_\+delay()}, \textbf{ osmo\+\_\+cxvec\+\_\+rotate()}, \textbf{ osmo\+\_\+cxvec\+\_\+scale()}, \textbf{ osmo\+\_\+cxvec\+\_\+sig\+\_\+normalize()}, \textbf{ osmo\+\_\+iqbal\+\_\+cxvec\+\_\+fix()}, and \textbf{ osmo\+\_\+iqbal\+\_\+cxvec\+\_\+optimize()}. \mbox{\label{group__cxvec_ga4edecda809e91f11cf88b53a1db8d62a}} \index{Complex vectors@{Complex vectors}!osmo\_cxvec\_alloc\_from\_data@{osmo\_cxvec\_alloc\_from\_data}} \index{osmo\_cxvec\_alloc\_from\_data@{osmo\_cxvec\_alloc\_from\_data}!Complex vectors@{Complex vectors}} \doxysubsubsection{osmo\_cxvec\_alloc\_from\_data()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+cxvec} $\ast$ osmo\+\_\+cxvec\+\_\+alloc\+\_\+from\+\_\+data (\begin{DoxyParamCaption}\item[{float complex $\ast$}]{data, }\item[{int}]{len }\end{DoxyParamCaption})} Allocate a complex vector referencing a given data array. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em data} & Pointer to the complex data array \\ \hline \mbox{\texttt{ in}} & {\em len} & Number of complex samples\\ \hline \end{DoxyParams} The data is not copied, it is just referenced. References \textbf{ osmo\+\_\+cxvec\+::data}, \textbf{ osmo\+\_\+cxvec\+::len}, and \textbf{ osmo\+\_\+cxvec\+\_\+init\+\_\+from\+\_\+data()}. \mbox{\label{group__cxvec_ga69e6d1ea3d468954cedf7d6f8d44f825}} \index{Complex vectors@{Complex vectors}!osmo\_cxvec\_dbg\_dump@{osmo\_cxvec\_dbg\_dump}} \index{osmo\_cxvec\_dbg\_dump@{osmo\_cxvec\_dbg\_dump}!Complex vectors@{Complex vectors}} \doxysubsubsection{osmo\_cxvec\_dbg\_dump()} {\footnotesize\ttfamily void osmo\+\_\+cxvec\+\_\+dbg\+\_\+dump (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{cv, }\item[{const char $\ast$}]{fname }\end{DoxyParamCaption})} Save the data contained of a vector into a .cfile for debug. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cv} & Complex vector to save \\ \hline \mbox{\texttt{ in}} & {\em fname} & Filename to save the data to \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+cxvec\+::data}, and \textbf{ osmo\+\_\+cxvec\+::len}. \mbox{\label{group__cxvec_gaa57240ff2299122f9375e901b9700e7d}} \index{Complex vectors@{Complex vectors}!osmo\_cxvec\_free@{osmo\_cxvec\_free}} \index{osmo\_cxvec\_free@{osmo\_cxvec\_free}!Complex vectors@{Complex vectors}} \doxysubsubsection{osmo\_cxvec\_free()} {\footnotesize\ttfamily void osmo\+\_\+cxvec\+\_\+free (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{cv }\end{DoxyParamCaption})} Free a complex vector (and possibly associated data) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cv} & Complex vector to free\\ \hline \end{DoxyParams} Notes\+: -\/ Can be safely called with NULL \begin{DoxyItemize} \item If the data was allocated with the vector using \doxyref{osmo\+\_\+cxvec\+\_\+alloc}{p.}{group__cxvec_ga9461ac13f1d77ca832b140461e599caa} , it will be free as well. If the data was pre-\/existing ( \doxyref{osmo\+\_\+cxvec\+\_\+init\+\_\+from\+\_\+data}{p.}{group__cxvec_gaa03ae6bbc24d094b8955d905832f0c36} or \doxyref{osmo\+\_\+cxvec\+\_\+alloc\+\_\+from\+\_\+data}{p.}{group__cxvec_ga4edecda809e91f11cf88b53a1db8d62a} ) it will not be free\textquotesingle{}d. \end{DoxyItemize} Referenced by \textbf{ osmo\+\_\+cxvec\+\_\+delay()}, and \textbf{ osmo\+\_\+iqbal\+\_\+cxvec\+\_\+optimize()}. \mbox{\label{group__cxvec_gaa03ae6bbc24d094b8955d905832f0c36}} \index{Complex vectors@{Complex vectors}!osmo\_cxvec\_init\_from\_data@{osmo\_cxvec\_init\_from\_data}} \index{osmo\_cxvec\_init\_from\_data@{osmo\_cxvec\_init\_from\_data}!Complex vectors@{Complex vectors}} \doxysubsubsection{osmo\_cxvec\_init\_from\_data()} {\footnotesize\ttfamily void osmo\+\_\+cxvec\+\_\+init\+\_\+from\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{cv, }\item[{float complex $\ast$}]{data, }\item[{int}]{len }\end{DoxyParamCaption})} Initialize a vector structure with a given data array. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ out}} & {\em cv} & The vector to be initialized \\ \hline \mbox{\texttt{ in}} & {\em data} & Pointer to the complex data array \\ \hline \mbox{\texttt{ in}} & {\em len} & Number of complex samples\\ \hline \end{DoxyParams} The data is not copied, it is just referenced. References \textbf{ osmo\+\_\+cxvec\+::data}, \textbf{ osmo\+\_\+cxvec\+::flags}, \textbf{ osmo\+\_\+cxvec\+::len}, and \textbf{ osmo\+\_\+cxvec\+::max\+\_\+len}. Referenced by \textbf{ osmo\+\_\+cxvec\+\_\+alloc\+\_\+from\+\_\+data()}, and \textbf{ osmo\+\_\+cxvec\+\_\+delay()}.