<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_moving__average_8h">
<title>/Users/bernard/b20/bsoft/include/moving_average.h File Reference</title>
<indexterm><primary>/Users/bernard/b20/bsoft/include/moving_average.h</primary></indexterm>
<para>

<para>Header file moving average calculations. </para>
 
</para>
<programlisting>#include &quot;Complex.h&quot;
#include &quot;matrix_linear.h&quot;
#include &quot;utilities.h&quot;
</programlisting><simplesect>
    <title>Functions    </title>
        <itemizedlist>
            <listitem><para>double * <link linkend="_moving__average_8h_1aa8732a55dc8dd1934e9b549b5c9f4a57">moving_average</link> (long number, double *x, long window)</para>

<para>Calculates a moving average over an array of data. </para>
</listitem>
            <listitem><para><link linkend="_class_complex">Complex</link>&lt; float &gt; * <link linkend="_moving__average_8h_1a3d8db5f6e3c6c1743d3833ee93cb61b9">moving_average_complex</link> (long number, <link linkend="_class_complex">Complex</link>&lt; float &gt; *x, long window)</para>

<para>Calculates a moving average over an array of complex data. </para>
</listitem>
            <listitem><para>vector&lt; double &gt; <link linkend="_moving__average_8h_1ac4dc6bea103bc02020c94a4bd769f646">moving_polynomial</link> (long order, long number, double *x, long window)</para>

<para>Calculates a moving polynomial fit over an array of data. </para>
</listitem>
        </itemizedlist>
</simplesect>
<section>
<title>Detailed Description</title>

<para>Header file moving average calculations. </para>

<para><formalpara><title>Author: </title>

<para>Bernard Heymann </para>
</formalpara>
<formalpara><title>Date: </title>

<para>Created: 20000430 </para>

<para>Modified: 20190225 </para>
</formalpara>
</para>
</section>
<section>
<title>Function Documentation</title>
<anchor xml:id="_moving__average_8h_1aa8732a55dc8dd1934e9b549b5c9f4a57"/>    <section>
    <title>moving_average()</title>
<indexterm><primary>moving_average</primary><secondary>moving_average.h</secondary></indexterm>
<indexterm><primary>moving_average.h</primary><secondary>moving_average</secondary></indexterm>
<para><computeroutput>double* moving_average (long number, double * x, long window)</computeroutput></para><para>

<para>Calculates a moving average over an array of data. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>number</entry>
                                <entry>
<para>number of values in the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>*x</entry>
                                <entry>
<para>the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>window</entry>
                                <entry>
<para>sliding window length. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double* the moving average array. <literallayout><computeroutput>All data points within a sliding window are averaged.
The window moves over the ends of the array and averages only the 
available points.
A new array is allocated and the moving averages returned.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 28 of file moving_average.cpp.</para>
    </section><anchor xml:id="_moving__average_8h_1a3d8db5f6e3c6c1743d3833ee93cb61b9"/>    <section>
    <title>moving_average_complex()</title>
<indexterm><primary>moving_average_complex</primary><secondary>moving_average.h</secondary></indexterm>
<indexterm><primary>moving_average.h</primary><secondary>moving_average_complex</secondary></indexterm>
<para><computeroutput><link linkend="_class_complex">Complex</link>&lt;float&gt;* moving_average_complex (long number, <link linkend="_class_complex">Complex</link>&lt; float &gt; * x, long window)</computeroutput></para><para>

<para>Calculates a moving average over an array of complex data. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>number</entry>
                                <entry>
<para>number of values in the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>*x</entry>
                                <entry>
<para>the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>window</entry>
                                <entry>
<para>sliding window length. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>Complex&lt;float&gt;* the moving average complex array. <literallayout><computeroutput>All data points within a sliding window are averaged.
The window moves over the ends of the array and averages only the 
available points.
A new array is allocated and the moving averages returned in it.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 75 of file moving_average.cpp.</para>
    </section><anchor xml:id="_moving__average_8h_1ac4dc6bea103bc02020c94a4bd769f646"/>    <section>
    <title>moving_polynomial()</title>
<indexterm><primary>moving_polynomial</primary><secondary>moving_average.h</secondary></indexterm>
<indexterm><primary>moving_average.h</primary><secondary>moving_polynomial</secondary></indexterm>
<para><computeroutput>vector&lt;double&gt; moving_polynomial (long order, long number, double * x, long window)</computeroutput></para><para>

<para>Calculates a moving polynomial fit over an array of data. </para>
</para>

<para>
                <formalpara>
                    <title>
Parameters                    </title>
                    <para>
                    <table frame="all">
                        <tgroup cols="2" align="left" colsep="1" rowsep="1">
                        <colspec colwidth="1*"/>
                        <colspec colwidth="4*"/>
                        <tbody>
                            <row>
                                <entry>order</entry>
                                <entry>
<para>polynomial order. </para>
</entry>
                            </row>
                            <row>
                                <entry>number</entry>
                                <entry>
<para>number of values in the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>*x</entry>
                                <entry>
<para>the array. </para>
</entry>
                            </row>
                            <row>
                                <entry>window</entry>
                                <entry>
<para>sliding window length. </para>
</entry>
                            </row>
                        </tbody>
                        </tgroup>
                    </table>
                    </para>
                </formalpara>
                <formalpara><title>Returns: </title>

<para>double* the moving polynomial fit array. <literallayout><computeroutput>All data points within a sliding window are fit to a polynomial.
The window moves over the ends of the array and fits only the 
available points.
A new array is allocated and the moving polynomial fit values returned.
</computeroutput></literallayout> </para>
</formalpara>
</para>
<para>
Definition at line 122 of file moving_average.cpp.</para>
</section>
</section>
</section>
