\section{Complex vectors}
\label{group__cxvec}\index{Complex vectors@{Complex vectors}}
\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\textbf{ Complex vectors math and signal processing}
\end{DoxyCompactItemize}
\subsection*{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}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+cxvec}
\begin{DoxyCompactList}\small\item\em Complex vector. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{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}


\subsection{Detailed Description}


\subsection{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}}
\subsubsection{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{\tt 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 osmo\+\_\+cxvec\+::\+\_\+data, osmo\+\_\+cxvec\+::data, osmo\+\_\+cxvec\+::flags, osmo\+\_\+cxvec\+::len, and osmo\+\_\+cxvec\+::max\+\_\+len.



Referenced by osmo\+\_\+cxvec\+\_\+convolve(), osmo\+\_\+cxvec\+\_\+correlate(), osmo\+\_\+cxvec\+\_\+delay(), osmo\+\_\+cxvec\+\_\+rotate(), osmo\+\_\+cxvec\+\_\+scale(), osmo\+\_\+cxvec\+\_\+sig\+\_\+normalize(), osmo\+\_\+iqbal\+\_\+cxvec\+\_\+fix(), and 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}}
\subsubsection{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{\tt in}  & {\em data} & Pointer to the complex data array \\
\hline
\mbox{\tt in}  & {\em len} & Number of complex samples\\
\hline
\end{DoxyParams}
The data is not copied, it is just referenced. 

References 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}}
\subsubsection{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{\tt in}  & {\em cv} & Complex vector to save \\
\hline
\mbox{\tt in}  & {\em fname} & Filename to save the data to \\
\hline
\end{DoxyParams}


References osmo\+\_\+cxvec\+::data, and 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}}
\subsubsection{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{\tt in}  & {\em cv} & Complex vector to free\\
\hline
\end{DoxyParams}
Notes\+: -\/ Can be safely called with N\+U\+LL
\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 osmo\+\_\+cxvec\+\_\+delay(), and 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}}
\subsubsection{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{\tt out}  & {\em cv} & The vector to be initialized \\
\hline
\mbox{\tt in}  & {\em data} & Pointer to the complex data array \\
\hline
\mbox{\tt in}  & {\em len} & Number of complex samples\\
\hline
\end{DoxyParams}
The data is not copied, it is just referenced. 

References osmo\+\_\+cxvec\+::data, osmo\+\_\+cxvec\+::flags, osmo\+\_\+cxvec\+::len, and osmo\+\_\+cxvec\+::max\+\_\+len.



Referenced by osmo\+\_\+cxvec\+\_\+alloc\+\_\+from\+\_\+data(), and osmo\+\_\+cxvec\+\_\+delay().

