\doxysection{FCCH bursts}
\label{group__fcch}\index{FCCH bursts@{FCCH bursts}}
\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ fcch.\+h}
\begin{DoxyCompactList}\small\item\em Osmocom GMR-\/1 FCCH bursts header. \end{DoxyCompactList}\item 
file \textbf{ fcch.\+c}
\begin{DoxyCompactList}\small\item\em Osmocom GMR-\/1 FCCH bursts implementation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ gmr1\+\_\+fcch\+\_\+burst}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ gmr1\+\_\+fcch\+\_\+rough} (const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$burst\+\_\+type, struct \textbf{ osmo\+\_\+cxvec} $\ast$search\+\_\+win\+\_\+in, int sps, float freq\+\_\+shift, int $\ast$toa)
\begin{DoxyCompactList}\small\item\em Rough FCCH timing acquisition. \end{DoxyCompactList}\item 
int \textbf{ gmr1\+\_\+fcch\+\_\+rough\+\_\+multi} (const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$burst\+\_\+type, struct \textbf{ osmo\+\_\+cxvec} $\ast$search\+\_\+win\+\_\+in, int sps, float freq\+\_\+shift, int $\ast$peaks\+\_\+toa, int N)
\begin{DoxyCompactList}\small\item\em Rough FCCH timing acquisition w/ multiple FCCH detection. \end{DoxyCompactList}\item 
int \textbf{ gmr1\+\_\+fcch\+\_\+fine} (const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$burst\+\_\+type, struct \textbf{ osmo\+\_\+cxvec} $\ast$burst\+\_\+in, int sps, float freq\+\_\+shift, int $\ast$toa, float $\ast$freq\+\_\+error)
\begin{DoxyCompactList}\small\item\em Fine FCCH timing \& frequency acquisition. \end{DoxyCompactList}\item 
int \textbf{ gmr1\+\_\+fcch\+\_\+snr} (const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$burst\+\_\+type, struct \textbf{ osmo\+\_\+cxvec} $\ast$burst\+\_\+in, int sps, float freq\+\_\+shift, float $\ast$snr)
\begin{DoxyCompactList}\small\item\em SNR estimation on a FCCH burst. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{group__fcch_ga09ca32ce9f0bbe6d6d5b7977aae2758f}} 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} {\bfseries gmr1\+\_\+fcch\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH burst (GMR-\/1 version) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+1. \end{DoxyCompactList}\item 
\mbox{\label{group__fcch_ga6598bb31a09a997eaa079838babc2f25}} 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} {\bfseries gmr1\+\_\+fcch3\+\_\+lband\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH3 L-\/band burst (GMR-\/1 3G version for L-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+1. \end{DoxyCompactList}\item 
\mbox{\label{group__fcch_ga20cea569bd20f7c7a3b14420c9301b1b}} 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} {\bfseries gmr1\+\_\+fcch3\+\_\+sband\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH3 S-\/band burst (GMR-\/1 3G version for S-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+2. \end{DoxyCompactList}\item 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} \textbf{ gmr1\+\_\+fcch\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH burst (GMR-\/1 version) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+1. \end{DoxyCompactList}\item 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} \textbf{ gmr1\+\_\+fcch3\+\_\+lband\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH3 L-\/band burst (GMR-\/1 3G version for L-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+1. \end{DoxyCompactList}\item 
const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} \textbf{ gmr1\+\_\+fcch3\+\_\+sband\+\_\+burst}
\begin{DoxyCompactList}\small\item\em FCCH3 S-\/band burst (GMR-\/1 3G version for S-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+2. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Function Documentation}
\mbox{\label{group__fcch_ga2b1c8329ac1c8cae7414d2ca4619f17f}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch\_fine@{gmr1\_fcch\_fine}}
\index{gmr1\_fcch\_fine@{gmr1\_fcch\_fine}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch\_fine()}
{\footnotesize\ttfamily int gmr1\+\_\+fcch\+\_\+fine (\begin{DoxyParamCaption}\item[{const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$}]{burst\+\_\+type,  }\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{burst\+\_\+in,  }\item[{int}]{sps,  }\item[{float}]{freq\+\_\+shift,  }\item[{int $\ast$}]{toa,  }\item[{float $\ast$}]{freq\+\_\+error }\end{DoxyParamCaption})}



Fine FCCH timing \& frequency acquisition. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em burst\+\_\+type} & FCCH burst format description \\
\hline
\mbox{\texttt{ in}}  & {\em burst\+\_\+in} & Complex signal of the FCCH burst \\
\hline
\mbox{\texttt{ in}}  & {\em sps} & Oversampling used in the input complex signal \\
\hline
\mbox{\texttt{ in}}  & {\em freq\+\_\+shift} & Frequency shift to pre-\/apply to burst\+\_\+in (rad/sym) \\
\hline
\mbox{\texttt{ out}}  & {\em toa} & Pointer to the toa return variable \\
\hline
\mbox{\texttt{ out}}  & {\em freq\+\_\+error} & Pointer to the frequency error return variable (rad/sym) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success. -\/errno for errors.
\end{DoxyReturn}
The input vector must be burst\+\_\+type-\/$>$len $\ast$ sps samples long. The frequency error is doesn\textquotesingle{}t include any correction done with freq\+\_\+shift. 

References \textbf{ osmo\+\_\+cxvec\+::len}.

\mbox{\label{group__fcch_ga14e6b77fe05bf2ef7600204ba6818a47}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch\_rough@{gmr1\_fcch\_rough}}
\index{gmr1\_fcch\_rough@{gmr1\_fcch\_rough}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch\_rough()}
{\footnotesize\ttfamily int gmr1\+\_\+fcch\+\_\+rough (\begin{DoxyParamCaption}\item[{const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$}]{burst\+\_\+type,  }\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{search\+\_\+win\+\_\+in,  }\item[{int}]{sps,  }\item[{float}]{freq\+\_\+shift,  }\item[{int $\ast$}]{toa }\end{DoxyParamCaption})}



Rough FCCH timing acquisition. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em burst\+\_\+type} & FCCH burst format description \\
\hline
\mbox{\texttt{ in}}  & {\em search\+\_\+win\+\_\+in} & Complex signal where to search for FCCH \\
\hline
\mbox{\texttt{ in}}  & {\em sps} & Oversampling used in the input complex signal \\
\hline
\mbox{\texttt{ in}}  & {\em freq\+\_\+shift} & Frequency shift to pre-\/apply to search\+\_\+win\+\_\+in (rad/sym) \\
\hline
\mbox{\texttt{ out}}  & {\em toa} & Pointer to the toa return variable \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success. -\/errno for errors.
\end{DoxyReturn}
To be sure to acquire the signal, you need more than a single BCCH period. (so more than 320 ms of signal, plus the fcch length itself) \mbox{\label{group__fcch_ga822f719832670df978c08008c2e7a3df}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch\_rough\_multi@{gmr1\_fcch\_rough\_multi}}
\index{gmr1\_fcch\_rough\_multi@{gmr1\_fcch\_rough\_multi}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch\_rough\_multi()}
{\footnotesize\ttfamily int gmr1\+\_\+fcch\+\_\+rough\+\_\+multi (\begin{DoxyParamCaption}\item[{const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$}]{burst\+\_\+type,  }\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{search\+\_\+win\+\_\+in,  }\item[{int}]{sps,  }\item[{float}]{freq\+\_\+shift,  }\item[{int $\ast$}]{peaks\+\_\+toa,  }\item[{int}]{N }\end{DoxyParamCaption})}



Rough FCCH timing acquisition w/ multiple FCCH detection. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em burst\+\_\+type} & FCCH burst format description \\
\hline
\mbox{\texttt{ in}}  & {\em search\+\_\+win\+\_\+in} & Complex signal where to search for FCCH \\
\hline
\mbox{\texttt{ in}}  & {\em sps} & Oversampling used in the input complex signal \\
\hline
\mbox{\texttt{ in}}  & {\em freq\+\_\+shift} & Frequency shift to pre-\/apply to search\+\_\+win\+\_\+in (rad/sym) \\
\hline
\mbox{\texttt{ out}}  & {\em peaks\+\_\+toa} & Array of floats to store the returned alignements \\
\hline
\mbox{\texttt{ in}}  & {\em N} & Maximum number of alignements to returns \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A positive value of the number of FCCH returned. -\/errno for errors
\end{DoxyReturn}
This method can detect multiple overlapping FCCH and returns alignements for all of them. To do so it needs at least 650 ms worth of data (two SI cycles plus some margin). 

