\hypertarget{group__myfft}{}\doxysection{Myfft Library}
\label{group__myfft}\index{Myfft Library@{Myfft Library}}


FFT and filter utilities.  


\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
fftw\+\_\+complex $\ast$ \mbox{\hyperlink{group__myfft_ga9b42daf91bb4c04d6e03295977763829}{make\+Filter}} (size\+\_\+t evalue, size\+\_\+t Array\+Length)
\begin{DoxyCompactList}\small\item\em @ . \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{group__myfft_gabb76bbd993146a1f2ab98871bd802f9e}{fftfit}} (struct \mbox{\hyperlink{structmyarr}{myarr}} input, int $\ast$total, const int $\ast$base, double $\ast$corvalue, fftw\+\_\+complex $\ast$filter\+FFT, int verb, double $\ast$subpos)
\begin{DoxyCompactList}\small\item\em @ shift. \end{DoxyCompactList}\item 
fftw\+\_\+complex $\ast$ \mbox{\hyperlink{group__myfft_gaf4b06d4391b8782061878a3f2983eefa}{convolute}} (struct \mbox{\hyperlink{structmyarr}{myarr}} array, fftw\+\_\+complex $\ast$filter)
\begin{DoxyCompactList}\small\item\em @ frequency domain. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{group__myfft_ga23caf332ea8a813af4290c846ffac166}{getmaxfftw}} (fftw\+\_\+complex $\ast$array, size\+\_\+t Array\+Length)
\begin{DoxyCompactList}\small\item\em @ frequency domain. \end{DoxyCompactList}\item 
fftw\+\_\+complex $\ast$ \mbox{\hyperlink{group__myfft_ga630fc656ef71b4c11b84a83155afa1ca}{crosscor}} (size\+\_\+t Array\+Length, fftw\+\_\+complex $\ast$array, fftw\+\_\+complex $\ast$ref)
\begin{DoxyCompactList}\small\item\em Perform cross-\/correlation between the input array and the reference array in the frequency domain. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__myfft_gac7a82ce7c64ce26d67f5d761261d33c6}{writefftw}} (fftw\+\_\+complex $\ast$arr, size\+\_\+t Array\+Length, const char $\ast$file)
\begin{DoxyCompactList}\small\item\em Write the given array in the frequency domain to a file. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__myfft_ga7ae335353fa1417b04f8e0f92f5d9b11}{remove50hz}} (size\+\_\+t Array\+Length, int $\ast$array, unsigned int rate)
\begin{DoxyCompactList}\small\item\em Remove the 50Hz component from the input array. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__myfft_ga68517c39d07c3d1a670d8b2ff60581ee}{normalise}} (size\+\_\+t Array\+Length, fftw\+\_\+complex $\ast$in\+Data)
\begin{DoxyCompactList}\small\item\em Normalise the input array in the frequency domain. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__myfft_gabe4899260bfe379451c138bfe4f72145}{rescale}} (int $\ast$total, size\+\_\+t Array\+Length)
\begin{DoxyCompactList}\small\item\em Rescale the input array to fit within the range of a 16-\/bit signed integer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__myfft_ga9e7b5003fb81033321cc19879e90c27f}{getshift}} (struct \mbox{\hyperlink{structmyarr}{myarr}} xarr, struct \mbox{\hyperlink{structmyarr}{myarr}} yarr)
\begin{DoxyCompactList}\small\item\em Get the shift between the two input arrays. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
FFT and filter utilities. 



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__myfft_gaf4b06d4391b8782061878a3f2983eefa}\label{group__myfft_gaf4b06d4391b8782061878a3f2983eefa}} 
\index{Myfft Library@{Myfft Library}!convolute@{convolute}}
\index{convolute@{convolute}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{convolute()}{convolute()}}
{\footnotesize\ttfamily fftw\+\_\+complex $\ast$ convolute (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmyarr}{myarr}}}]{array,  }\item[{fftw\+\_\+complex $\ast$}]{filter }\end{DoxyParamCaption})}



@ frequency domain. 


