--- /dev/null
+
+ #include "aimg.h"
+
+ aimg_obj * aimg_construct_zero(const unsigned int aimgSize) {
+
+ aimg_obj * obj;
+
+ obj = (aimg_obj *) malloc(sizeof(aimg_obj));
+
+ obj->aimgSize = aimgSize;
+ obj->array = (float *) malloc(sizeof(float) * aimgSize);
+ memset(obj->array, 0x00, aimgSize * sizeof(float));
+
+ return obj;
+
+ }
+
+ void aimg_destroy(aimg_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void aimg_printf(const aimg_obj * obj) {
+
+ unsigned int iSignal;
+ unsigned int iSample;
+
+ for (iSample = 0; iSample < obj->aimgSize; iSample++) {
+
+ printf("%+1.5f ",obj->array[iSample]);
+
+ if ((((iSample+1) % 16) == 0) && ((iSample+1)!=obj->aimgSize)) {
+ printf("\n");
+ }
+
+ }
+
+ printf("\n");
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_AIMG
+#define __ODAS_SIGNAL_AIMG
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct aimg_obj {
+
+ unsigned int aimgSize;
+ float * array;
+
+ } aimg_obj;
+
+ aimg_obj * aimg_construct_zero(const unsigned int aimgSize);
+
+ void aimg_destroy(aimg_obj * obj);
+
+ void aimg_printf(const aimg_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "area.h"
+
+ areas_obj * areas_construct_zero(const unsigned int nPointsDiscrete, const unsigned int nResolutionsPerDiscrete, const unsigned int nPairs) {
+
+ areas_obj * obj;
+
+ obj = (areas_obj *) malloc(sizeof(areas_obj));
+
+ obj->nPointsDiscrete = nPointsDiscrete;
+ obj->nResolutionsPerDiscrete = nResolutionsPerDiscrete;
+ obj->nPairs = nPairs;
+
+ obj->array = (float *) malloc(sizeof(float) * nPointsDiscrete * nResolutionsPerDiscrete * nPairs);
+ memset(obj->array, 0x00, sizeof(float) * nPointsDiscrete * nResolutionsPerDiscrete * nPairs);
+
+ return obj;
+
+ }
+
+ void areas_destroy(areas_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void areas_printf(const areas_obj * obj) {
+
+ unsigned int iPointDiscrete;
+ unsigned int iResolutionPerDiscrete;
+ unsigned int iPair;
+
+ printf("%u\n",obj->nPointsDiscrete);
+ printf("%u\n",obj->nResolutionsPerDiscrete);
+ printf("%u\n",obj->nPairs);
+
+ for (iPointDiscrete = 0; iPointDiscrete < obj->nPointsDiscrete; iPointDiscrete++) {
+
+ for (iResolutionPerDiscrete = 0; iResolutionPerDiscrete < obj->nResolutionsPerDiscrete; iResolutionPerDiscrete++) {
+
+ printf("(%04u:%03u): ", iPointDiscrete, iResolutionPerDiscrete);
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("%1.1E ",obj->array[iPointDiscrete * (obj->nResolutionsPerDiscrete * obj->nPairs) + iResolutionPerDiscrete * obj->nPairs + iPair]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
+
+ }
+
+ area_obj * area_construct_zero(const unsigned int nPairs) {
+
+ area_obj * obj;
+
+ obj = (area_obj *) malloc(sizeof(area_obj));
+
+ obj->nPairs = nPairs;
+
+ obj->array = (float *) malloc(sizeof(float) * nPairs);
+ memset(obj->array, 0x00, sizeof(float) * nPairs);
+
+ return obj;
+
+ }
+
+ void area_destroy(area_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void area_printf(const area_obj * obj) {
+
+ unsigned int iPair;
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("(%03u): %+1.3f\n", iPair, obj->array[iPair]);
+
+ }
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_AREA
+#define __ODAS_SIGNAL_AREA
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct areas_obj {
+
+ unsigned int nPointsDiscrete;
+ unsigned int nResolutionsPerDiscrete;
+ unsigned int nPairs;
+
+ float * array;
+
+ } areas_obj;
+
+ typedef struct area_obj {
+
+ unsigned int nPairs;
+
+ float * array;
+
+ } area_obj;
+
+ areas_obj * areas_construct_zero(const unsigned int nPointsDiscrete, const unsigned int nResolutionsPerDiscrete, const unsigned int nPairs);
+
+ void areas_destroy(areas_obj * obj);
+
+ void areas_printf(const areas_obj * obj);
+
+ area_obj * area_construct_zero(const unsigned int nPairs);
+
+ void area_destroy(area_obj * obj);
+
+ void area_printf(const area_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "assignation.h"
+
+ assignations_obj * assignations_construct_zero(const unsigned int nAssignations, const unsigned int nPots) {
+
+ assignations_obj * obj;
+
+ obj = (assignations_obj *) malloc(sizeof(assignations_obj));
+
+ obj->nAssignations = nAssignations;
+ obj->nPots = nPots;
+ obj->array = (signed int *) malloc(sizeof(signed int) * nAssignations * nPots);
+ memset(obj->array, 0x00, nAssignations * nPots * sizeof(signed int));
+
+ return obj;
+
+ }
+
+ void assignations_destroy(assignations_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void assignations_printf(const assignations_obj * obj) {
+
+ unsigned int iAssignation;
+ unsigned int iPot;
+
+ for (iAssignation = 0; iAssignation < obj->nAssignations; iAssignation++) {
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("%+01d ",obj->array[iAssignation * obj->nPots + iPot]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_ASSIGNATION
+#define __ODAS_SIGNAL_ASSIGNATION
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct assignations_obj {
+
+ unsigned int nAssignations;
+ unsigned int nPots;
+ signed int * array;
+
+ } assignations_obj;
+
+ assignations_obj * assignations_construct_zero(const unsigned int nAssignations, const unsigned int nPots);
+
+ void assignations_destroy(assignations_obj * obj);
+
+ void assignations_printf(const assignations_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "beampattern.h"
+
+ beampatterns_obj * beampatterns_construct_zero(const unsigned int nChannels, const unsigned int nThetas) {
+
+ beampatterns_obj * obj;
+
+ obj = (beampatterns_obj *) malloc(sizeof(beampatterns_obj));
+
+ obj->nChannels = nChannels;
+ obj->nThetas = nThetas;
+
+ obj->minThetas = (float *) malloc(sizeof(float) * nChannels);
+ memset(obj->minThetas, 0x00, sizeof(float) * nChannels);
+
+ obj->maxThetas = (float *) malloc(sizeof(float) * nChannels);
+ memset(obj->maxThetas, 0x00, sizeof(float) * nChannels);
+
+ obj->deltaThetas = (float *) malloc(sizeof(float) * nChannels);
+ memset(obj->deltaThetas, 0x00, sizeof(float) * nChannels);
+
+ obj->gains = (float *) malloc(sizeof(float) * nThetas * nChannels);
+ memset(obj->gains, 0x00, sizeof(float) * nThetas * nChannels);
+
+ return obj;
+
+ }
+
+ void beampatterns_destroy(beampatterns_obj * obj) {
+
+ free((void *) obj->minThetas);
+ free((void *) obj->maxThetas);
+ free((void *) obj->deltaThetas);
+ free((void *) obj->gains);
+ free((void *) obj);
+
+ }
+
+ void beampatterns_printf(const beampatterns_obj * obj) {
+
+ unsigned int iChannel;
+ unsigned int iTheta;
+
+ for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+ for (iTheta = 0; iTheta < obj->nThetas; iTheta++) {
+
+ printf("(%02u,%04u): %1.3f\n", iChannel, iTheta, obj->gains[obj->nThetas * iChannel + iTheta]);
+
+ }
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_BEAMPATTERN
+#define __ODAS_SIGNAL_BEAMPATTERN
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ typedef struct beampatterns_obj {
+
+ unsigned int nChannels;
+ unsigned int nThetas;
+
+ float * minThetas;
+ float * maxThetas;
+ float * deltaThetas;
+
+ float * gains;
+
+ } beampatterns_obj;
+
+ beampatterns_obj * beampatterns_construct_zero(const unsigned int nChannels, const unsigned int nThetas);
+
+ void beampatterns_destroy(beampatterns_obj * obj);
+
+ void beampatterns_printf(const beampatterns_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "coherence.h"
+
+ coherences_obj * coherences_construct_zero(const unsigned int nPots, const unsigned int nTracks) {
+
+ coherences_obj * obj;
+ obj = (coherences_obj *) malloc(sizeof(coherences_obj));
+ obj->nPots = nPots;
+ obj->nTracks = nTracks;
+ obj->array = (float *) malloc(sizeof(float) * nTracks * nPots);
+ memset(obj->array, 0x00, sizeof(float) * nTracks * nPots);
+
+ return obj;
+
+ }
+
+ void coherences_destroy(coherences_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void coherences_printf(coherences_obj * obj) {
+
+ unsigned int iTrack;
+ unsigned int iPot;
+
+ for (iTrack = 0; iTrack < obj->nTracks; iTrack++) {
+
+ printf("p(z|C,%u) = ",iTrack);
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("%+1.3e ",obj->array[iTrack * obj->nPots + iPot]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_COHERENCE
+#define __ODAS_SIGNAL_COHERENCE
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct coherences_obj {
+
+ unsigned int nTracks;
+ unsigned int nPots;
+ float * array;
+
+ } coherences_obj;
+
+ coherences_obj * coherences_construct_zero(const unsigned int nTracks, const unsigned int nPots);
+
+ void coherences_destroy(coherences_obj * obj);
+
+ void coherences_printf(coherences_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "delta.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ deltas_obj * deltas_construct_zero(const unsigned int nPairs) {
+
+ deltas_obj * obj;
+
+ obj = (deltas_obj *) malloc(sizeof(deltas_obj));
+
+ obj->nPairs = nPairs;
+ obj->array = (unsigned int *) malloc(sizeof(unsigned int) * nPairs);
+ memset(obj->array, 0x00, sizeof(unsigned int) * nPairs);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ deltas_obj * deltas_clone(const deltas_obj * obj) {
+
+ deltas_obj * clone;
+
+ clone = (deltas_obj *) malloc(sizeof(deltas_obj));
+
+ clone->nPairs = obj->nPairs;
+ clone->array = (unsigned int *) malloc(sizeof(unsigned int) * obj->nPairs);
+ memcpy(clone->array, obj->array, sizeof(unsigned int) * obj->nPairs);
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void deltas_destroy(deltas_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void deltas_printf(const deltas_obj * obj) {
+
+ unsigned int iPair;
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("(%02u): %02u\n",iPair,obj->array[iPair]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_DELTA
+#define __ODAS_SIGNAL_DELTA
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ typedef struct deltas_obj {
+
+ unsigned int nPairs;
+ unsigned int * array;
+
+ } deltas_obj;
+
+ deltas_obj * deltas_construct_zero(const unsigned int nPairs);
+
+ deltas_obj * deltas_clone(const deltas_obj * obj);
+
+ void deltas_destroy(deltas_obj * obj);
+
+ void deltas_printf(const deltas_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "frame.h"
+
+ frames_obj * frames_construct_zero(const unsigned int nSignals, const unsigned int frameSize) {
+
+ frames_obj * obj;
+ unsigned int iSignal;
+
+ obj = (frames_obj *) malloc(sizeof(frames_obj));
+
+ obj->nSignals = nSignals;
+ obj->frameSize = frameSize;
+
+ obj->array = (float **) malloc(sizeof(float *) * nSignals);
+ for (iSignal = 0; iSignal < nSignals; iSignal++) {
+ obj->array[iSignal] = (float *) malloc(sizeof(float) * frameSize);
+ memset(obj->array[iSignal], 0x00, frameSize * sizeof(float));
+ }
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ frames_obj * frames_clone(const frames_obj * obj) {
+
+ frames_obj * clone;
+ unsigned int iSignal;
+
+ clone = (frames_obj *) malloc(sizeof(frames_obj));
+
+ clone->nSignals = obj->nSignals;
+ clone->frameSize = obj->frameSize;
+
+ clone->array = (float **) malloc(sizeof(float *) * obj->nSignals);
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ clone->array[iSignal] = (float *) malloc(sizeof(float) * obj->frameSize);
+ memcpy(clone->array[iSignal], obj->array[iSignal], obj->frameSize * sizeof(float));
+ }
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void frames_destroy(frames_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ free((void *) obj->array[iSignal]);
+ }
+ free((void *) obj->array);
+
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void frames_printf(const frames_obj * obj) {
+
+ unsigned int iSignal;
+ unsigned int iSample;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+
+ printf("(%04u): ",iSignal);
+
+ for (iSample = 0; iSample < obj->frameSize; iSample++) {
+
+ printf("%+1.5f ",obj->array[iSignal][iSample]);
+
+ if ((((iSample+1) % 16) == 0) && ((iSample+1)!=obj->frameSize)) {
+ printf("\n ");
+ }
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_FRAME
+#define __ODAS_SIGNAL_FRAME
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct frames_obj {
+
+ unsigned int nSignals;
+ unsigned int frameSize;
+ float ** array;
+
+ } frames_obj;
+
+ frames_obj * frames_construct_zero(const unsigned int nSignals, const unsigned int frameSize);
+
+ frames_obj * frames_clone(const frames_obj * obj);
+
+ void frames_destroy(frames_obj * obj);
+
+ void frames_printf(const frames_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "freq.h"
+
+ freqs_obj * freqs_construct_zero(const unsigned int nSignals, const unsigned int halfFrameSize) {
+
+ freqs_obj * obj;
+ unsigned int iSignal;
+
+ obj = (freqs_obj *) malloc(sizeof(freqs_obj));
+
+ obj->nSignals = nSignals;
+ obj->halfFrameSize = halfFrameSize;
+
+ obj->array = (float **) malloc(sizeof(float *) * nSignals);
+ for (iSignal = 0; iSignal < nSignals; iSignal++) {
+ obj->array[iSignal] = (float *) malloc(sizeof(float) * halfFrameSize * 2);
+ memset(obj->array[iSignal], 0x00, halfFrameSize * 2 * sizeof(float));
+ }
+
+ return obj;
+
+ }
+
+ freqs_obj * freqs_clone(const freqs_obj * obj) {
+
+ freqs_obj * clone;
+ unsigned int iSignal;
+
+ clone = (freqs_obj *) malloc(sizeof(freqs_obj));
+
+ clone->nSignals = obj->nSignals;
+ clone->halfFrameSize = obj->halfFrameSize;
+
+ clone->array = (float **) malloc(sizeof(float *) * obj->nSignals);
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ clone->array[iSignal] = (float *) malloc(sizeof(float) * obj->halfFrameSize * 2);
+ memcpy(clone->array[iSignal], obj->array[iSignal], obj->halfFrameSize * 2 * sizeof(float));
+ }
+
+ return clone;
+
+ }
+
+ void freqs_copy(freqs_obj * dest, const freqs_obj * src) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < src->nSignals; iSignal++) {
+ memcpy(dest->array[iSignal], src->array[iSignal], src->halfFrameSize * 2 * sizeof(float));
+ }
+
+ }
+
+ void freqs_zero(freqs_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ memset(obj->array[iSignal], 0x00, obj->halfFrameSize * 2 * sizeof(float));
+ }
+
+ }
+
+ void freqs_destroy(freqs_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ free((void *) obj->array[iSignal]);
+ }
+ free((void *) obj->array);
+
+ free((void *) obj);
+
+ }
+
+ void freqs_printf(const freqs_obj * obj) {
+
+ unsigned int iSignal;
+ unsigned int iSample;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+
+ printf("(%04u): ",iSignal);
+
+ for (iSample = 0; iSample < obj->halfFrameSize; iSample++) {
+
+ printf("(%+1.5f + %+1.5fj) ",
+ obj->array[iSignal][iSample*2 + 0],
+ obj->array[iSignal][iSample*2 + 1]);
+
+ if ((((iSample+1) % 8) == 0) && ((iSample+1)!=obj->halfFrameSize)) {
+ printf("\n ");
+ }
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_FREQ
+#define __ODAS_SIGNAL_FREQ
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct freqs_obj {
+
+ unsigned int nSignals;
+ unsigned int halfFrameSize;
+ float ** array;
+
+ } freqs_obj;
+
+ freqs_obj * freqs_construct_zero(const unsigned int nSignals, const unsigned int halfFrameSize);
+
+ freqs_obj * freqs_clone(const freqs_obj * obj);
+
+ void freqs_copy(freqs_obj * dest, const freqs_obj * src);
+
+ void freqs_zero(freqs_obj * obj);
+
+ void freqs_destroy(freqs_obj * obj);
+
+ void freqs_printf(const freqs_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "gain.h"
+
+ gains_obj * gains_construct_zero(const unsigned int nSeps, const unsigned int nChannels) {
+
+ gains_obj * obj;
+
+ obj = (gains_obj *) malloc(sizeof(gains_obj));
+
+ obj->nSeps = nSeps;
+ obj->nChannels = nChannels;
+
+ obj->array = (float *) malloc(sizeof(float) * nSeps * nChannels);
+ memset(obj->array, 0x00, sizeof(float) * nSeps * nChannels);
+
+ return obj;
+
+ }
+
+ void gains_destroy(gains_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void gains_printf(const gains_obj * obj) {
+
+ unsigned int iSep;
+ unsigned int iChannel;
+
+ for (iSep = 0; iSep < obj->nSeps; iSep++) {
+
+ printf("(%02u): ",iSep);
+
+ for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+ printf("%+1.3f ",obj->array[iChannel]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_GAIN
+#define __ODAS_SIGNAL_GAIN
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ typedef struct gains_obj {
+
+ unsigned int nSeps;
+ unsigned int nChannels;
+ float * array;
+
+ } gains_obj;
+
+ gains_obj * gains_construct_zero(const unsigned int nSeps, const unsigned int nChannels);
+
+ void gains_destroy(gains_obj * obj);
+
+ void gains_printf(const gains_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "hop.h"
+
+ hops_obj * hops_construct_zero(const unsigned int nSignals, const unsigned int hopSize) {
+
+ hops_obj * obj;
+ unsigned int iSignal;
+
+ obj = (hops_obj *) malloc(sizeof(hops_obj));
+
+ obj->nSignals = nSignals;
+ obj->hopSize = hopSize;
+
+ obj->array = (float **) malloc(sizeof(float *) * nSignals);
+ for (iSignal = 0; iSignal < nSignals; iSignal++) {
+ obj->array[iSignal] = (float *) malloc(sizeof(float) * hopSize);
+ memset(obj->array[iSignal], 0x00, hopSize * sizeof(float));
+ }
+
+ return obj;
+
+ }
+
+ hops_obj * hops_clone(const hops_obj * obj) {
+
+ hops_obj * clone;
+ unsigned int iSignal;
+
+ clone = (hops_obj *) malloc(sizeof(hops_obj));
+
+ clone->nSignals = obj->nSignals;
+ clone->hopSize = obj->hopSize;
+
+ clone->array = (float **) malloc(sizeof(float *) * obj->nSignals);
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ clone->array[iSignal] = (float *) malloc(sizeof(float) * obj->hopSize);
+ memcpy(clone->array[iSignal], obj->array[iSignal], obj->hopSize * sizeof(float));
+ }
+
+ return clone;
+
+ }
+
+ void hops_copy(hops_obj * dest, const hops_obj * src) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < src->nSignals; iSignal++) {
+ memcpy(dest->array[iSignal], src->array[iSignal], src->hopSize * sizeof(float));
+ }
+
+ }
+
+ void hops_zero(hops_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ memset(obj->array[iSignal], 0x00, obj->hopSize * sizeof(float));
+ }
+
+ }
+
+ void hops_destroy(hops_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ free((void *) obj->array[iSignal]);
+ }
+ free((void *) obj->array);
+
+ free((void *) obj);
+
+ }
+
+ void hops_printf(const hops_obj * obj) {
+
+ unsigned int iSignal;
+ unsigned int iSample;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+
+ printf("(%04u): ",iSignal);
+
+ for (iSample = 0; iSample < obj->hopSize; iSample++) {
+
+ printf("%+1.5f ",obj->array[iSignal][iSample]);
+
+ if ((((iSample+1) % 16) == 0) && ((iSample+1)!=obj->hopSize)) {
+ printf("\n ");
+ }
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_HOP
+#define __ODAS_SIGNAL_HOP
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct hops_obj {
+
+ unsigned int nSignals;
+ unsigned int hopSize;
+ float ** array;
+
+ } hops_obj;
+
+ hops_obj * hops_construct_zero(const unsigned int nSignals, const unsigned int hopSize);
+
+ hops_obj * hops_clone(const hops_obj * obj);
+
+ void hops_copy(hops_obj * dest, const hops_obj * src);
+
+ void hops_zero(hops_obj * obj);
+
+ void hops_destroy(hops_obj * obj);
+
+ void hops_printf(const hops_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "impulse.h"
+
+ impulse_obj * impulse_construct(const unsigned int nCoefficients) {
+
+ impulse_obj * obj;
+
+ obj = (impulse_obj *) malloc(sizeof(impulse_obj));
+
+ obj->nCoefficients = nCoefficients;
+ obj->array = (float *) malloc(sizeof(float) * nCoefficients);
+ memset(obj->array, 0x00, sizeof(float) * nCoefficients);
+
+ return obj;
+
+ }
+
+ void impulse_destroy(impulse_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_IMPULSE
+#define __ODAS_SIGNAL_IMPULSE
+
+ #include <stdlib.h>
+ #include <string.h>
+
+ typedef struct impulse_obj {
+
+ float * array;
+ unsigned int nCoefficients;
+
+ } impulse_obj;
+
+ impulse_obj * impulse_construct(const unsigned int nCoefficients);
+
+ void impulse_destroy(impulse_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "index.h"
+
+ indexes_obj * indexes_construct_zero(const unsigned int nCoarses, const unsigned int nFines) {
+
+ indexes_obj * obj;
+
+ obj = (indexes_obj *) malloc(sizeof(indexes_obj));
+
+ obj->nCoarses = nCoarses;
+ obj->nFines = nFines;
+ obj->array = (unsigned int *) malloc(sizeof(unsigned int) * nCoarses * nFines);
+ memset(obj->array, 0x00, sizeof(unsigned int) * nCoarses * nFines);
+ obj->count = (unsigned int *) malloc(sizeof(unsigned int) * nCoarses);
+ memset(obj->count, 0x00, sizeof(unsigned int) * nCoarses);
+
+ return obj;
+
+ }
+
+ void indexes_destroy(indexes_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj->count);
+ free((void *) obj);
+
+ }
+
+ void indexes_printf(const indexes_obj * obj) {
+
+ unsigned int iCoarse;
+ unsigned int iFine;
+
+ for (iCoarse = 0; iCoarse < obj->nCoarses; iCoarse++) {
+
+ printf("(%04u): ",iCoarse);
+
+ if (obj->count[iCoarse] > 0) {
+
+ for (iFine = 0; iFine < obj->count[iCoarse]; iFine++) {
+
+ printf("%04u ",obj->array[iCoarse * obj->nFines + iFine]);
+
+ }
+
+ }
+ else {
+
+ printf("-");
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_INDEX
+#define __ODAS_SIGNAL_INDEX
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct indexes_obj {
+
+ unsigned int nCoarses;
+ unsigned int nFines;
+ unsigned int * array;
+ unsigned int * count;
+
+ } indexes_obj;
+
+ indexes_obj * indexes_construct_zero(const unsigned int nCoarses, const unsigned int nFines);
+
+ void indexes_destroy(indexes_obj * obj);
+
+ void indexes_printf(const indexes_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "kalman.h"
+
+ kalman_obj * kalman_construct_zero(void) {
+
+ kalman_obj * obj;
+
+ obj = (kalman_obj *) malloc(sizeof(kalman_obj));
+
+ obj->x_lm1lm1 = matrix_construct_zero(6,1);
+ obj->x_llm1 = matrix_construct_zero(6,1);
+ obj->P_lm1lm1 = matrix_construct_zero(6,6);
+ obj->P_llm1 = matrix_construct_zero(6,6);
+
+ return obj;
+
+ }
+
+ void kalman_destroy(kalman_obj * obj) {
+
+ matrix_destroy(obj->x_lm1lm1);
+ matrix_destroy(obj->x_llm1);
+ matrix_destroy(obj->P_lm1lm1);
+ matrix_destroy(obj->P_llm1);
+
+ free((void *) obj);
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_KALMAN
+#define __ODAS_SIGNAL_KALMAN
+
+ #include <stdlib.h>
+ #include <stdio.h>
+
+ #include "../utils/matrix.h"
+
+ typedef struct kalman_obj {
+
+ matrix_obj * x_lm1lm1;
+ matrix_obj * x_llm1;
+ matrix_obj * P_lm1lm1;
+ matrix_obj * P_llm1;
+
+ } kalman_obj;
+
+ kalman_obj * kalman_construct_zero(void);
+
+ void kalman_destroy(kalman_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "map.h"
+
+ maps_obj * maps_construct_zero(const unsigned int nCoarses, const unsigned int nFines) {
+
+ maps_obj * obj;
+
+ obj = (maps_obj *) malloc(sizeof(maps_obj));
+
+ obj->nCoarses = nCoarses;
+ obj->nFines = nFines;
+
+ obj->array = (char *) malloc(sizeof(char) * nFines * nCoarses);
+ memset(obj->array, 0x00, sizeof(char) * nFines * nCoarses);
+
+ return obj;
+
+ }
+
+ void maps_destroy(maps_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void maps_printf(const maps_obj * obj) {
+
+ unsigned int iFine;
+ unsigned int iCoarse;
+
+ for (iFine = 0; iFine < obj->nFines; iFine++) {
+
+ printf("(%04u): ",iFine);
+
+ for (iCoarse = 0; iCoarse < obj->nCoarses; iCoarse++) {
+
+ printf("%01u",obj->array[iFine * obj->nCoarses + iCoarse]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_MAP
+#define __ODAS_SIGNAL_MAP
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct maps_obj {
+
+ unsigned int nCoarses;
+ unsigned int nFines;
+ char * array;
+
+ } maps_obj;
+
+ maps_obj * maps_construct_zero(const unsigned int nCoarses, const unsigned int nFines);
+
+ void maps_destroy(maps_obj * obj);
+
+ void maps_printf(const maps_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "mask.h"
+
+ masks_obj * masks_construct_zero(const unsigned int nSeps, const unsigned int nChannels) {
+
+ masks_obj * obj;
+
+ obj = (masks_obj *) malloc(sizeof(masks_obj));
+
+ obj->nSeps = nSeps;
+ obj->nChannels = nChannels;
+
+ obj->array = (char *) malloc(sizeof(char) * nSeps * nChannels);
+ memset(obj->array, 0x00, sizeof(char) * nSeps * nChannels);
+
+ return obj;
+
+ }
+
+ void masks_destroy(masks_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void masks_printf(const masks_obj * obj) {
+
+ unsigned int iSep;
+ unsigned int iChannel;
+
+ for (iSep = 0; iSep < obj->nSeps; iSep++) {
+
+ printf("(%02u): ",iSep);
+
+ for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+ printf("%d ",obj->array[iChannel]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_MASK
+#define __ODAS_SIGNAL_MASK
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ typedef struct masks_obj {
+
+ unsigned int nSeps;
+ unsigned int nChannels;
+ char * array;
+
+ } masks_obj;
+
+ masks_obj * masks_construct_zero(const unsigned int nSeps, const unsigned int nChannels);
+
+ void masks_destroy(masks_obj * obj);
+
+ void masks_printf(const masks_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "mixture.h"
+
+ mixture_obj * mixture_construct_zero(const unsigned int nPots, const unsigned int nTracks) {
+
+ mixture_obj * obj;
+
+ obj = (mixture_obj *) malloc(sizeof(mixture_obj));
+
+ obj->assignations = combining_generate(nPots, nTracks);
+
+ obj->nPots = nPots;
+ obj->nTracks = nTracks;
+ obj->nTracksNewFalse = nTracks + 2;
+ obj->nCombinations = obj->assignations->nAssignations;
+
+ obj->p_Ez_AICD = (float *) malloc(sizeof(float) * (3+nTracks) * obj->nPots );
+ memset(obj->p_Ez_AICD, 0x00, sizeof(float) * (3+nTracks) * obj->nPots );
+
+ obj->p_Eszs_phics = (float *) malloc(sizeof(float) * obj->nTracksNewFalse * obj->nPots);
+ memset(obj->p_Eszs_phics, 0x00, sizeof(float) * obj->nTracksNewFalse * obj->nPots);
+
+ obj->p_phics = (float *) malloc(sizeof(float) * obj->nTracksNewFalse * obj->nPots);
+ memset(obj->p_phics, 0x00, sizeof(float) * obj->nTracksNewFalse * obj->nPots);
+
+ obj->p_Ez_phic = (float *) malloc(sizeof(float) * obj->nCombinations);
+ memset(obj->p_Ez_phic, 0x00, sizeof(float) * obj->nCombinations);
+
+ obj->p_phic = (float *) malloc(sizeof(float) * obj->nCombinations);
+ memset(obj->p_phic, 0x00, sizeof(float) * obj->nCombinations);
+
+ obj->p_phic_Ez = (float *) malloc(sizeof(float) * obj->nCombinations);
+ memset(obj->p_phic_Ez, 0x00, sizeof(float) * obj->nCombinations);
+
+ return obj;
+
+ }
+
+ void mixture_destroy(mixture_obj * obj) {
+
+ assignations_destroy(obj->assignations);
+
+ free((void *) obj->p_Ez_AICD);
+ free((void *) obj->p_Eszs_phics);
+ free((void *) obj->p_phics);
+ free((void *) obj->p_Ez_phic);
+ free((void *) obj->p_phic);
+ free((void *) obj->p_phic_Ez);
+
+ free((void *) obj);
+
+ }
+
+ void mixture_printf(const mixture_obj * obj) {
+
+ unsigned int iTrack;
+ unsigned int iTrackNewFalse;
+ unsigned int iPot;
+ unsigned int iCombination;
+
+ printf("p(E|A) = ");
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ",obj->p_Ez_AICD[0 * obj->nPots + iPot]);
+ }
+ printf("\n");
+
+ printf("p(E|I) = ");
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ",obj->p_Ez_AICD[1 * obj->nPots + iPot]);
+ }
+ printf("\n");
+
+ printf("p(z|D) = ");
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ",obj->p_Ez_AICD[2 * obj->nPots + iPot]);
+ }
+ printf("\n");
+
+ for (iTrack = 0; iTrack < obj->nTracks; iTrack++) {
+ printf("p(z|C,%u) = ",iTrack);
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ", obj->p_Ez_AICD[3 * obj->nPots + iPot]);
+ }
+ printf("\n");
+ }
+ printf("\n");
+
+ printf("p(E,z|phi(s)):\n");
+ for (iTrackNewFalse = 0; iTrackNewFalse < obj->nTracksNewFalse; iTrackNewFalse++) {
+
+ printf(" phi = %d: ",iTrackNewFalse-2);
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ",obj->p_Eszs_phics[iTrackNewFalse * obj->nPots + iPot]);
+ }
+ printf("\n");
+
+ }
+ printf("\n");
+
+ printf("p(phi(s)):\n");
+ for (iTrackNewFalse = 0; iTrackNewFalse < obj->nTracksNewFalse; iTrackNewFalse++) {
+
+ printf(" phi = %d: ",iTrackNewFalse-2);
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+ printf("%+1.3e ",obj->p_phics[iTrackNewFalse * obj->nPots + iPot]);
+ }
+ printf("\n");
+
+ }
+ printf("\n");
+
+ printf("p(E,z|phi), p(phi), p(phi|E,z):\n");
+
+ for (iCombination = 0; iCombination < obj->nCombinations; iCombination++) {
+
+ printf(" ");
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("%+01d ",obj->assignations->array[iCombination * obj->nPots + iPot]);
+
+ }
+
+ printf(": %+1.3e %+1.3e %+1.3e\n",obj->p_Ez_phic[iCombination],obj->p_phic[iCombination],obj->p_phic_Ez[iCombination]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_MIXTURE
+#define __ODAS_SIGNAL_MIXTURE
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ #include "../signal/assignation.h"
+ #include "../init/combining.h"
+
+ typedef struct mixture_obj {
+
+ unsigned int nPots;
+ unsigned int nTracks;
+ unsigned int nTracksNewFalse;
+ unsigned int nCombinations;
+
+ assignations_obj * assignations;
+
+ float * p_Ez_AICD;
+ float * p_Eszs_phics;
+ float * p_phics;
+ float * p_Ez_phic;
+ float * p_phic;
+ float * p_phic_Ez;
+
+ } mixture_obj;
+
+ mixture_obj * mixture_construct_zero(const unsigned int nPots, const unsigned int nTracks);
+
+ void mixture_destroy(mixture_obj * obj);
+
+ void mixture_printf(const mixture_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "pair.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ pairs_obj * pairs_construct_zero(const unsigned int nPairs) {
+
+ pairs_obj * obj;
+
+ obj = (pairs_obj *) malloc(sizeof(pairs_obj));
+
+ obj->nPairs = nPairs;
+ obj->array = (char *) malloc(sizeof(char) * nPairs);
+ memset(obj->array, 0x00, sizeof(char) * nPairs);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ pairs_obj * pairs_clone(const pairs_obj * obj) {
+
+ pairs_obj * clone;
+
+ clone = (pairs_obj *) malloc(sizeof(pairs_obj));
+
+ clone->nPairs = obj->nPairs;
+ clone->array = (char *) malloc(sizeof(char) * obj->nPairs);
+ memcpy(clone->array, obj->array, sizeof(char) * obj->nPairs);
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destroy |
+ // +----------------------------------------------------------+
+
+ void pairs_destroy(pairs_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void pairs_printf(const pairs_obj * obj) {
+
+ unsigned int iPair;
+
+ printf("nPairs: %u\n", obj->nPairs);
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+ printf("(%02u): %d\n", iPair, obj->array[iPair]);
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_PAIR
+#define __ODAS_SIGNAL_PAIR
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct pairs_obj {
+
+ unsigned int nPairs;
+ char * array;
+
+ } pairs_obj;
+
+ pairs_obj * pairs_construct_zero(const unsigned int nPairs);
+
+ pairs_obj * pairs_clone(const pairs_obj * obj);
+
+ void pairs_destroy(pairs_obj * obj);
+
+ void pairs_printf(const pairs_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "particle.h"
+
+ particles_obj * particles_construct_zero(const unsigned int nParticles) {
+
+ particles_obj * obj;
+
+ obj = (particles_obj *) malloc(sizeof(particles_obj));
+
+ obj->nParticles = nParticles;
+
+ obj->array = (float *) malloc(sizeof(float) * 7 * nParticles);
+ memset(obj->array, 0x00, sizeof(float) * 7 * nParticles);
+
+ obj->state = (unsigned char *) malloc(sizeof(unsigned char) * nParticles);
+ memset(obj->state, 0x00, sizeof(unsigned char) * nParticles);
+
+ return obj;
+
+ }
+
+ void particles_destroy(particles_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj->state);
+ free((void *) obj);
+
+ }
+
+ void particles_printf(const particles_obj * obj) {
+
+ unsigned int iParticle;
+
+ for (iParticle = 0; iParticle < obj->nParticles; iParticle++) {
+
+ printf("(%04u): x = (%+1.3f,%+1.3f,%+1.3f), v = (%+1.3f,%+1.3f,%+1.3f), w = %1.5f, s = %u\n",
+ iParticle,
+ obj->array[iParticle * 7 + 0],
+ obj->array[iParticle * 7 + 1],
+ obj->array[iParticle * 7 + 2],
+ obj->array[iParticle * 7 + 3],
+ obj->array[iParticle * 7 + 4],
+ obj->array[iParticle * 7 + 5],
+ obj->array[iParticle * 7 + 6],
+ obj->state[iParticle]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_PARTICLE
+#define __ODAS_SIGNAL_PARTICLE
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct particles_obj {
+
+ unsigned int nParticles;
+ float * array;
+ unsigned char * state;
+
+ } particles_obj;
+
+ particles_obj * particles_construct_zero(const unsigned int nParticles);
+
+ void particles_destroy(particles_obj * obj);
+
+ void particles_printf(const particles_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "point.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ points_obj * points_construct_zero(const unsigned int nPoints) {
+
+ points_obj * obj;
+
+ obj = (points_obj *) malloc(sizeof(points_obj));
+
+ obj->nPoints = nPoints;
+ obj->array = (float *) malloc(sizeof(float) * nPoints * 3);
+ memset(obj->array, 0x00, nPoints * 3 * sizeof(float));
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ points_obj * points_clone(const points_obj * obj) {
+
+ points_obj * clone;
+
+ clone = (points_obj *) malloc(sizeof(points_obj));
+
+ clone->nPoints = obj->nPoints;
+ clone->array = (float *) malloc(sizeof(float) * obj->nPoints * 3);
+ memcpy(clone->array, obj->array, obj->nPoints * 3 * sizeof(float));
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void points_destroy(points_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void points_printf(const points_obj * obj) {
+
+ unsigned int iPoint;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): (%+1.3f,%+1.3f,%+1.3f)\n",
+ iPoint,
+ obj->array[iPoint * 3 + 0],
+ obj->array[iPoint * 3 + 1],
+ obj->array[iPoint * 3 + 2]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_POINT
+#define __ODAS_SIGNAL_POINT
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct points_obj {
+
+ unsigned int nPoints;
+ float * array;
+
+ } points_obj;
+
+ points_obj * points_construct_zero(const unsigned int nPoints);
+
+ points_obj * points_clone(const points_obj * obj);
+
+ void points_destroy(points_obj * obj);
+
+ void points_printf(const points_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "postprob.h"
+
+ postprobs_obj * postprobs_construct_zero(const unsigned int nPots, const unsigned int nTracks) {
+
+ postprobs_obj * obj;
+
+ obj = (postprobs_obj *) malloc(sizeof(postprobs_obj));
+
+ obj->nPots = nPots;
+ obj->nTracks = nTracks;
+
+ obj->arrayNew = (float *) malloc(sizeof(float) * nPots);
+ memset(obj->arrayNew, 0x00, sizeof(float) * nPots);
+
+ obj->arrayTrack = (float *) malloc(sizeof(float) * nTracks * nPots);
+ memset(obj->arrayTrack, 0x00, sizeof(float) * nTracks * nPots);
+
+ obj->arrayTrackTotal = (float *) malloc(sizeof(float) * nTracks);
+ memset(obj->arrayTrackTotal, 0x00, sizeof(float) * nTracks);
+
+ return obj;
+
+ }
+
+ void postprobs_destroy(postprobs_obj * obj) {
+
+ free((void *) obj->arrayNew);
+ free((void *) obj->arrayTrack);
+ free((void *) obj->arrayTrackTotal);
+ free((void *) obj);
+
+ }
+
+ void postprobs_printf(const postprobs_obj * obj) {
+
+ unsigned int iTrack;
+ unsigned int iPot;
+
+ printf("p(new|E,z): ");
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("%+1.3e ",obj->arrayNew[iPot]);
+
+ }
+
+ printf("\n");
+
+ for (iTrack = 0; iTrack < obj->nTracks; iTrack++) {
+
+ printf(" p(%u|E,z): ",iTrack);
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("%+1.3e ",obj->arrayTrack[iTrack * obj->nPots + iPot]);
+
+ }
+
+ printf("> %+1.3f\n",obj->arrayTrackTotal[iTrack]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_POSTPROB
+#define __ODAS_SIGNAL_POSTPROB
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct postprobs_obj {
+
+ unsigned int nTracks;
+ unsigned int nPots;
+
+ float * arrayNew;
+ float * arrayTrack;
+ float * arrayTrackTotal;
+
+ } postprobs_obj;
+
+ postprobs_obj * postprobs_construct_zero(const unsigned int nPots, const unsigned int nTracks);
+
+ void postprobs_destroy(postprobs_obj * obj);
+
+ void postprobs_printf(const postprobs_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "pot.h"
+
+ pots_obj * pots_construct_zero(const unsigned int nPots) {
+
+ pots_obj * obj;
+
+ obj = (pots_obj *) malloc(sizeof(pots_obj));
+
+ obj->nPots = nPots;
+ obj->array = (float *) malloc(sizeof(float) * 4 * nPots);
+ memset(obj->array, 0x00, sizeof(float) * 4 * nPots);
+
+ return obj;
+
+ }
+
+ pots_obj * pots_clone(const pots_obj * obj) {
+
+ pots_obj * clone;
+
+ clone = (pots_obj *) malloc(sizeof(pots_obj));
+
+ clone->nPots = obj->nPots;
+ clone->array = (float *) malloc(sizeof(float) * 4 * obj->nPots);
+ memcpy(clone->array, obj->array, sizeof(float) * 4 * obj->nPots);
+
+ return clone;
+
+ }
+
+ void pots_copy(pots_obj * dest, const pots_obj * src) {
+
+ dest->nPots = src->nPots;
+
+ memcpy(dest->array, src->array, sizeof(float) * 4 * src->nPots);
+
+ }
+
+ void pots_zero(pots_obj * obj) {
+
+ obj->nPots = 0;
+ memset(obj->array, 0x00, sizeof(float) * 4 * obj->nPots);
+
+ }
+
+ void pots_destroy(pots_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void pots_printf(const pots_obj * obj) {
+
+ unsigned int iPot;
+
+ for (iPot = 0; iPot < obj->nPots; iPot++) {
+
+ printf("(%02u): %+1.3f %+1.3f %+1.3f %+1.3f\n",
+ iPot,
+ obj->array[iPot * 4 + 0],
+ obj->array[iPot * 4 + 1],
+ obj->array[iPot * 4 + 2],
+ obj->array[iPot * 4 + 3]);
+
+ }
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_POT
+#define __ODAS_SIGNAL_POT
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct pots_obj {
+
+ unsigned int nPots;
+ float * array;
+
+ } pots_obj;
+
+ pots_obj * pots_construct_zero(const unsigned int nPots);
+
+ pots_obj * pots_clone(const pots_obj * obj);
+
+ void pots_copy(pots_obj * dest, const pots_obj * src);
+
+ void pots_zero(pots_obj * obj);
+
+ void pots_destroy(pots_obj * obj);
+
+ void pots_printf(const pots_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "scan.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ scans_obj * scans_construct_null(const unsigned int nLevels) {
+
+ scans_obj * obj;
+
+ obj = (scans_obj *) malloc(sizeof(scans_obj));
+
+ obj->nLevels = nLevels;
+
+ obj->points = (points_obj **) malloc(sizeof(points_obj *) * nLevels);
+ memset(obj->points, 0x00, sizeof(points_obj *) * nLevels);
+
+ obj->tdoas = (tdoas_obj **) malloc(sizeof(tdoas_obj *) * nLevels);
+ memset(obj->tdoas, 0x00, sizeof(tdoas_obj *) * nLevels);
+
+ obj->deltas = (deltas_obj **) malloc(sizeof(deltas_obj *) * nLevels);
+ memset(obj->deltas, 0x00, sizeof(deltas_obj *) * nLevels);
+
+ obj->spatialindexes = (spatialindexes_obj **) malloc(sizeof(spatialindexes_obj *) * nLevels);
+ memset(obj->spatialindexes, 0x00, sizeof(spatialindexes_obj *) * nLevels);
+
+ obj->pairs = (pairs_obj *) NULL;
+
+ obj->indexes = (indexes_obj **) malloc(sizeof(indexes_obj *) * nLevels);
+ memset(obj->indexes, 0x00, sizeof(indexes_obj *) * nLevels);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void scans_destroy(scans_obj * obj) {
+
+ unsigned int iLevel;
+
+ for (iLevel = 0; iLevel < obj->nLevels; iLevel++) {
+
+ if (obj->points[iLevel] != NULL) {
+ points_destroy(obj->points[iLevel]);
+ }
+
+ if (obj->tdoas[iLevel] != NULL) {
+ tdoas_destroy(obj->tdoas[iLevel]);
+ }
+
+ if (obj->deltas[iLevel] != NULL) {
+ deltas_destroy(obj->deltas[iLevel]);
+ }
+
+ if (obj->spatialindexes[iLevel] != NULL) {
+ spatialindexes_destroy(obj->spatialindexes[iLevel]);
+ }
+
+ if (obj->indexes[iLevel] != NULL) {
+ indexes_destroy(obj->indexes[iLevel]);
+ }
+
+ }
+
+ if (obj->pairs != NULL) {
+ pairs_destroy(obj->pairs);
+ }
+
+ free((void *) obj->points);
+ free((void *) obj->tdoas);
+ free((void *) obj->deltas);
+ free((void *) obj->spatialindexes);
+ free((void *) obj->indexes);
+
+ free((void *) obj);
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_SCAN
+#define __ODAS_SIGNAL_SCAN
+
+ #include <stdlib.h>
+ #include <string.h>
+
+ #include "pair.h"
+ #include "point.h"
+ #include "tdoa.h"
+ #include "delta.h"
+ #include "index.h"
+ #include "spatialindex.h"
+
+ //! Scan setup
+ typedef struct scans_obj {
+
+ unsigned int nLevels;
+
+ points_obj ** points;
+ tdoas_obj ** tdoas;
+ deltas_obj ** deltas;
+ spatialindexes_obj ** spatialindexes;
+ pairs_obj * pairs;
+
+ indexes_obj ** indexes;
+
+ } scans_obj;
+
+ scans_obj * scans_construct_null(const unsigned int nLevels);
+
+ void scans_destroy(scans_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "shift.h"
+
+ shifts_obj * shifts_construct_zero(const unsigned int nSeps, const unsigned int nChannels) {
+
+ shifts_obj * obj;
+ unsigned int iChannel;
+
+ obj = (shifts_obj *) malloc(sizeof(shifts_obj));
+
+ obj->nSeps = nSeps;
+ obj->nChannels = nChannels;
+
+ obj->array = (float *) malloc(sizeof(float) * nSeps * nChannels);
+ memset(obj->array, 0x00, sizeof(float) * nSeps * nChannels);
+
+ return obj;
+
+ }
+
+ void shifts_destroy(shifts_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void shifts_printf(const shifts_obj * obj) {
+
+ unsigned int iSep;
+ unsigned int iChannel;
+
+ for (iSep = 0; iSep < obj->nSeps; iSep++) {
+
+ printf("(%02u): ",iSep);
+
+ for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+ printf("%+1.3f ",obj->array[iChannel]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_SHIFT
+#define __ODAS_SIGNAL_SHIFT
+
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ typedef struct shifts_obj {
+
+ unsigned int nSeps;
+ unsigned int nChannels;
+ float * array;
+
+ } shifts_obj;
+
+ shifts_obj * shifts_construct_zero(const unsigned int nSeps, const unsigned int nChannels);
+
+ void shifts_destroy(shifts_obj * obj);
+
+ void shifts_printf(const shifts_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "spatialgain.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ spatialgains_obj * spatialgains_construct_zero(const unsigned int nChannels, const unsigned int nPoints) {
+
+ spatialgains_obj * obj;
+
+ obj = (spatialgains_obj *) malloc(sizeof(spatialgains_obj));
+
+ obj->nChannels = nChannels;
+ obj->nPoints = nPoints;
+
+ obj->array = (float *) malloc(sizeof(float) * nChannels * nPoints);
+ memset(obj->array, 0x00, sizeof(float) * nChannels * nPoints);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ spatialgains_obj * spatialgains_clone(const spatialgains_obj * obj) {
+
+ spatialgains_obj * clone;
+
+ clone = (spatialgains_obj *) malloc(sizeof(spatialgains_obj));
+
+ clone->nChannels = obj->nChannels;
+ clone->nPoints = obj->nPoints;
+
+ clone->array = (float *) malloc(sizeof(float) * obj->nChannels * obj->nPoints);
+ memcpy(clone->array, obj->array, sizeof(float) * obj->nChannels * obj->nPoints);
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void spatialgains_destroy(spatialgains_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void spatialgains_printf(const spatialgains_obj * obj) {
+
+ unsigned int iPoint;
+ unsigned int iChannel;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): ",iPoint);
+
+ for (iChannel = 0; iChannel < obj->nChannels; iChannel++) {
+
+ printf("%1.2f ",obj->array[iPoint * obj->nChannels + iChannel]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_SPATIALGAIN
+#define __ODAS_SIGNAL_SPATIALGAIN
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct spatialgains_obj {
+
+ unsigned int nChannels;
+ unsigned int nPoints;
+
+ float * array;
+
+ } spatialgains_obj;
+
+ spatialgains_obj * spatialgains_construct_zero(const unsigned int nChannels, const unsigned int nPoints);
+
+ spatialgains_obj * spatialgains_clone(const spatialgains_obj * obj);
+
+ void spatialgains_destroy(spatialgains_obj * obj);
+
+ void spatialgains_printf(const spatialgains_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "spatialindex.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ spatialindexes_obj * spatialindexes_construct_zero(const unsigned int nPoints, const unsigned int nPairs) {
+
+ spatialindexes_obj * obj;
+
+ obj = (spatialindexes_obj *) malloc(sizeof(spatialindexes_obj));
+
+ obj->nPoints = nPoints;
+ obj->nPairs = nPairs;
+
+ obj->array = (unsigned int *) malloc(sizeof(unsigned int) * nPoints * nPairs);
+ memset(obj->array, 0x00, sizeof(unsigned int) * nPoints * nPairs);
+
+ obj->count = (unsigned int *) malloc(sizeof(unsigned int) * nPoints);
+ memset(obj->count, 0x00, sizeof(unsigned int) * nPoints);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ spatialindexes_obj * spatialindexes_clone(const spatialindexes_obj * obj) {
+
+ spatialindexes_obj * clone;
+
+ clone = (spatialindexes_obj *) malloc(sizeof(spatialindexes_obj));
+
+ clone->nPoints = obj->nPoints;
+ clone->nPairs = obj->nPairs;
+
+ clone->array = (unsigned int *) malloc(sizeof(unsigned int) * obj->nPoints * obj->nPairs);
+ memcpy(clone->array, obj->array, sizeof(unsigned int) * obj->nPoints * obj->nPairs);
+
+ clone->count = (unsigned int *) malloc(sizeof(unsigned int) * obj->nPoints);
+ memcpy(clone->count, obj->count, sizeof(unsigned int) * obj->nPoints);
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void spatialindexes_destroy(spatialindexes_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj->count);
+
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void spatialindexes_printf(const spatialindexes_obj * obj) {
+
+ unsigned int iPoint;
+ unsigned int iPair;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): ",iPoint);
+
+ if (obj->count[iPoint] > 0) {
+
+ for (iPair = 0; iPair < obj->count[iPoint]; iPair++) {
+
+ printf("%03u ",obj->array[iPoint * obj->nPairs + iPair]);
+
+ }
+
+ }
+ else {
+
+ printf("-");
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_SPATIALINDEX
+#define __ODAS_SIGNAL_SPATIALINDEX
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct spatialindexes_obj {
+
+ unsigned int nPoints;
+ unsigned int nPairs;
+
+ unsigned int * array;
+ unsigned int * count;
+
+ } spatialindexes_obj;
+
+ spatialindexes_obj * spatialindexes_construct_zero(const unsigned int nPoints, const unsigned int nPairs);
+
+ spatialindexes_obj * spatialindexes_clone(const spatialindexes_obj * obj);
+
+ void spatialindexes_destroy(spatialindexes_obj * obj);
+
+ void spatialindexes_printf(const spatialindexes_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "spatialmask.h"
+
+ // +----------------------------------------------------------+
+ // | Constructor |
+ // +----------------------------------------------------------+
+
+ spatialmasks_obj * spatialmasks_construct_zero(const unsigned int nPoints, const unsigned int nPairs) {
+
+ spatialmasks_obj * obj;
+
+ obj = (spatialmasks_obj *) malloc(sizeof(spatialmasks_obj));
+
+ obj->nPoints = nPoints;
+ obj->nPairs = nPairs;
+
+ obj->array = (char *) malloc(sizeof(char) * nPoints * nPairs);
+ memset(obj->array, 0x00, sizeof(char) * nPoints * nPairs);
+
+ return obj;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Clone |
+ // +----------------------------------------------------------+
+
+ spatialmasks_obj * spatialmasks_clone(const spatialmasks_obj * obj) {
+
+ spatialmasks_obj * clone;
+
+ clone = (spatialmasks_obj *) malloc(sizeof(spatialmasks_obj));
+
+ clone->nPoints = obj->nPoints;
+ clone->nPairs = obj->nPairs;
+
+ clone->array = (char *) malloc(sizeof(char) * obj->nPoints * obj->nPairs);
+ memcpy(clone->array, obj->array, sizeof(char) * obj->nPoints * obj->nPairs);
+
+ return clone;
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Destructor |
+ // +----------------------------------------------------------+
+
+ void spatialmasks_destroy(spatialmasks_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ // +----------------------------------------------------------+
+ // | Print |
+ // +----------------------------------------------------------+
+
+ void spatialmasks_printf(const spatialmasks_obj * obj) {
+
+ unsigned int iPoint;
+ unsigned int iPair;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): ",iPoint);
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ if (obj->array[iPoint * obj->nPairs + iPair] != 0x00) {
+
+ printf("1");
+
+ }
+ else {
+
+ printf("0");
+
+ }
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_SPATIALMASK
+#define __ODAS_SIGNAL_SPATIALMASK
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct spatialmasks_obj {
+
+ unsigned int nPoints;
+ unsigned int nPairs;
+
+ char * array;
+
+ } spatialmasks_obj;
+
+ spatialmasks_obj * spatialmasks_construct_zero(const unsigned int nPoints, const unsigned int nPairs);
+
+ spatialmasks_obj * spatialmasks_clone(const spatialmasks_obj * obj);
+
+ void spatialmasks_destroy(spatialmasks_obj * obj);
+
+ void spatialmasks_printf(const spatialmasks_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "tau.h"
+
+ taus_obj * taus_construct_zero(const unsigned int nPoints, const unsigned int nPairs) {
+
+ taus_obj * obj;
+
+ obj = (taus_obj *) malloc(sizeof(taus_obj));
+
+ obj->nPoints = nPoints;
+ obj->nPairs = nPairs;
+
+ obj->mu = (float *) malloc(sizeof(float) * nPoints * nPairs);
+ memset(obj->mu, 0x00, sizeof(float) * nPoints * nPairs);
+
+ obj->sigma2 = (float *) malloc(sizeof(float) * nPoints * nPairs);
+ memset(obj->sigma2, 0x00, sizeof(float) * nPoints * nPairs);
+
+ return obj;
+
+ }
+
+ void taus_destroy(taus_obj * obj) {
+
+ free((void *) obj->mu);
+ free((void *) obj->sigma2);
+
+ free((void *) obj);
+
+ }
+
+ void taus_printf(const taus_obj * obj) {
+
+ unsigned int iPoint;
+ unsigned int iPair;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): ",iPoint);
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("%03.3f (%03.3f) ",obj->mu[iPoint * obj->nPairs + iPair],obj->sigma2[iPoint * obj->nPairs + iPair]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_TAU
+#define __ODAS_SIGNAL_TAU
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct taus_obj {
+
+ unsigned int nPoints;
+ unsigned int nPairs;
+ float * mu;
+ float * sigma2;
+
+ } taus_obj;
+
+ taus_obj * taus_construct_zero(const unsigned int nPoints, const unsigned int nPairs);
+
+ void taus_destroy(taus_obj * obj);
+
+ void taus_printf(const taus_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "tdoa.h"
+
+ tdoas_obj * tdoas_construct_zero(const unsigned int nPoints, const unsigned int nPairs) {
+
+ tdoas_obj * obj;
+
+ obj = (tdoas_obj *) malloc(sizeof(tdoas_obj));
+
+ obj->nPoints = nPoints;
+ obj->nPairs = nPairs;
+
+ obj->array = (unsigned int *) malloc(sizeof(unsigned int) * nPoints * nPairs);
+ memset(obj->array, 0x00, sizeof(unsigned int) * nPoints * nPairs);
+
+ obj->min = (unsigned int *) malloc(sizeof(unsigned int) * nPairs);
+ memset(obj->min, 0x00, sizeof(unsigned int) * nPairs);
+
+ obj->max = (unsigned int *) malloc(sizeof(unsigned int) * nPairs);
+ memset(obj->max, 0x00, sizeof(unsigned int) * nPairs);
+
+ return obj;
+
+ }
+
+ void tdoas_destroy(tdoas_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj->min);
+ free((void *) obj->max);
+ free((void *) obj);
+
+ }
+
+ void tdoas_printf(const tdoas_obj * obj) {
+
+ unsigned int iPoint;
+ unsigned int iPair;
+
+ for (iPoint = 0; iPoint < obj->nPoints; iPoint++) {
+
+ printf("(%04u): ",iPoint);
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("%04u ",obj->array[iPoint * obj->nPairs + iPair]);
+
+ }
+
+ printf("\n");
+
+ }
+
+ printf("(min): ");
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("%04u ",obj->min[iPair]);
+
+ }
+
+ printf("\n");
+
+ printf("(max): ");
+
+ for (iPair = 0; iPair < obj->nPairs; iPair++) {
+
+ printf("%04u ",obj->max[iPair]);
+
+ }
+
+ printf("\n");
+
+ }
--- /dev/null
+#ifndef __ODAS_SIGNAL_TDOA
+#define __ODAS_SIGNAL_TDOA
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct tdoas_obj {
+
+ unsigned int nPoints;
+ unsigned int nPairs;
+ unsigned int * array;
+ unsigned int * min;
+ unsigned int * max;
+
+ } tdoas_obj;
+
+ tdoas_obj * tdoas_construct_zero(const unsigned int nPoints, const unsigned int nPairs);
+
+ void tdoas_destroy(tdoas_obj * obj);
+
+ void tdoas_printf(const tdoas_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "track.h"
+
+ tracks_obj * tracks_construct_zero(const unsigned int nTracks) {
+
+ tracks_obj * obj;
+
+ obj = (tracks_obj *) malloc(sizeof(tracks_obj));
+
+ obj->nTracks = nTracks;
+ obj->array = (float *) malloc(sizeof(float) * 3 * nTracks);
+ memset(obj->array, 0x00, sizeof(float) * 3 * nTracks);
+ obj->ids = (unsigned long long *) malloc(sizeof(unsigned long long) * nTracks);
+ memset(obj->ids, 0x00, sizeof(unsigned long long) * nTracks);
+
+ return obj;
+
+ }
+
+ void tracks_destroy(tracks_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj->ids);
+ free((void *) obj);
+
+ }
+
+ tracks_obj * tracks_clone(const tracks_obj * obj) {
+
+ tracks_obj * clone;
+
+ clone = (tracks_obj *) malloc(sizeof(tracks_obj));
+
+ clone->nTracks = obj->nTracks;
+ clone->array = (float *) malloc(sizeof(float) * 3 * obj->nTracks);
+ memcpy(clone->array, obj->array, sizeof(float) * 3 * obj->nTracks);
+ clone->ids = (unsigned long long *) malloc(sizeof(unsigned long long) * obj->nTracks);
+ memcpy(clone->ids, obj->ids, sizeof(unsigned long long) * obj->nTracks);
+
+ return clone;
+
+ }
+
+ void tracks_copy(tracks_obj * dest, const tracks_obj * src) {
+
+ dest->nTracks = src->nTracks;
+ memcpy(dest->array, src->array, sizeof(float) * 3 * src->nTracks);
+ memcpy(dest->ids, src->ids, sizeof(unsigned long long) * src->nTracks);
+
+ }
+
+ void tracks_zero(tracks_obj * obj) {
+
+ obj->nTracks = 0;
+ memset(obj->array, 0x00, sizeof(float) * 3 * obj->nTracks);
+ memset(obj->ids, 0x00, sizeof(unsigned long long) * obj->nTracks);
+
+ }
+
+ void tracks_printf(const tracks_obj * obj) {
+
+ unsigned int iTrack;
+
+ for (iTrack = 0; iTrack < obj->nTracks; iTrack++) {
+
+ printf("(%04llu): %+1.3f %+1.3f %+1.3f\n",
+ obj->ids[iTrack],
+ obj->array[iTrack * 3 + 0],
+ obj->array[iTrack * 3 + 1],
+ obj->array[iTrack * 3 + 2]);
+
+ }
+
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_TRACK
+#define __ODAS_SIGNAL_TRACK
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct tracks_obj {
+
+ unsigned int nTracks;
+ unsigned long long * ids;
+ float * array;
+
+ } tracks_obj;
+
+ tracks_obj * tracks_construct_zero(const unsigned int nTracks);
+
+ void tracks_destroy(tracks_obj * obj);
+
+ tracks_obj * tracks_clone(const tracks_obj * obj);
+
+ void tracks_copy(tracks_obj * dest, const tracks_obj * src);
+
+ void tracks_zero(tracks_obj * obj);
+
+ void tracks_printf(const tracks_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "triangle.h"
+
+ triangles_obj * triangles_construct_zero(const unsigned int nTriangles) {
+
+ triangles_obj * obj;
+
+ obj = (triangles_obj *) malloc(sizeof(triangles_obj));
+
+ obj->nTriangles = nTriangles;
+ obj->array = (float *) malloc(sizeof(float) * nTriangles * 9);
+ memset(obj->array, nTriangles * 9, sizeof(float));
+
+ return obj;
+
+ }
+
+ void triangles_destroy(triangles_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
+
+ void triangles_printf(const triangles_obj * obj) {
+
+ unsigned int iTriangle;
+
+ for (iTriangle = 0; iTriangle < obj->nTriangles; iTriangle++) {
+
+ printf("(%04u): (%+1.3f,%+1.3f,%+1.3f) - (%+1.3f,%+1.3f,%+1.3f) - (%+1.3f,%+1.3f,%+1.3f)\n",
+ iTriangle,
+ obj->array[iTriangle * 9 + 0],
+ obj->array[iTriangle * 9 + 1],
+ obj->array[iTriangle * 9 + 2],
+ obj->array[iTriangle * 9 + 3],
+ obj->array[iTriangle * 9 + 4],
+ obj->array[iTriangle * 9 + 5],
+ obj->array[iTriangle * 9 + 6],
+ obj->array[iTriangle * 9 + 7],
+ obj->array[iTriangle * 9 + 8]);
+
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_TRIANGLE
+#define __ODAS_SIGNAL_TRIANGLE
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct triangles_obj {
+
+ unsigned nTriangles;
+ float * array;
+
+ } triangles_obj;
+
+ triangles_obj * triangles_construct_zero(const unsigned int nTriangles);
+
+ void triangles_destroy(triangles_obj * obj);
+
+ void triangles_printf(const triangles_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "window.h"
+
+ window_obj * window_construct_zero(const unsigned int frameSize) {
+
+ window_obj * obj;
+
+ obj = (window_obj *) malloc(sizeof(window_obj));
+
+ obj->frameSize = frameSize;
+ obj->array = (float *) malloc(sizeof(float) * frameSize);
+ memset(obj->array, frameSize, sizeof(float));
+
+ return obj;
+
+ }
+
+ void window_destroy(window_obj * obj) {
+
+ free((void *) obj->array);
+ free((void *) obj);
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_WINDOW
+#define __ODAS_SIGNAL_WINDOW
+
+ #include <stdlib.h>
+ #include <string.h>
+
+ typedef struct window_obj {
+
+ unsigned int frameSize;
+ float * array;
+
+ } window_obj;
+
+ window_obj * window_construct_zero(const unsigned int frameSize);
+
+ void window_destroy(window_obj * obj);
+
+#endif
\ No newline at end of file
--- /dev/null
+
+ #include "xcorr.h"
+
+ xcorrs_obj * xcorrs_construct_zero(const unsigned int nSignals, const unsigned int frameSize) {
+
+ xcorrs_obj * obj;
+ unsigned int iSignal;
+
+ obj = (xcorrs_obj *) malloc(sizeof(xcorrs_obj));
+
+ obj->nSignals = nSignals;
+ obj->frameSize = frameSize;
+
+ obj->array = (float **) malloc(sizeof(float *) * nSignals);
+ for (iSignal = 0; iSignal < nSignals; iSignal++) {
+ obj->array[iSignal] = (float *) malloc(sizeof(float) * frameSize);
+ memset(obj->array[iSignal], 0x00, frameSize * sizeof(float));
+ }
+
+ return obj;
+
+ }
+
+ void xcorrs_destroy(xcorrs_obj * obj) {
+
+ unsigned int iSignal;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+ free((void *) obj->array[iSignal]);
+ }
+ free((void *) obj->array);
+
+ free((void *) obj);
+
+ }
+
+ void xcorrs_printf(const xcorrs_obj * obj) {
+
+ unsigned int iSignal;
+ unsigned int iSample;
+
+ for (iSignal = 0; iSignal < obj->nSignals; iSignal++) {
+
+ printf("(%04u): ",iSignal);
+
+ for (iSample = 0; iSample < obj->frameSize; iSample++) {
+
+ printf("%+1.5f ",obj->array[iSignal][iSample]);
+
+ if ((((iSample+1) % 16) == 0) && ((iSample+1)!=obj->frameSize)) {
+ printf("\n ");
+ }
+
+ }
+
+ printf("\n");
+
+ }
+
+ }
+
+ void xcorrs_printf_signal(const xcorrs_obj * obj, const unsigned int iSignal) {
+
+ unsigned int iSample;
+
+ printf("(%04u): ",iSignal);
+
+ for (iSample = 0; iSample < obj->frameSize; iSample++) {
+
+ printf("%+1.5f ",obj->array[iSignal][iSample]);
+
+ if ((((iSample+1) % 16) == 0) && ((iSample+1)!=obj->frameSize)) {
+ printf("\n ");
+ }
+
+ }
+
+ printf("\n");
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __ODAS_SIGNAL_XCORR
+#define __ODAS_SIGNAL_XCORR
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+
+ typedef struct xcorrs_obj {
+
+ unsigned int nSignals;
+ unsigned int frameSize;
+ float ** array;
+
+ } xcorrs_obj;
+
+ xcorrs_obj * xcorrs_construct_zero(const unsigned int nSignals, const unsigned int frameSize);
+
+ void xcorrs_destroy(xcorrs_obj * obj);
+
+ void xcorrs_printf(const xcorrs_obj * obj);
+
+ void xcorrs_printf_signal(const xcorrs_obj * obj, const unsigned int iSignal);
+
+#endif
\ No newline at end of file