References \textbf{ GMR1\+\_\+\+SYM\+\_\+\+RATE}, and \textbf{ osmo\+\_\+cxvec\+::len}.

\mbox{\label{group__fcch_ga614cf46fe5e868c8b573491736487fba}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch\_snr@{gmr1\_fcch\_snr}}
\index{gmr1\_fcch\_snr@{gmr1\_fcch\_snr}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch\_snr()}
{\footnotesize\ttfamily int gmr1\+\_\+fcch\+\_\+snr (\begin{DoxyParamCaption}\item[{const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} $\ast$}]{burst\+\_\+type,  }\item[{struct \textbf{ osmo\+\_\+cxvec} $\ast$}]{burst\+\_\+in,  }\item[{int}]{sps,  }\item[{float}]{freq\+\_\+shift,  }\item[{float $\ast$}]{snr }\end{DoxyParamCaption})}



SNR estimation on a FCCH burst. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em burst\+\_\+type} & FCCH burst format description \\
\hline
\mbox{\texttt{ in}}  & {\em burst\+\_\+in} & Complex signal of the FCCH burst \\
\hline
\mbox{\texttt{ in}}  & {\em sps} & Oversampling used in the input complex signal \\
\hline
\mbox{\texttt{ in}}  & {\em freq\+\_\+shift} & Frequency shift to pre-\/apply to burst\+\_\+in (rad/sym) \\
\hline
\mbox{\texttt{ out}}  & {\em snr} & Pointer to the SNR return variable \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success. -\/errno for errors.
\end{DoxyReturn}
The input vector must be burst\+\_\+type-\/$>$len $\ast$ sps samples long. This method estimated the FFT peak energy over the FFT average energy to estimate SNR. 