\begin{DoxyParams}{Parameters}
{\em array} & The input array to convolute. \\
\hline
{\em filter} & The filter in the frequency domain to convolute with. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the result of the convolution in the frequency domain. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_ga630fc656ef71b4c11b84a83155afa1ca}\label{group__myfft_ga630fc656ef71b4c11b84a83155afa1ca}} 
\index{Myfft Library@{Myfft Library}!crosscor@{crosscor}}
\index{crosscor@{crosscor}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{crosscor()}{crosscor()}}
{\footnotesize\ttfamily fftw\+\_\+complex $\ast$ crosscor (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{Array\+Length,  }\item[{fftw\+\_\+complex $\ast$}]{array,  }\item[{fftw\+\_\+complex $\ast$}]{ref }\end{DoxyParamCaption})}



Perform cross-\/correlation between the input array and the reference array in the frequency domain. 


\begin{DoxyParams}{Parameters}
{\em Array\+Length} & The length of the input and reference arrays. \\
\hline
{\em array} & The input array in the frequency domain to cross-\/correlate. \\
\hline
{\em ref} & The reference array in the frequency domain to cross-\/correlate with. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the result of the cross-\/correlation in the frequency domain. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_gabb76bbd993146a1f2ab98871bd802f9e}\label{group__myfft_gabb76bbd993146a1f2ab98871bd802f9e}} 
\index{Myfft Library@{Myfft Library}!fftfit@{fftfit}}
\index{fftfit@{fftfit}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{fftfit()}{fftfit()}}
{\footnotesize\ttfamily size\+\_\+t fftfit (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmyarr}{myarr}}}]{input,  }\item[{int $\ast$}]{total,  }\item[{const int $\ast$}]{base,  }\item[{double $\ast$}]{corvalue,  }\item[{fftw\+\_\+complex $\ast$}]{filter\+FFT,  }\item[{int}]{verb,  }\item[{double $\ast$}]{subpos }\end{DoxyParamCaption})}



@ shift. 


\begin{DoxyParams}{Parameters}
{\em input} & The input array to fit. \\
\hline
{\em total} & A pointer to an integer where the total shift will be stored. \\
\hline
{\em base} & A pointer to an integer where the base shift will be stored. \\
\hline
{\em corvalue} & A pointer to a double where the correlation value will be stored. \\
\hline
{\em filter\+FFT} & The filter in the frequency domain. \\
\hline
{\em verb} & An integer indicating whether to print verbose output (1 for yes, 0 for no). \\
\hline
{\em subpos} & A pointer to a double where the subpixel position will be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The total shift as a size\+\_\+t. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_ga23caf332ea8a813af4290c846ffac166}\label{group__myfft_ga23caf332ea8a813af4290c846ffac166}} 
\index{Myfft Library@{Myfft Library}!getmaxfftw@{getmaxfftw}}
\index{getmaxfftw@{getmaxfftw}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{getmaxfftw()}{getmaxfftw()}}
{\footnotesize\ttfamily size\+\_\+t getmaxfftw (\begin{DoxyParamCaption}\item[{fftw\+\_\+complex $\ast$}]{array,  }\item[{size\+\_\+t}]{Array\+Length }\end{DoxyParamCaption})}



@ frequency domain. 


\begin{DoxyParams}{Parameters}
{\em array} & The input array in the frequency domain to search for the maximum value. \\
\hline
{\em Array\+Length} & The length of the input array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The maximum value found in the input array as a size\+\_\+t. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_ga9e7b5003fb81033321cc19879e90c27f}\label{group__myfft_ga9e7b5003fb81033321cc19879e90c27f}} 
\index{Myfft Library@{Myfft Library}!getshift@{getshift}}
\index{getshift@{getshift}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{getshift()}{getshift()}}
{\footnotesize\ttfamily int getshift (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmyarr}{myarr}}}]{xarr,  }\item[{struct \mbox{\hyperlink{structmyarr}{myarr}}}]{yarr }\end{DoxyParamCaption})}



Get the shift between the two input arrays. 


