Part of a program that estimates the direction of arrival of a signal

Dependencies:   mbed dsp

Files at this revision

API Documentation at this revision

Comitter:
mikeb
Date:
Mon Apr 18 22:45:04 2016 +0000
Parent:
3:fdefe922ce38
Child:
5:2f386ab0b650
Commit message:
Ready for test.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Apr 18 22:43:15 2016 +0000
+++ b/main.cpp	Mon Apr 18 22:45:04 2016 +0000
@@ -8,10 +8,11 @@
 float signal[350] = {-0.171926, -0.164431, -0.109017, -0.007292, 0.083098, 0.222924, 0.373266, 0.531815, 0.722060, 0.943519, 1.171436, 1.416762, 1.647820, 1.869734, 2.094165, 3.221791, 3.919746, 3.300559, 4.013104, 3.629830, 3.486193, 3.495529, 3.640264, 3.993478, 3.635194, 2.212095, 2.686072, 2.032333, 0.725234, 0.709661, -0.188523, -0.558864, -0.605799, -1.144265, -2.063190, -2.618962, -3.365376, -3.522119, -3.621998, -4.183547, -4.631551, -4.757968, -5.449490, -4.782776, -5.330020, -5.053121, -5.126057, -5.150428, -4.545297, -4.746356, -2.891791, -2.930119, -3.373582, -1.841205, -2.306663, -1.174910, -0.530784, 0.265803, 0.652884, 1.361013, 1.676977, 2.341486, 3.051038, 3.463575, 4.059581, 3.919068, 4.184487, 3.985282, 4.882868, 4.734705, 5.219888, 4.853742, 4.911346, 4.433226, 4.594856, 3.915354, 4.164072, 3.478993, 3.469309, 3.062880, 2.170758, 1.188631, 0.973389, 0.416491, 0.302067, -0.472809, -0.938098, -1.471422, -1.659218, -2.682480, -3.112274, -3.355195, -3.753629, -3.637839, -3.618635, -3.810530, -4.435617, -4.432250, -4.503820, -4.415154, -4.226244, -4.143591, -4.532533, -4.002480, -4.213850, -3.838094, -3.292588, -2.866270, -2.045566, -2.098614, -1.753220, -0.829118, -0.820524, 0.180795, 0.380893, 1.469267, 1.238872, 2.023806, 2.476717, 3.204941, 3.629909, 3.932498, 4.595968, 4.888801, 4.833841, 4.368102, 4.539508, 4.805146, 4.581446, 4.998927, 4.410131, 4.377639, 3.443010, 3.274809, 2.797714, 3.249483, 2.375086, 1.975362, 1.078000, 0.540086, 0.356897, -0.211387, -0.769486, -1.618888, -2.459778, -2.773895, -3.163354, -3.761071, -4.290114, -4.482664, -4.846559, -4.970844, -4.447797, -5.077544, -5.039585, -4.986628, -5.278021, -5.124513, -4.862664, -4.253031, -4.287352, -3.589156, -3.454390, -3.088135, -2.137847, -2.102912, -1.468011, -0.592856, -0.306698, 0.391857, 0.815387, 1.393243, 2.075283, 2.630311, 2.675572, 3.622321, 3.306180, 3.782502, 4.440816, 4.630192, 4.519812, 4.487716, 4.686595, 4.628369, 4.580376, 4.233655, 3.801272, 3.564165, 3.688830, 3.286295, 2.620788, 2.419409, 1.709356, 1.110968, 1.022952, -0.030208, -0.170681, -0.772485, -1.074350, -1.615238, -1.879486, -2.847920, -2.668092, -3.110102, -3.775532, -3.872787, -4.032065, -4.328871, -4.060052, -4.555232, -4.402229, -4.439816, -3.997897, -3.992540, -3.784796, -3.424051, -3.496234, -2.718903, -2.491277, -2.053326, -1.575908, -0.609457, -1.131810, -0.614776, 0.063980, 0.511015, 1.594910, 1.646399, 2.183805, 2.728259, 3.030428, 3.646177, 4.170161, 4.672574, 4.042578, 3.836475, 5.109740, 4.502200, 4.567188, 4.212829, 4.710209, 4.089788, 3.806692, 3.515854, 3.298185, 2.827392, 1.891928, 1.400900, 1.203533, 0.403391, -0.032541, -0.041059, -1.511060, -1.451378, -1.413470, -2.562112, -2.362005, -3.156877, -3.315784, -3.664911, -4.459824, -4.555808, -4.419097, -4.670024, -4.763353, -4.911585, -4.418733, -4.523172, -4.016395, -4.285387, -3.673176, -3.182000, -3.513826, -2.064272, -2.259835, -1.662449, -1.208372, -0.644120, -0.364028, 0.539445, 0.471142, 1.622844, 1.935751, 2.059906, 3.156104, 3.607223, 3.854957, 4.479310, 4.126830, 4.265574, 3.987360, -0.035804, -0.073435, -0.072925, -0.116558, -0.129573, -0.146679, -0.165569, -0.187004, -0.216111};
 int main() {
     //Define slave sensor locations in mm coordinates relative to the master sensor. 
+    
     int x[2] = { 95, -82 }; //x coordinates
     int y[2] = { 77, -110 }; //y
     float phases = 0;
-    float filteredSignal[400] = {}; //this array holds the signal after filtering
+    float filteredSignal[400] = {}; //this array holds the signal after filtering. Make sure the input signal is > 300 samples. 
     arm_conv_f32(signal,    350 , b, 51, filteredSignal )   ; //Filtering operation
     Phase_Finder phase(50000, 900); //Create phase object