References \textbf{ osmo\+\_\+cxvec\+::len}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__fcch_ga6598bb31a09a997eaa079838babc2f25}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch3\_lband\_burst@{gmr1\_fcch3\_lband\_burst}}
\index{gmr1\_fcch3\_lband\_burst@{gmr1\_fcch3\_lband\_burst}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch3\_lband\_burst}
{\footnotesize\ttfamily const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} gmr1\+\_\+fcch3\+\_\+lband\+\_\+burst}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .freq = 0.32f,}
\DoxyCodeLine{        .len  = 12 * 39,}
\DoxyCodeLine{\}}

\end{DoxyCode}


FCCH3 L-\/band burst (GMR-\/1 3G version for L-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+1. 

\mbox{\label{group__fcch_ga20cea569bd20f7c7a3b14420c9301b1b}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch3\_sband\_burst@{gmr1\_fcch3\_sband\_burst}}
\index{gmr1\_fcch3\_sband\_burst@{gmr1\_fcch3\_sband\_burst}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch3\_sband\_burst}
{\footnotesize\ttfamily const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} gmr1\+\_\+fcch3\+\_\+sband\+\_\+burst}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .freq = 0.16f,}
\DoxyCodeLine{        .len  = 12 * 39,}
\DoxyCodeLine{\}}

\end{DoxyCode}


FCCH3 S-\/band burst (GMR-\/1 3G version for S-\/band) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+2.\+2. 

\mbox{\label{group__fcch_ga09ca32ce9f0bbe6d6d5b7977aae2758f}} 
\index{FCCH bursts@{FCCH bursts}!gmr1\_fcch\_burst@{gmr1\_fcch\_burst}}
\index{gmr1\_fcch\_burst@{gmr1\_fcch\_burst}!FCCH bursts@{FCCH bursts}}
\doxysubsubsection{gmr1\_fcch\_burst}
{\footnotesize\ttfamily const struct \textbf{ gmr1\+\_\+fcch\+\_\+burst} \textbf{ gmr1\+\_\+fcch\+\_\+burst}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .freq = 0.32f,}
\DoxyCodeLine{        .len  = 3 * 39,}
\DoxyCodeLine{\}}

\end{DoxyCode}


FCCH burst (GMR-\/1 version) See GMR-\/1 05.\+004 (ETSI TS 101 376-\/5-\/2 V3.\+1.\+1) -\/ Section 8.\+1. 