\begin{DoxyParams}{Parameters}
{\em xarr} & The first input array to compare. \\
\hline
{\em yarr} & The second input array to compare. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The shift between the two input arrays as an integer. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_ga9b42daf91bb4c04d6e03295977763829}\label{group__myfft_ga9b42daf91bb4c04d6e03295977763829}} 
\index{Myfft Library@{Myfft Library}!makeFilter@{makeFilter}}
\index{makeFilter@{makeFilter}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{makeFilter()}{makeFilter()}}
{\footnotesize\ttfamily fftw\+\_\+complex $\ast$ make\+Filter (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{evalue,  }\item[{size\+\_\+t}]{Array\+Length }\end{DoxyParamCaption})}



@ . 


\begin{DoxyParams}{Parameters}
{\em evalue} & The evalue to use for the filter. \\
\hline
{\em Array\+Length} & The length of the array to filter. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the filter in the frequency domain. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__myfft_ga68517c39d07c3d1a670d8b2ff60581ee}\label{group__myfft_ga68517c39d07c3d1a670d8b2ff60581ee}} 
\index{Myfft Library@{Myfft Library}!normalise@{normalise}}
\index{normalise@{normalise}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{normalise()}{normalise()}}
{\footnotesize\ttfamily void normalise (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{Array\+Length,  }\item[{fftw\+\_\+complex $\ast$}]{in\+Data }\end{DoxyParamCaption})}



Normalise the input array in the frequency domain. 


\begin{DoxyParams}{Parameters}
{\em Array\+Length} & The length of the input array. \\
\hline
{\em in\+Data} & The input array in the frequency domain to normalise. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__myfft_ga7ae335353fa1417b04f8e0f92f5d9b11}\label{group__myfft_ga7ae335353fa1417b04f8e0f92f5d9b11}} 
\index{Myfft Library@{Myfft Library}!remove50hz@{remove50hz}}
\index{remove50hz@{remove50hz}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{remove50hz()}{remove50hz()}}
{\footnotesize\ttfamily void remove50hz (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{Array\+Length,  }\item[{int $\ast$}]{array,  }\item[{unsigned int}]{rate }\end{DoxyParamCaption})}



Remove the 50Hz component from the input array. 


\begin{DoxyParams}{Parameters}
{\em Array\+Length} & The length of the input array. \\
\hline
{\em array} & The input array to remove the 50Hz component from. \\
\hline
{\em rate} & The sampling rate of the input array. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__myfft_gabe4899260bfe379451c138bfe4f72145}\label{group__myfft_gabe4899260bfe379451c138bfe4f72145}} 
\index{Myfft Library@{Myfft Library}!rescale@{rescale}}
\index{rescale@{rescale}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{rescale()}{rescale()}}
{\footnotesize\ttfamily void rescale (\begin{DoxyParamCaption}\item[{int $\ast$}]{total,  }\item[{size\+\_\+t}]{Array\+Length }\end{DoxyParamCaption})}



Rescale the input array to fit within the range of a 16-\/bit signed integer. 


\begin{DoxyParams}{Parameters}
{\em total} & A pointer to an integer where the total shift will be stored. \\
\hline
{\em Array\+Length} & The length of the input array. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__myfft_gac7a82ce7c64ce26d67f5d761261d33c6}\label{group__myfft_gac7a82ce7c64ce26d67f5d761261d33c6}} 
\index{Myfft Library@{Myfft Library}!writefftw@{writefftw}}
\index{writefftw@{writefftw}!Myfft Library@{Myfft Library}}
\doxysubsubsection{\texorpdfstring{writefftw()}{writefftw()}}
{\footnotesize\ttfamily void writefftw (\begin{DoxyParamCaption}\item[{fftw\+\_\+complex $\ast$}]{arr,  }\item[{size\+\_\+t}]{Array\+Length,  }\item[{const char $\ast$}]{file }\end{DoxyParamCaption})}



Write the given array in the frequency domain to a file. 


\begin{DoxyParams}{Parameters}
{\em arr} & The input array in the frequency domain to write to a file. \\
\hline
{\em Array\+Length} & The length of the input array. \\
\hline
{\em file} & The name of the file to write the array to. \\
\hline
\end{DoxyParams}
