├── Fixed_Beamformer ├── Beamforming.c ├── FixedBeamformer ├── FixedBeamformer.c ├── FixedBeamformer.h ├── beamPattern.dat ├── beamPattern.gnuplot ├── beamforming ├── delay.c ├── delay.h ├── delaytest.c ├── delaytest.h ├── polar.gnuplot └── sinc.gnuplot ├── README.md └── fixed_beamformer ├── .out.txt.swo ├── Beamforming ├── Beamforming.c ├── Beamforming.h ├── FixedBeamformer ├── FixedBeamformer.c ├── FixedBeamformer.h ├── beamPattern.dat ├── beamPattern.gnuplot ├── beamforming ├── delay.c ├── delay.h ├── delay_sound.c ├── delay_sound.h ├── delaytest.c ├── delaytest.h ├── localization.c ├── localization.h ├── makefile ├── out.txt ├── polar.gnuplot └── sinc.gnuplot /Fixed_Beamformer/Beamforming.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "delay.h" 4 | #include "FixedBeamformer.h" 5 | #include "delaytest.h" 6 | #include "FixedBeamformer.c" 7 | 8 | #define ANGLE_RESOLUTION 500 // Number of angle points to calculate 9 | 10 | double freq = 16000; //frequency of data input 11 | double speed_of_sound = 340.3; //speed of sound at sea level 12 | int filterLength = 11; //Numer of FIR filter taps for fractional delay(shouled be odd) 13 | int number_of_mics = 8; 14 | 15 | void fractional_delay(double frac_delay); 16 | 17 | int main(void) 18 | { 19 | mic_array_init(); 20 | double angle = 45.0; 21 | calculate_delay(angle); 22 | for(int i =0; i 2 | #include 3 | #include "delay.h" 4 | #include "delaytest.h" 5 | 6 | #define num_mics 8 7 | 8 | static struct mic_array{ 9 | double x; 10 | double y; 11 | double delay_for_E; 12 | double delay_for_NE; 13 | double delay_for_N; 14 | double delay_for_NW; 15 | double delay_for_W; 16 | double delay_for_SW; 17 | double delay_for_S; 18 | double delay_for_SE; 19 | double current_delay; 20 | }; 21 | 22 | static struct mic_array mics[num_mics]; 23 | /* 24 | double x_positions = {}; 25 | double y_positions = {}; 26 | */ 27 | //void calculate_delay(double angle); 28 | //void mic_array_init(); 29 | //double get_current_delay(int mic_number); 30 | 31 | void calculate_delay(double angle){ 32 | printf("\nAngle is : %f\n",angle); 33 | if(fmod(angle,45) != 0){ 34 | double m = tan((angle*M_PI)/180); 35 | printf("\nSlope is : %f\n",m); 36 | double perp_m; 37 | perp_m = -1/m; 38 | printf("\nPerp Slope is : %f\n",perp_m); 39 | for(int i = 0; i < num_mics; i++){ 40 | double b = mics[i].y - perp_m * mics[i].x ; 41 | printf("\nb = %f , b/2 =%f\n m + perp_m = %f",b, b/2, m+perp_m); 42 | double x = b/(perp_m + m); 43 | double y = m * x; 44 | double c = sqrt(pow(x,2) + pow(y,2)); 45 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 46 | if(y < 0){c = c * -1;} 47 | mics[i].current_delay = c; 48 | } 49 | } 50 | else if (fmod(angle, 360) == 0){ 51 | for(int i = 0; i < num_mics; i++){ 52 | mics[i].current_delay = mics[i].x; 53 | } 54 | } 55 | else if (fmod(angle, 180) == 0){ 56 | for(int i = 0; i < num_mics; i++){ 57 | mics[i].current_delay = -mics[i].x; 58 | } 59 | } 60 | else if (fmod(angle, 270) == 0){ 61 | for(int i = 0; i < num_mics; i++){ 62 | mics[i].current_delay = -mics[i].y; 63 | } 64 | } 65 | else if (fmod(angle, 90) == 0){ 66 | for(int i = 0; i < num_mics; i++){ 67 | mics[i].current_delay = mics[i].y; 68 | } 69 | } 70 | else if (fmod(angle, 135) == 0){ 71 | for(int i = 0; i < num_mics; i++){ 72 | double b = mics[i].y - mics[i].x ; 73 | double x; 74 | x = -b/2; 75 | double y = -1 * x; 76 | double c = sqrt(2)* x; 77 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 78 | if(y < 0){c = c * -1;} 79 | mics[i].current_delay = c; 80 | } 81 | } 82 | else if (fmod(angle, 45) == 0){ 83 | for(int i = 0; i < num_mics; i++){ 84 | double b = mics[i].y + mics[i].x ; 85 | double x; 86 | x = b/2; 87 | double y = x; 88 | double c = sqrt(2)* x; 89 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 90 | if(y < 0){c = c * -1;} 91 | mics[i].current_delay = c; 92 | } 93 | } 94 | double temp = mics[0].current_delay; 95 | for(int i =1; i< num_mics; i++){ 96 | if(mics[i].current_delay < temp){ 97 | temp = mics[i].current_delay; 98 | } 99 | } 100 | for(int i =0; i < num_mics; i++){ 101 | mics[i].current_delay = mics[i].current_delay - temp; 102 | } 103 | } 104 | 105 | void mic_array_init(){ 106 | printf("\n Microphone Positions:\n"); 107 | for(int i = 0; i < num_mics; i++){ 108 | double theta = i * M_PI/4; 109 | double a =.01; 110 | double b =.8; 111 | mics[i].x = a*cos(theta) * exp(b*theta); 112 | mics[i].y = a*sin(theta) * exp(b*theta); 113 | printf("mic = %d, x = %f, y = %f\n", i, mics[i].x, mics[i].y); 114 | } 115 | 116 | } 117 | 118 | double get_current_delay(int mic_number){ 119 | return mics[mic_number].current_delay; 120 | } 121 | -------------------------------------------------------------------------------- /Fixed_Beamformer/FixedBeamformer.h: -------------------------------------------------------------------------------- 1 | /***********FixedBeamformer.h*************************************/ 2 | #ifndef __FIXEDBEAMFORMER_H__ 3 | #define __FIXEDBEAMFORMER_H__ 4 | 5 | extern void mic_array_init(); 6 | extern void calculate_delay(double angle); 7 | extern double get_current_delay(int mic_number); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Fixed_Beamformer/beamPattern.dat: -------------------------------------------------------------------------------- 1 | 0 -90.000000 -1.570796 0.399728 -7.964701 2 | 1 -89.639279 -1.564501 0.391792 -8.138895 3 | 2 -89.278557 -1.558205 0.383980 -8.313823 4 | 3 -88.917836 -1.551909 0.376324 -8.488758 5 | 4 -88.557114 -1.545613 0.368851 -8.662974 6 | 5 -88.196393 -1.539317 0.361587 -8.835746 7 | 6 -87.835671 -1.533022 0.354554 -9.006360 8 | 7 -87.474950 -1.526726 0.347772 -9.174114 9 | 8 -87.114228 -1.520430 0.341259 -9.338322 10 | 9 -86.753507 -1.514134 0.335030 -9.498328 11 | 10 -86.392786 -1.507839 0.329098 -9.653503 12 | 11 -86.032064 -1.501543 0.323472 -9.803256 13 | 12 -85.671343 -1.495247 0.318162 -9.947042 14 | 13 -85.310621 -1.488951 0.313171 -10.084364 15 | 14 -84.949900 -1.482655 0.308504 -10.214782 16 | 15 -84.589178 -1.476360 0.304162 -10.337911 17 | 16 -84.228457 -1.470064 0.300143 -10.453433 18 | 17 -83.867735 -1.463768 0.296446 -10.561087 19 | 18 -83.507014 -1.457472 0.293067 -10.660676 20 | 19 -83.146293 -1.451177 0.289999 -10.752062 21 | 20 -82.785571 -1.444881 0.287238 -10.835162 22 | 21 -82.424850 -1.438585 0.284776 -10.909940 23 | 22 -82.064128 -1.432289 0.282605 -10.976402 24 | 23 -81.703407 -1.425993 0.280718 -11.034586 25 | 24 -81.342685 -1.419698 0.279108 -11.084553 26 | 25 -80.981964 -1.413402 0.277767 -11.126374 27 | 26 -80.621242 -1.407106 0.276690 -11.160125 28 | 27 -80.260521 -1.400810 0.275871 -11.185869 29 | 28 -79.899800 -1.394515 0.275307 -11.203651 30 | 29 -79.539078 -1.388219 0.274995 -11.213488 31 | 30 -79.178357 -1.381923 0.274936 -11.215361 32 | 31 -78.817635 -1.375627 0.275131 -11.209204 33 | 32 -78.456914 -1.369331 0.275584 -11.194907 34 | 33 -78.096192 -1.363036 0.276302 -11.172304 35 | 34 -77.735471 -1.356740 0.277294 -11.141180 36 | 35 -77.374749 -1.350444 0.278572 -11.101266 37 | 36 -77.014028 -1.344148 0.280148 -11.052248 38 | 37 -76.653307 -1.337853 0.282040 -10.993771 39 | 38 -76.292585 -1.331557 0.284268 -10.925449 40 | 39 -75.931864 -1.325261 0.286851 -10.846879 41 | 40 -75.571142 -1.318965 0.289813 -10.757652 42 | 41 -75.210421 -1.312669 0.293178 -10.657375 43 | 42 -74.849699 -1.306374 0.296972 -10.545684 44 | 43 -74.488978 -1.300078 0.301222 -10.422268 45 | 44 -74.128257 -1.293782 0.305954 -10.286886 46 | 45 -73.767535 -1.287486 0.311194 -10.139387 47 | 46 -73.406814 -1.281191 0.316967 -9.979731 48 | 47 -73.046092 -1.274895 0.323296 -9.807997 49 | 48 -72.685371 -1.268599 0.330202 -9.624402 50 | 49 -72.324649 -1.262303 0.337703 -9.429307 51 | 50 -71.963928 -1.256007 0.345811 -9.223221 52 | 51 -71.603206 -1.249712 0.354536 -9.006800 53 | 52 -71.242485 -1.243416 0.363880 -8.780847 54 | 53 -70.881764 -1.237120 0.373839 -8.546303 55 | 54 -70.521042 -1.230824 0.384404 -8.304238 56 | 55 -70.160321 -1.224529 0.395556 -8.055842 57 | 56 -69.799599 -1.218233 0.407267 -7.802413 58 | 57 -69.438878 -1.211937 0.419501 -7.545345 59 | 58 -69.078156 -1.205641 0.432209 -7.286124 60 | 59 -68.717435 -1.199345 0.445332 -7.026314 61 | 60 -68.356713 -1.193050 0.458798 -6.767561 62 | 61 -67.995992 -1.186754 0.472521 -6.511587 63 | 62 -67.635271 -1.180458 0.486396 -6.260198 64 | 63 -67.274549 -1.174162 0.500306 -6.015291 65 | 64 -66.913828 -1.167867 0.514111 -5.778868 66 | 65 -66.553106 -1.161571 0.527651 -5.553058 67 | 66 -66.192385 -1.155275 0.540746 -5.340140 68 | 67 -65.831663 -1.148979 0.553186 -5.142580 69 | 68 -65.470942 -1.142684 0.564737 -4.963073 70 | 69 -65.110220 -1.136388 0.575135 -4.804600 71 | 70 -64.749499 -1.130092 0.584084 -4.670496 72 | 71 -64.388778 -1.123796 0.591253 -4.564536 73 | 72 -64.028056 -1.117500 0.596276 -4.491056 74 | 73 -63.667335 -1.111205 0.598750 -4.455092 75 | 74 -63.306613 -1.104909 0.598234 -4.462582 76 | 75 -62.945892 -1.098613 0.594249 -4.520629 77 | 76 -62.585170 -1.092317 0.586282 -4.637865 78 | 77 -62.224449 -1.086022 0.573788 -4.824965 79 | 78 -61.863727 -1.079726 0.556198 -5.095407 80 | 79 -61.503006 -1.073430 0.532930 -5.466599 81 | 80 -61.142285 -1.067134 0.503404 -5.961668 82 | 81 -60.781563 -1.060838 0.467068 -6.612398 83 | 82 -60.420842 -1.054543 0.423430 -7.464365 84 | 83 -60.060120 -1.048247 0.372109 -8.586592 85 | 84 -59.699399 -1.041951 0.312916 -10.091456 86 | 85 -59.338677 -1.035655 0.246009 -12.180971 87 | 86 -58.977956 -1.029360 0.172355 -15.271534 88 | 87 -58.617234 -1.023064 0.096208 -20.335770 89 | 88 -58.256513 -1.016768 0.054263 -25.309974 90 | 89 -57.895792 -1.010472 0.118200 -18.547620 91 | 90 -57.535070 -1.004176 0.210197 -13.547485 92 | 91 -57.174349 -0.997881 0.305155 -10.309580 93 | 92 -56.813627 -0.991585 0.396274 -8.040082 94 | 93 -56.452906 -0.985289 0.477632 -6.418128 95 | 94 -56.092184 -0.978993 0.542691 -5.308949 96 | 95 -55.731463 -0.972698 0.584254 -4.667963 97 | 96 -55.370741 -0.966402 0.594947 -4.510435 98 | 97 -55.010020 -0.960106 0.568278 -4.908781 99 | 98 -54.649299 -0.953810 0.500712 -6.008236 100 | 99 -54.288577 -0.947514 0.396218 -8.041312 101 | 100 -53.927856 -0.941219 0.280267 -11.048571 102 | 101 -53.567134 -0.934923 0.240489 -12.378111 103 | 102 -53.206413 -0.928627 0.343952 -9.270049 104 | 103 -52.845691 -0.922331 0.485799 -6.270862 105 | 104 -52.484970 -0.916036 0.577898 -4.762977 106 | 105 -52.124248 -0.909740 0.574575 -4.813071 107 | 106 -51.763527 -0.903444 0.474489 -6.475471 108 | 107 -51.402806 -0.897148 0.352722 -9.051343 109 | 108 -51.042084 -0.890852 0.307978 -10.229614 110 | 109 -50.681363 -0.884557 0.227687 -12.853230 111 | 110 -50.320641 -0.878261 0.051572 -25.751692 112 | 111 -49.959920 -0.871965 0.237975 -12.469378 113 | 112 -49.599198 -0.865669 0.087146 -21.195044 114 | 113 -49.238477 -0.859374 0.393364 -8.104115 115 | 114 -48.877756 -0.853078 0.302125 -10.396259 116 | 115 -48.517034 -0.846782 0.177476 -15.017183 117 | 116 -48.156313 -0.840486 0.208083 -13.635274 118 | 117 -47.795591 -0.834190 0.039369 -28.096925 119 | 118 -47.434870 -0.827895 0.510859 -5.833976 120 | 119 -47.074148 -0.821599 0.174490 -15.164608 121 | 120 -46.713427 -0.815303 0.226161 -12.911644 122 | 121 -46.352705 -0.809007 0.299087 -10.484035 123 | 122 -45.991984 -0.802712 0.350097 -9.116232 124 | 123 -45.631263 -0.796416 0.030521 -30.308053 125 | 124 -45.270541 -0.790120 0.303972 -10.343324 126 | 125 -44.909820 -0.783824 0.089081 -21.004280 127 | 126 -44.549098 -0.777528 0.176826 -15.049101 128 | 127 -44.188377 -0.771233 0.419930 -7.536457 129 | 128 -43.827655 -0.764937 0.386306 -8.261363 130 | 129 -43.466934 -0.758641 0.308920 -10.203068 131 | 130 -43.106212 -0.752345 0.541918 -5.321328 132 | 131 -42.745491 -0.746050 0.102034 -19.825097 133 | 132 -42.384770 -0.739754 0.144529 -16.800890 134 | 133 -42.024048 -0.733458 0.177610 -15.010666 135 | 134 -41.663327 -0.727162 0.031956 -29.908942 136 | 135 -41.302605 -0.720866 0.036989 -28.638566 137 | 136 -40.941884 -0.714571 0.562948 -4.990637 138 | 137 -40.581162 -0.708275 0.253865 -11.907931 139 | 138 -40.220441 -0.701979 0.506565 -5.907299 140 | 139 -39.859719 -0.695683 0.550163 -5.190179 141 | 140 -39.498998 -0.689388 0.226246 -12.908395 142 | 141 -39.138277 -0.683092 0.265736 -11.510996 143 | 142 -38.777555 -0.676796 0.346535 -9.205058 144 | 143 -38.416834 -0.670500 0.345687 -9.226350 145 | 144 -38.056112 -0.664204 0.422926 -7.474721 146 | 145 -37.695391 -0.657909 0.519928 -5.681130 147 | 146 -37.334669 -0.651613 0.547758 -5.228223 148 | 147 -36.973948 -0.645317 0.503305 -5.963377 149 | 148 -36.613226 -0.639021 0.439817 -7.134564 150 | 149 -36.252505 -0.632726 0.433138 -7.267470 151 | 150 -35.891784 -0.626430 0.508785 -5.869306 152 | 151 -35.531062 -0.620134 0.620781 -4.141237 153 | 152 -35.170341 -0.613838 0.723994 -2.805302 154 | 153 -34.809619 -0.607542 0.796873 -1.972216 155 | 154 -34.448898 -0.601247 0.832730 -1.589920 156 | 155 -34.088176 -0.594951 0.832557 -1.591715 157 | 156 -33.727455 -0.588655 0.801164 -1.925569 158 | 157 -33.366733 -0.582359 0.745036 -2.556451 159 | 158 -33.006012 -0.576064 0.671159 -3.463490 160 | 159 -32.645291 -0.569768 0.586443 -4.635477 161 | 160 -32.284569 -0.563472 0.497611 -6.062208 162 | 161 -31.923848 -0.557176 0.411514 -7.712309 163 | 162 -31.563126 -0.550880 0.335940 -9.474761 164 | 163 -31.202405 -0.544585 0.280504 -11.041225 165 | 164 -30.841683 -0.538289 0.255088 -11.866216 166 | 165 -30.480962 -0.531993 0.262425 -11.619905 167 | 166 -30.120240 -0.525697 0.293695 -10.642083 168 | 167 -29.759519 -0.519402 0.336601 -9.457696 169 | 168 -29.398798 -0.513106 0.382499 -8.347404 170 | 169 -29.038076 -0.506810 0.426667 -7.398229 171 | 170 -28.677355 -0.500514 0.466755 -6.618214 172 | 171 -28.316633 -0.494218 0.501687 -5.991335 173 | 172 -27.955912 -0.487923 0.531068 -5.496991 174 | 173 -27.595190 -0.481627 0.554881 -5.116002 175 | 174 -27.234469 -0.475331 0.573321 -4.832041 176 | 175 -26.873747 -0.469035 0.586703 -4.631629 177 | 176 -26.513026 -0.462740 0.595406 -4.503739 178 | 177 -26.152305 -0.456444 0.599836 -4.439352 179 | 178 -25.791583 -0.450148 0.600408 -4.431077 180 | 179 -25.430862 -0.443852 0.597529 -4.472825 181 | 180 -25.070140 -0.437556 0.591591 -4.559564 182 | 181 -24.709419 -0.431261 0.582967 -4.687121 183 | 182 -24.348697 -0.424965 0.572003 -4.852031 184 | 183 -23.987976 -0.418669 0.559022 -5.051414 185 | 184 -23.627255 -0.412373 0.544322 -5.282885 186 | 185 -23.266533 -0.406078 0.528173 -5.544472 187 | 186 -22.905812 -0.399782 0.510825 -5.834562 188 | 187 -22.545090 -0.393486 0.492502 -6.151848 189 | 188 -22.184369 -0.387190 0.473408 -6.495290 190 | 189 -21.823647 -0.380895 0.453728 -6.864080 191 | 190 -21.462926 -0.374599 0.433630 -7.257613 192 | 191 -21.102204 -0.368303 0.413264 -7.675453 193 | 192 -20.741483 -0.362007 0.392767 -8.117311 194 | 193 -20.380762 -0.355711 0.372263 -8.583006 195 | 194 -20.020040 -0.349416 0.351867 -9.072427 196 | 195 -19.659319 -0.343120 0.331685 -9.585485 197 | 196 -19.298597 -0.336824 0.311816 -10.122038 198 | 197 -18.937876 -0.330528 0.292355 -10.681798 199 | 198 -18.577154 -0.324233 0.273395 -11.264189 200 | 199 -18.216433 -0.317937 0.255030 -11.868160 201 | 200 -17.855711 -0.311641 0.237359 -12.491903 202 | 201 -17.494990 -0.305345 0.220484 -13.132475 203 | 202 -17.134269 -0.299049 0.204520 -13.785281 204 | 203 -16.773547 -0.292754 0.189596 -14.443405 205 | 204 -16.412826 -0.286458 0.175857 -15.096820 206 | 205 -16.052104 -0.280162 0.163464 -15.731566 207 | 206 -15.691383 -0.273866 0.152595 -16.329197 208 | 207 -15.330661 -0.267571 0.143434 -16.866951 209 | 208 -14.969940 -0.261275 0.136155 -17.319306 210 | 209 -14.609218 -0.254979 0.130897 -17.661386 211 | 210 -14.248497 -0.248683 0.127734 -17.873857 212 | 211 -13.887776 -0.242387 0.126652 -17.947774 213 | 212 -13.527054 -0.236092 0.127540 -17.887077 214 | 213 -13.166333 -0.229796 0.130206 -17.707373 215 | 214 -12.805611 -0.223500 0.134405 -17.431691 216 | 215 -12.444890 -0.217204 0.139872 -17.085356 217 | 216 -12.084168 -0.210909 0.146354 -16.691937 218 | 217 -11.723447 -0.204613 0.153620 -16.271053 219 | 218 -11.362725 -0.198317 0.161477 -15.837764 220 | 219 -11.002004 -0.192021 0.169767 -15.402936 221 | 220 -10.641283 -0.185725 0.178361 -14.974001 222 | 221 -10.280561 -0.179430 0.187159 -14.555774 223 | 222 -9.919840 -0.173134 0.196084 -14.151170 224 | 223 -9.559118 -0.166838 0.205074 -13.761773 225 | 224 -9.198397 -0.160542 0.214086 -13.388254 226 | 225 -8.837675 -0.154247 0.223083 -13.030681 227 | 226 -8.476954 -0.147951 0.232040 -12.688734 228 | 227 -8.116232 -0.141655 0.240939 -12.361849 229 | 228 -7.755511 -0.135359 0.249766 -12.049328 230 | 229 -7.394790 -0.129063 0.258511 -11.750403 231 | 230 -7.034068 -0.122768 0.267169 -11.464283 232 | 231 -6.673347 -0.116472 0.275734 -11.190189 233 | 232 -6.312625 -0.110176 0.284205 -10.927368 234 | 233 -5.951904 -0.103880 0.292580 -10.675112 235 | 234 -5.591182 -0.097585 0.300858 -10.432762 236 | 235 -5.230461 -0.091289 0.309040 -10.199714 237 | 236 -4.869739 -0.084993 0.317124 -9.975419 238 | 237 -4.509018 -0.078697 0.325110 -9.759387 239 | 238 -4.148297 -0.072401 0.332997 -9.551184 240 | 239 -3.787575 -0.066106 0.340783 -9.350432 241 | 240 -3.426854 -0.059810 0.348465 -9.156807 242 | 241 -3.066132 -0.053514 0.356039 -8.970040 243 | 242 -2.705411 -0.047218 0.363500 -8.789913 244 | 243 -2.344689 -0.040923 0.370841 -8.616256 245 | 244 -1.983968 -0.034627 0.378053 -8.448950 246 | 245 -1.623246 -0.028331 0.385127 -8.287923 247 | 246 -1.262525 -0.022035 0.392051 -8.133147 248 | 247 -0.901804 -0.015739 0.398812 -7.984642 249 | 248 -0.541082 -0.009444 0.405393 -7.842468 250 | 249 -0.180361 -0.003148 0.411778 -7.706732 251 | 250 0.180361 0.003148 0.417947 -7.577582 252 | 251 0.541082 0.009444 0.423877 -7.455208 253 | 252 0.901804 0.015739 0.429544 -7.339845 254 | 253 1.262525 0.022035 0.434922 -7.231767 255 | 254 1.623246 0.028331 0.439982 -7.131297 256 | 255 1.983968 0.034627 0.444693 -7.038800 257 | 256 2.344689 0.040923 0.449020 -6.954687 258 | 257 2.705411 0.047218 0.452928 -6.879419 259 | 258 3.066132 0.053514 0.456378 -6.813510 260 | 259 3.426854 0.059810 0.459329 -6.757526 261 | 260 3.787575 0.066106 0.461738 -6.712095 262 | 261 4.148297 0.072401 0.463559 -6.677908 263 | 262 4.509018 0.078697 0.464744 -6.655725 264 | 263 4.869739 0.084993 0.465244 -6.646388 265 | 264 5.230461 0.091289 0.465006 -6.650822 266 | 265 5.591182 0.097585 0.463978 -6.670053 267 | 266 5.951904 0.103880 0.462104 -6.705214 268 | 267 6.312625 0.110176 0.459327 -6.757569 269 | 268 6.673347 0.116472 0.455590 -6.828523 270 | 269 7.034068 0.122768 0.450835 -6.919651 271 | 270 7.394790 0.129063 0.445004 -7.032726 272 | 271 7.755511 0.135359 0.438039 -7.169751 273 | 272 8.116232 0.141655 0.429883 -7.333003 274 | 273 8.476954 0.147951 0.420480 -7.525088 275 | 274 8.837675 0.154247 0.409779 -7.749009 276 | 275 9.198397 0.160542 0.397729 -8.008252 277 | 276 9.559118 0.166838 0.384286 -8.306899 278 | 277 9.919840 0.173134 0.369412 -8.649776 279 | 278 10.280561 0.179430 0.353076 -9.042643 280 | 279 10.641283 0.185725 0.335256 -9.492458 281 | 280 11.002004 0.192021 0.315947 -10.007724 282 | 281 11.362725 0.198317 0.295156 -10.598975 283 | 282 11.723447 0.204613 0.272916 -11.279429 284 | 283 12.084168 0.210909 0.249290 -12.065898 285 | 284 12.444890 0.217204 0.224389 -12.979983 286 | 285 12.805611 0.223500 0.198393 -14.049462 287 | 286 13.166333 0.229796 0.171609 -15.309181 288 | 287 13.527054 0.236092 0.144574 -16.798194 289 | 288 13.887776 0.242387 0.118305 -18.539961 290 | 289 14.248497 0.248683 0.094883 -20.456259 291 | 290 14.609218 0.254979 0.078552 -22.096902 292 | 291 14.969940 0.261275 0.075588 -22.430931 293 | 292 15.330661 0.267571 0.088315 -21.079296 294 | 293 15.691383 0.273866 0.111953 -19.019303 295 | 294 16.052104 0.280162 0.141220 -17.002097 296 | 295 16.412826 0.286458 0.173102 -15.233976 297 | 296 16.773547 0.292754 0.205979 -13.723532 298 | 297 17.134269 0.299049 0.238844 -12.437697 299 | 298 17.494990 0.305345 0.270947 -11.342328 300 | 299 17.855711 0.311641 0.301642 -10.410156 301 | 300 18.216433 0.317937 0.330332 -9.620989 302 | 301 18.577154 0.324233 0.356432 -8.960466 303 | 302 18.937876 0.330528 0.379367 -8.418810 304 | 303 19.298597 0.336824 0.398571 -7.989892 305 | 304 19.659319 0.343120 0.413497 -7.670561 306 | 305 20.020040 0.349416 0.423633 -7.460197 307 | 306 20.380762 0.355711 0.428529 -7.360401 308 | 307 20.741483 0.362007 0.427821 -7.374751 309 | 308 21.102204 0.368303 0.421284 -7.508505 310 | 309 21.462926 0.374599 0.408881 -7.768054 311 | 310 21.823647 0.380895 0.390854 -8.159710 312 | 311 22.184369 0.387190 0.367834 -8.686956 313 | 312 22.545090 0.393486 0.341021 -9.344369 314 | 313 22.905812 0.399782 0.312430 -10.104944 315 | 314 23.266533 0.406078 0.285200 -10.897007 316 | 315 23.627255 0.412373 0.263770 -11.575495 317 | 316 23.987976 0.418669 0.253302 -11.927221 318 | 317 24.348697 0.424965 0.257638 -11.779817 319 | 318 24.709419 0.431261 0.276792 -11.156926 320 | 319 25.070140 0.437556 0.306793 -10.263082 321 | 320 25.430862 0.443852 0.341858 -9.323090 322 | 321 25.791583 0.450148 0.376274 -8.489918 323 | 322 26.152305 0.456444 0.405073 -7.849342 324 | 323 26.513026 0.462740 0.424104 -7.450561 325 | 324 26.873747 0.469035 0.430034 -7.329936 326 | 325 27.234469 0.475331 0.420433 -7.526060 327 | 326 27.595190 0.481627 0.393939 -8.091416 328 | 327 27.955912 0.487923 0.350483 -9.106670 329 | 328 28.316633 0.494218 0.291503 -10.707128 330 | 329 28.677355 0.500514 0.220116 -13.146982 331 | 330 29.038076 0.506810 0.141189 -17.004002 332 | 331 29.398798 0.513106 0.061679 -24.197286 333 | 332 29.759519 0.519402 0.022412 -32.990459 334 | 333 30.120240 0.525697 0.078606 -22.090935 335 | 334 30.480962 0.531993 0.119003 -18.488854 336 | 335 30.841683 0.538289 0.134063 -17.453827 337 | 336 31.202405 0.544585 0.121174 -18.331808 338 | 337 31.563126 0.550880 0.083145 -21.603271 339 | 338 31.923848 0.557176 0.047584 -26.450798 340 | 339 32.284569 0.563472 0.100462 -19.959943 341 | 340 32.645291 0.569768 0.190287 -14.411825 342 | 341 33.006012 0.576064 0.275864 -11.186103 343 | 342 33.366733 0.582359 0.331132 -9.599985 344 | 343 33.727455 0.588655 0.328498 -9.669354 345 | 344 34.088176 0.594951 0.253359 -11.925262 346 | 345 34.448898 0.601247 0.168797 -15.452689 347 | 346 34.809619 0.607542 0.263276 -11.591765 348 | 347 35.170341 0.613838 0.381566 -8.368599 349 | 348 35.531062 0.620134 0.334284 -9.517695 350 | 349 35.891784 0.626430 0.087530 -21.156846 351 | 350 36.252505 0.632726 0.201687 -13.906444 352 | 351 36.613226 0.639021 0.246688 -12.157034 353 | 352 36.973948 0.645317 0.220799 -13.120063 354 | 353 37.334669 0.651613 0.512958 -5.798369 355 | 354 37.695391 0.657909 0.317250 -9.971973 356 | 355 38.056112 0.664204 0.305387 -10.302982 357 | 356 38.416834 0.670500 0.025271 -31.947441 358 | 357 38.777555 0.676796 0.397711 -8.008654 359 | 358 39.138277 0.683092 0.324956 -9.763498 360 | 359 39.498998 0.689388 0.081717 -21.753711 361 | 360 39.859719 0.695683 0.051958 -25.687005 362 | 361 40.220441 0.701979 0.170152 -15.383238 363 | 362 40.581162 0.708275 0.189171 -14.462910 364 | 363 40.941884 0.714571 0.285364 -10.892012 365 | 364 41.302605 0.720866 0.252057 -11.970042 366 | 365 41.663327 0.727162 0.356515 -8.958446 367 | 366 42.024048 0.733458 0.319701 -9.905116 368 | 367 42.384770 0.739754 0.404431 -7.863110 369 | 368 42.745491 0.746050 0.131757 -17.604497 370 | 369 43.106212 0.752345 0.539357 -5.362477 371 | 370 43.466934 0.758641 0.311820 -10.121922 372 | 371 43.827655 0.764937 0.194664 -14.214295 373 | 372 44.188377 0.771233 0.193483 -14.267152 374 | 373 44.549098 0.777528 0.323511 -9.802208 375 | 374 44.909820 0.783824 0.377136 -8.470048 376 | 375 45.270541 0.790120 0.508796 -5.869119 377 | 376 45.631263 0.796416 0.057116 -24.864822 378 | 377 45.991984 0.802712 0.200984 -13.936791 379 | 378 46.352705 0.809007 0.253530 -11.919398 380 | 379 46.713427 0.815303 0.179660 -14.910975 381 | 380 47.074148 0.821599 0.051731 -25.724943 382 | 381 47.434870 0.827895 0.494274 -6.120645 383 | 382 47.795591 0.834190 0.373913 -8.544579 384 | 383 48.156313 0.840486 0.280406 -11.044258 385 | 384 48.517034 0.846782 0.358544 -8.909161 386 | 385 48.877756 0.853078 0.338861 -9.399568 387 | 386 49.238477 0.859374 0.216454 -13.292685 388 | 387 49.599198 0.865669 0.131224 -17.639723 389 | 388 49.959920 0.871965 0.268629 -11.416957 390 | 389 50.320641 0.878261 0.186632 -14.580259 391 | 390 50.681363 0.884557 0.497470 -6.064663 392 | 391 51.042084 0.890852 0.250550 -12.022096 393 | 392 51.402806 0.897148 0.112863 -18.948990 394 | 393 51.763527 0.903444 0.529234 -5.527042 395 | 394 52.124248 0.909740 0.321881 -9.846101 396 | 395 52.484970 0.916036 0.445231 -7.028288 397 | 396 52.845691 0.922331 0.067877 -23.365516 398 | 397 53.206413 0.928627 0.305508 -10.299536 399 | 398 53.567134 0.934923 0.235965 -12.543064 400 | 399 53.927856 0.941219 0.249968 -12.042297 401 | 400 54.288577 0.947514 0.406166 -7.825922 402 | 401 54.649299 0.953810 0.334397 -9.514741 403 | 402 55.010020 0.960106 0.136172 -17.318247 404 | 403 55.370741 0.966402 0.052392 -25.614683 405 | 404 55.731463 0.972698 0.072651 -22.775195 406 | 405 56.092184 0.978993 0.035711 -28.944079 407 | 406 56.452906 0.985289 0.162423 -15.787067 408 | 407 56.813627 0.991585 0.274418 -11.231744 409 | 408 57.174349 0.997881 0.317431 -9.967022 410 | 409 57.535070 1.004176 0.282196 -10.988997 411 | 410 57.895792 1.010472 0.187718 -14.529871 412 | 411 58.256513 1.016768 0.067921 -23.359907 413 | 412 58.617234 1.023064 0.056622 -24.940243 414 | 413 58.977956 1.029360 0.139627 -17.100616 415 | 414 59.338677 1.035655 0.180335 -14.878398 416 | 415 59.699399 1.041951 0.174652 -15.156534 417 | 416 60.060120 1.048247 0.131573 -17.616655 418 | 417 60.420842 1.054543 0.083918 -21.522865 419 | 418 60.781563 1.060838 0.118456 -18.528883 420 | 419 61.142285 1.067134 0.212541 -13.451127 421 | 420 61.503006 1.073430 0.312315 -10.108132 422 | 421 61.863727 1.079726 0.400849 -7.940389 423 | 422 62.224449 1.086022 0.470328 -6.551976 424 | 423 62.585170 1.092317 0.517043 -5.729467 425 | 424 62.945892 1.098613 0.540192 -5.349036 426 | 425 63.306613 1.104909 0.541220 -5.332526 427 | 426 63.667335 1.111205 0.523288 -5.625185 428 | 427 64.028056 1.117500 0.490864 -6.180783 429 | 428 64.388778 1.123796 0.449445 -6.946478 430 | 429 64.749499 1.130092 0.405406 -7.842187 431 | 430 65.110220 1.136388 0.365814 -8.734786 432 | 431 65.470942 1.142684 0.337712 -9.429077 433 | 432 65.831663 1.148979 0.326255 -9.728865 434 | 433 66.192385 1.155275 0.332311 -9.569103 435 | 434 66.553106 1.161571 0.352105 -9.066556 436 | 435 66.913828 1.167867 0.379677 -8.411713 437 | 436 67.274549 1.174162 0.409497 -7.754995 438 | 437 67.635271 1.180458 0.437507 -7.180294 439 | 438 67.995992 1.186754 0.461091 -6.724258 440 | 439 68.356713 1.193050 0.478726 -6.398262 441 | 440 68.717435 1.199345 0.489660 -6.202112 442 | 441 69.078156 1.205641 0.493678 -6.131133 443 | 442 69.438878 1.211937 0.490935 -6.179526 444 | 443 69.799599 1.218233 0.481844 -6.341871 445 | 444 70.160321 1.224529 0.466997 -6.613725 446 | 445 70.521042 1.230824 0.447108 -6.991754 447 | 446 70.881764 1.237120 0.422981 -7.473589 448 | 447 71.242485 1.243416 0.395486 -8.057370 449 | 448 71.603206 1.249712 0.365559 -8.740851 450 | 449 71.963928 1.256007 0.334208 -9.519664 451 | 450 72.324649 1.262303 0.302549 -10.384078 452 | 451 72.685371 1.268599 0.271858 -11.313161 453 | 452 73.046092 1.274895 0.243636 -12.265177 454 | 453 73.406814 1.281191 0.219657 -13.165094 455 | 454 73.767535 1.287486 0.201887 -13.897847 456 | 455 74.128257 1.293782 0.192109 -14.329052 457 | 456 74.488978 1.300078 0.191253 -14.367814 458 | 457 74.849699 1.306374 0.198875 -14.028393 459 | 458 75.210421 1.312669 0.213352 -13.418058 460 | 459 75.571142 1.318965 0.232626 -12.666829 461 | 460 75.931864 1.325261 0.254822 -11.875263 462 | 461 76.292585 1.331557 0.278485 -11.103953 463 | 462 76.653307 1.337853 0.302571 -10.383452 464 | 463 77.014028 1.344148 0.326352 -9.726276 465 | 464 77.374749 1.350444 0.349329 -9.135309 466 | 465 77.735471 1.356740 0.371163 -8.608714 467 | 466 78.096192 1.363036 0.391626 -8.142566 468 | 467 78.456914 1.369331 0.410572 -7.732206 469 | 468 78.817635 1.375627 0.427912 -7.372906 470 | 469 79.178357 1.381923 0.443600 -7.060175 471 | 470 79.539078 1.388219 0.457621 -6.789882 472 | 471 79.899800 1.394515 0.469986 -6.558296 473 | 472 80.260521 1.400810 0.480725 -6.362067 474 | 473 80.621242 1.407106 0.489880 -6.198205 475 | 474 80.981964 1.413402 0.497506 -6.064036 476 | 475 81.342685 1.419698 0.503665 -5.957173 477 | 476 81.703407 1.425993 0.508424 -5.875473 478 | 477 82.064128 1.432289 0.511858 -5.817009 479 | 478 82.424850 1.438585 0.514041 -5.780043 480 | 479 82.785571 1.444881 0.515051 -5.762998 481 | 480 83.146293 1.451177 0.514965 -5.764440 482 | 481 83.507014 1.457472 0.513863 -5.783054 483 | 482 83.867735 1.463768 0.511821 -5.817633 484 | 483 84.228457 1.470064 0.508917 -5.867059 485 | 484 84.589178 1.476360 0.505226 -5.930293 486 | 485 84.949900 1.482655 0.500820 -6.006363 487 | 486 85.310621 1.488951 0.495772 -6.094353 488 | 487 85.671343 1.495247 0.490151 -6.193395 489 | 488 86.032064 1.501543 0.484024 -6.302663 490 | 489 86.392786 1.507839 0.477454 -6.421361 491 | 490 86.753507 1.514134 0.470505 -6.548721 492 | 491 87.114228 1.520430 0.463234 -6.683995 493 | 492 87.474950 1.526726 0.455698 -6.826452 494 | 493 87.835671 1.533022 0.447952 -6.975371 495 | 494 88.196393 1.539317 0.440046 -7.130037 496 | 495 88.557114 1.545613 0.432029 -7.289741 497 | 496 88.917836 1.551909 0.423947 -7.453772 498 | 497 89.278557 1.558205 0.415843 -7.621420 499 | 498 89.639279 1.564501 0.407757 -7.791969 500 | 499 90.000000 1.570796 0.399728 -7.964701 501 | -------------------------------------------------------------------------------- /Fixed_Beamformer/beamPattern.gnuplot: -------------------------------------------------------------------------------- 1 | reset 2 | unset key 3 | set xlabel "arrival Angle (degrees)" font "arial, 12" 4 | set ylabel "gain(dB)" font "arial,12" 5 | set grid lc rgbcolor "#BBBBBB" 6 | plot 'beamPattern.dat' u 2:5 w l 7 | -------------------------------------------------------------------------------- /Fixed_Beamformer/beamforming: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kreiley/Beamforming/0b1ed3f58d3820be28cba28d508adf6fb2025057/Fixed_Beamformer/beamforming -------------------------------------------------------------------------------- /Fixed_Beamformer/delay.c: -------------------------------------------------------------------------------- 1 | /****************DELAY.C*******************************/ 2 | #include "delay.h" 3 | #include "math.h" 4 | #include "FixedBeamformer.h" 5 | #include "delaytest.h" 6 | 7 | #define MAX_BUF_SIZE 64000 8 | 9 | /***************************************************************************** 10 | * Fractional delay line implementation in C: 11 | * 12 | * ---------[d_mix]-------------------------- 13 | * | | 14 | * | | 15 | * |x1 v 16 | * xin ------>[+]----->[z^-M]--[interp.]----[d_fw]-------->[+]-----> yout 17 | * ^ | 18 | * | | 19 | * |----------[d_fb]<--------| 20 | *******************************************************************************/ 21 | 22 | double d_buffer[MAX_BUF_SIZE]; 23 | 24 | /* 25 | This interface defines the delay object 26 | */ 27 | static struct fract_delay { 28 | double d_mix; /*delay blend parameter*/ 29 | short d_samples; /*delay duration in samples*/ 30 | double d_fb; /*feedback volume*/ 31 | double d_fw; /*delay tap mix volume*/ 32 | double n_fract; /*fractional part of the delay*/ 33 | double *rdPtr; /*delay read pointer*/ 34 | double *wrtPtr; /*delay write pointer*/ 35 | }; 36 | 37 | static struct fract_delay del; 38 | 39 | /* 40 | This function is used to initialize the delay object 41 | */ 42 | void Delay_Init(double delay_samples,double dfb,double dfw, double dmix) { 43 | Delay_set_delay(delay_samples); 44 | Delay_set_fb(dfb); 45 | Delay_set_fw(dfw); 46 | Delay_set_mix(dmix); 47 | del.wrtPtr = &d_buffer[MAX_BUF_SIZE-1]; 48 | } 49 | 50 | /* 51 | These functions are used as interface to the delay object, 52 | so there's not direct access to the delay object from 53 | external modules 54 | */ 55 | void Delay_set_fb(double val) { 56 | del.d_fb = val; 57 | } 58 | 59 | void Delay_set_fw(double val) { 60 | del.d_fw = val; 61 | } 62 | 63 | void Delay_set_mix(double val) { 64 | del.d_mix = val; 65 | } 66 | 67 | void Delay_set_delay(double n_delay) { 68 | /*Get the integer part of the delay*/ 69 | del.d_samples = (short)floor(n_delay); 70 | 71 | /*gets the fractional part of the delay*/ 72 | del.n_fract = (n_delay - del.d_samples); 73 | } 74 | 75 | double Delay_get_fb(void) { 76 | return del.d_fb; 77 | } 78 | 79 | double Delay_get_fw(void) { 80 | return del.d_fw; 81 | } 82 | 83 | double Delay_get_mix(void) { 84 | return del.d_mix; 85 | } 86 | 87 | /* 88 | This is the main delay task, 89 | */ 90 | double Delay_task(double xin) { 91 | double yout; 92 | double * y0; 93 | double * y1; 94 | double x1; 95 | double x_est; 96 | 97 | /*Calculates current read pointer position*/ 98 | del.rdPtr = del.wrtPtr - (short)del.d_samples; 99 | 100 | /*Wraps read pointer*/ 101 | if (del.rdPtr < d_buffer) { 102 | del.rdPtr += MAX_BUF_SIZE-1; 103 | } 104 | 105 | /*Linear interpolation to estimate the delay + the fractional part*/ 106 | y0 = del.rdPtr-1; 107 | y1 = del.rdPtr; 108 | 109 | if (y0 < d_buffer) { 110 | y0 += MAX_BUF_SIZE-1; 111 | } 112 | 113 | x_est = (*(y0) - *(y1))*del.n_fract + *(y1); 114 | 115 | /*Calculate next value to store in buffer*/ 116 | x1 = xin + x_est*del.d_fb; 117 | 118 | /*Store value in buffer*/ 119 | *(del.wrtPtr) = x1; 120 | 121 | /*Output value calculation*/ 122 | yout = x1*del.d_mix + x_est*del.d_fw; 123 | 124 | /*Increment delat write pointer*/ 125 | del.wrtPtr++; 126 | 127 | /*Wraps delay write pointer*/ 128 | if ((del.wrtPtr-&d_buffer[0]) > MAX_BUF_SIZE-1) { 129 | del.wrtPtr = &d_buffer[0]; 130 | } 131 | return yout; 132 | } 133 | 134 | 135 | -------------------------------------------------------------------------------- /Fixed_Beamformer/delay.h: -------------------------------------------------------------------------------- 1 | /***********DELAY.h*************************************/ 2 | #ifndef __DELAY_H__ 3 | #define __DELAY_H__ 4 | 5 | void Delay_Init(double delay_samples,double dfb,double dfw, double dmix); 6 | void Delay_set_fb(double val); 7 | void Delay_set_fw(double val); 8 | void Delay_set_mix(double val); 9 | void Delay_set_delay(double n_delay); 10 | double Delay_get_fb(void); 11 | double Delay_get_fw(void); 12 | double Delay_get_mix(void); 13 | double Delay_task(double xin); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Fixed_Beamformer/delaytest.c: -------------------------------------------------------------------------------- 1 | #include "delay.h" 2 | #include "math.h" 3 | #include "FixedBeamformer.h" 4 | 5 | void delaytest(void); 6 | double get_delay(void); 7 | 8 | /*****USAGE EXAMPLE****************************************/ 9 | void delaytest(void) { 10 | double xin; 11 | double yout; 12 | Delay_Init(get_delay(),0.7,0.7,1); 13 | 14 | while(1) { 15 | //if (new_sample_flag()) { 16 | /*When there's new sample at your ADC or CODEC input*/ 17 | /*Read the sample*/ 18 | // xin = read_sample(); 19 | /*Apply the Delay_task function to the sample*/ 20 | //yout = Delay_task(xin); 21 | 22 | /*Send the output value to your ADC or codec output*/ 23 | //write_output(yout); 24 | // } 25 | 26 | } 27 | } 28 | 29 | double get_delay(){ 30 | return 85.6; 31 | } 32 | -------------------------------------------------------------------------------- /Fixed_Beamformer/delaytest.h: -------------------------------------------------------------------------------- 1 | /***********DELAYTEST.h*************************************/ 2 | #ifndef __DELAYTEST_H__ 3 | #define __DELAYTEST_H__ 4 | 5 | void delaytest(void); 6 | double get_delay(void); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Fixed_Beamformer/polar.gnuplot: -------------------------------------------------------------------------------- 1 | reset 2 | set angles degrees 3 | set polar 4 | set grid polar 30 lc rgbcolor "#999999" 5 | unset border 6 | unset param 7 | set size ratio 1 1,1 8 | set xtics axis nomirror -50,10 9 | unset ytics 10 | unset key 11 | set style data line 12 | set xrange[-50:50] 13 | set yrange[-50:50] 14 | set rrange[-50:0] 15 | set label 1 "0°" at graph 1.01,0.5 front 16 | set label 2 "180°" at graph -0.01,0.5 right front 17 | set label 3 "-90°" at graph 0.5,-0.03 center front 18 | set label 4 "90°" at graph 0.5,1.03 center front 19 | plot 'beamPattern.dat' u 2:5 20 | -------------------------------------------------------------------------------- /Fixed_Beamformer/sinc.gnuplot: -------------------------------------------------------------------------------- 1 | h(x)=sin(pi*x)/(pi*x) 2 | set xrange[-50:50] 3 | set yrange[-0.3:1.1] 4 | set samples 1000 5 | set grid 6 | unset key 7 | plot h(x) 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Beamforming 2 | Delay Sum Algorithim for Beamforming microphone array of eight 3 | Fixed Beamformer Manually select sound location 4 | Adaptive Beamformer find sound location and then amplify and attenuate the sound 5 | takes input from adc 6 | puts output in form of digital 7 | -------------------------------------------------------------------------------- /fixed_beamformer/.out.txt.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kreiley/Beamforming/0b1ed3f58d3820be28cba28d508adf6fb2025057/fixed_beamformer/.out.txt.swo -------------------------------------------------------------------------------- /fixed_beamformer/Beamforming: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kreiley/Beamforming/0b1ed3f58d3820be28cba28d508adf6fb2025057/fixed_beamformer/Beamforming -------------------------------------------------------------------------------- /fixed_beamformer/Beamforming.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "delay_sound.h" 5 | #include "FixedBeamformer.c" 6 | #include "FixedBeamformer.h" 7 | #include "localization.h" 8 | #include 9 | #include "Beamforming.h" 10 | 11 | #define ANGLE_RESOLUTION 500 // Number of angle points to calculate 12 | #define number_of_mics 8 13 | #define feedback_volume .4 14 | #define mix_volume .35 15 | #define blend_parameter .4 16 | #define buffer_size 100 17 | #define BUFFER_SIZE 64000 18 | 19 | double freq = 16000; //frequency of data input 20 | double speed_of_sound = 340.3; //speed of sound at sea level 21 | int filterLength = 11; //Numer of FIR filter taps for fractional delay(shouled be odd) 22 | double angle = 0; 23 | double volume = .75; 24 | bool turn_off = false; 25 | char mode = 'M'; 26 | microphone * m1; 27 | microphone * m2; 28 | microphone * m3; 29 | 30 | void run(double * in); 31 | void delays_init(); 32 | void localization_init(); 33 | void change_delay(); 34 | double locate(double * buffer1, double * buffer2, double * buffer3, int buf_size); 35 | void sin_test(); 36 | void print_delay_info(); 37 | 38 | int main(int argc, char* argv[]){ 39 | if(argc == 2){angle = atof(argv[1]);} 40 | if(argc == 3){angle = atof(argv[1]); volume = atof(argv[2]);} 41 | if(argc == 4){angle = atof(argv[1]); volume = atof(argv[2]); mode = argv[3][0];} 42 | mic_array_init(); 43 | delays_init(); 44 | print_delay_info(); 45 | localization_init(); 46 | sin_test(); 47 | //run(in); 48 | } 49 | 50 | void run(double * in){ 51 | double sum = 0; 52 | double output = 0; 53 | int buf = 0; 54 | double * buffer1 = malloc(sizeof(double *) * buffer_size); 55 | double * buffer2 = malloc(sizeof(double *) * buffer_size); 56 | double * buffer3 = malloc(sizeof(double *) * buffer_size); 57 | while(!turn_off){ 58 | double sum; 59 | sum = delay_out(delays[0], in[0]); 60 | sum+= delay_out(delays[1], in[1]); 61 | sum+= delay_out(delays[2], in[2]); 62 | sum+= delay_out(delays[3], in[3]); 63 | sum+= delay_out(delays[4], in[4]); 64 | sum+= delay_out(delays[5], in[5]); 65 | sum+= delay_out(delays[6], in[6]); 66 | sum+= delay_out(delays[7], in[7]); 67 | output = sum/number_of_mics; 68 | buf++; 69 | buffer1[buf] = in[4]; 70 | buffer2[buf] = in[6]; 71 | buffer3[buf] = in[7]; 72 | if(buf == buffer_size){ 73 | angle = locate(buffer1, buffer2, buffer3, buffer_size); 74 | change_delay(); 75 | buf = 0; 76 | } 77 | } 78 | } 79 | 80 | void delays_init(){ 81 | calculate_delay(angle); 82 | for(int i =0; i < number_of_mics; i++){ 83 | double num_of_samples_to_delay = (freq * get_current_delay(i))/speed_of_sound; 84 | double fractional = fmod(num_of_samples_to_delay,1); 85 | delays[i] = delay_init(num_of_samples_to_delay,fractional, feedback_volume, mix_volume,blend_parameter, i); 86 | } 87 | } 88 | 89 | void localization_init(){ 90 | m1 = build_mic(get_x(4), get_y(4)); 91 | m2 = build_mic(get_x(6), get_y(6)); 92 | m3 = build_mic(get_x(7), get_y(7)); 93 | init_triangle(m1,m2,m3); 94 | set_buffer_size(buffer_size); 95 | 96 | } 97 | 98 | void change_delay(){ 99 | calculate_delay(angle); 100 | for(int i = 0; i < number_of_mics; i++){ 101 | double num_of_samples_to_delay = (freq * get_current_delay(i))/speed_of_sound; 102 | double fractional = fmod(num_of_samples_to_delay, 1); 103 | delay_set_delay(delays[i], num_of_samples_to_delay, fractional); 104 | } 105 | } 106 | 107 | double locate(double * buffer1, double * buffer2, double * buffer3, int buf_size){ 108 | set_buffer(m1, buffer1); 109 | set_buffer(m2, buffer2); 110 | set_buffer(m3, buffer3); 111 | set_buffer_size(buf_size); 112 | return find_source(m1,m2,m3); 113 | } 114 | 115 | void print_delay_info(){ 116 | for(int i =0; i 2 | #include 3 | #include "delay.h" 4 | #include "delaytest.h" 5 | 6 | #define num_mics 8 7 | 8 | typedef struct mic_array{ 9 | double x; 10 | double y; 11 | double delay_for_E; 12 | double delay_for_NE; 13 | double delay_for_N; 14 | double delay_for_NW; 15 | double delay_for_W; 16 | double delay_for_SW; 17 | double delay_for_S; 18 | double delay_for_SE; 19 | double current_delay; 20 | } mic_array; 21 | 22 | static mic_array mics[num_mics]; 23 | /* 24 | double x_positions = {}; 25 | double y_positions = {}; 26 | */ 27 | //void calculate_delay(double angle); 28 | //void mic_array_init(); 29 | //double get_current_delay(int mic_number); 30 | 31 | void calculate_delay(double angle){ 32 | printf("\nAngle is : %f\n",angle); 33 | if(fmod(angle,45) != 0){ 34 | double m = tan((angle*M_PI)/180); 35 | printf("\nSlope is : %f\n",m); 36 | double perp_m; 37 | perp_m = -1/m; 38 | printf("\nPerp Slope is : %f\n",perp_m); 39 | for(int i = 0; i < num_mics; i++){ 40 | double b = mics[i].y - perp_m * mics[i].x ; 41 | printf("\nb = %f , b/2 =%f\n m + perp_m = %f",b, b/2, m+perp_m); 42 | double x = b/(perp_m + m); 43 | double y = m * x; 44 | double c = sqrt(pow(x,2) + pow(y,2)); 45 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 46 | if(y < 0){c = c * -1;} 47 | mics[i].current_delay = c; 48 | } 49 | } 50 | else if (fmod(angle, 360) == 0){ 51 | for(int i = 0; i < num_mics; i++){ 52 | mics[i].current_delay = mics[i].x; 53 | } 54 | } 55 | else if (fmod(angle, 180) == 0){ 56 | for(int i = 0; i < num_mics; i++){ 57 | mics[i].current_delay = -mics[i].x; 58 | } 59 | } 60 | else if (fmod(angle, 270) == 0){ 61 | for(int i = 0; i < num_mics; i++){ 62 | mics[i].current_delay = -mics[i].y; 63 | } 64 | } 65 | else if (fmod(angle, 90) == 0){ 66 | for(int i = 0; i < num_mics; i++){ 67 | mics[i].current_delay = mics[i].y; 68 | } 69 | } 70 | else if (fmod(angle, 135) == 0){ 71 | for(int i = 0; i < num_mics; i++){ 72 | double b = mics[i].y - mics[i].x ; 73 | double x; 74 | if(mics[i].y - mics[i].x == 0) {x = 0; b =0;} 75 | else{x = -b/2;} 76 | double y = -1 * x; 77 | double c = sqrt(2)* x; 78 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 79 | if(y < 0){c = c * -1;} 80 | mics[i].current_delay = c; 81 | } 82 | } 83 | else if (fmod(angle, 45) == 0){ 84 | for(int i = 0; i < num_mics; i++){ 85 | double b = mics[i].y + mics[i].x ; 86 | double x; 87 | if(mics[i].y + mics[i].x == 0) {x = 0; b =0;} 88 | else{x = b/2;} 89 | double y = x; 90 | double c = sqrt(2)* x; 91 | printf("\nb = %f, x = %f, y=%f,c=%f",b,x,y,c); 92 | if(y < 0){c = c * -1;} 93 | mics[i].current_delay = c; 94 | } 95 | } 96 | double temp = mics[0].current_delay; 97 | for(int i =1; i< num_mics; i++){ 98 | if(mics[i].current_delay < temp){ 99 | temp = mics[i].current_delay; 100 | } 101 | } 102 | for(int i =0; i < num_mics; i++){ 103 | mics[i].current_delay = mics[i].current_delay - temp; 104 | } 105 | } 106 | 107 | void mic_array_init(){ 108 | printf("\n Microphone Positions:\n"); 109 | for(int i = 0; i < num_mics-1; i++){ 110 | double theta = i * M_PI/4; 111 | double a =.01; 112 | double b =.8; 113 | double shift = -.5; 114 | mics[i].x = a*cos(theta - shift) * exp(b*(theta-shift)); 115 | mics[i].y = a*sin(theta - shift) * exp(b*(theta - shift)); 116 | } 117 | mics[num_mics-1].x = 0.489641; 118 | mics[num_mics-1].y = 0.08055; 119 | printf("\nx =\n"); 120 | for(int i = 0; i < num_mics; i++){printf("%f\n",mics[i].x);} 121 | printf("\ny =\n"); 122 | for(int i = 0; i < num_mics; i++){printf("%f\n",mics[i].y);} 123 | } 124 | 125 | double get_current_delay(int mic_number){ 126 | return mics[mic_number].current_delay; 127 | } 128 | 129 | double get_x(int mic_number){ 130 | return mics[mic_number].x; 131 | } 132 | 133 | double get_y(int mic_number){ 134 | return mics[mic_number].y; 135 | } 136 | -------------------------------------------------------------------------------- /fixed_beamformer/FixedBeamformer.h: -------------------------------------------------------------------------------- 1 | /***********FixedBeamformer.h*************************************/ 2 | #ifndef __FIXEDBEAMFORMER_H__ 3 | #define __FIXEDBEAMFORMER_H__ 4 | 5 | extern void mic_array_init(); 6 | extern void calculate_delay(double angle); 7 | extern double get_current_delay(int mic_number); 8 | extern double get_x(int mic_number); 9 | extern double get_y(int mic_number); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /fixed_beamformer/beamPattern.dat: -------------------------------------------------------------------------------- 1 | 0 -90.000000 -1.570796 0.399728 -7.964701 2 | 1 -89.639279 -1.564501 0.391792 -8.138895 3 | 2 -89.278557 -1.558205 0.383980 -8.313823 4 | 3 -88.917836 -1.551909 0.376324 -8.488758 5 | 4 -88.557114 -1.545613 0.368851 -8.662974 6 | 5 -88.196393 -1.539317 0.361587 -8.835746 7 | 6 -87.835671 -1.533022 0.354554 -9.006360 8 | 7 -87.474950 -1.526726 0.347772 -9.174114 9 | 8 -87.114228 -1.520430 0.341259 -9.338322 10 | 9 -86.753507 -1.514134 0.335030 -9.498328 11 | 10 -86.392786 -1.507839 0.329098 -9.653503 12 | 11 -86.032064 -1.501543 0.323472 -9.803256 13 | 12 -85.671343 -1.495247 0.318162 -9.947042 14 | 13 -85.310621 -1.488951 0.313171 -10.084364 15 | 14 -84.949900 -1.482655 0.308504 -10.214782 16 | 15 -84.589178 -1.476360 0.304162 -10.337911 17 | 16 -84.228457 -1.470064 0.300143 -10.453433 18 | 17 -83.867735 -1.463768 0.296446 -10.561087 19 | 18 -83.507014 -1.457472 0.293067 -10.660676 20 | 19 -83.146293 -1.451177 0.289999 -10.752062 21 | 20 -82.785571 -1.444881 0.287238 -10.835162 22 | 21 -82.424850 -1.438585 0.284776 -10.909940 23 | 22 -82.064128 -1.432289 0.282605 -10.976402 24 | 23 -81.703407 -1.425993 0.280718 -11.034586 25 | 24 -81.342685 -1.419698 0.279108 -11.084553 26 | 25 -80.981964 -1.413402 0.277767 -11.126374 27 | 26 -80.621242 -1.407106 0.276690 -11.160125 28 | 27 -80.260521 -1.400810 0.275871 -11.185869 29 | 28 -79.899800 -1.394515 0.275307 -11.203651 30 | 29 -79.539078 -1.388219 0.274995 -11.213488 31 | 30 -79.178357 -1.381923 0.274936 -11.215361 32 | 31 -78.817635 -1.375627 0.275131 -11.209204 33 | 32 -78.456914 -1.369331 0.275584 -11.194907 34 | 33 -78.096192 -1.363036 0.276302 -11.172304 35 | 34 -77.735471 -1.356740 0.277294 -11.141180 36 | 35 -77.374749 -1.350444 0.278572 -11.101266 37 | 36 -77.014028 -1.344148 0.280148 -11.052248 38 | 37 -76.653307 -1.337853 0.282040 -10.993771 39 | 38 -76.292585 -1.331557 0.284268 -10.925449 40 | 39 -75.931864 -1.325261 0.286851 -10.846879 41 | 40 -75.571142 -1.318965 0.289813 -10.757652 42 | 41 -75.210421 -1.312669 0.293178 -10.657375 43 | 42 -74.849699 -1.306374 0.296972 -10.545684 44 | 43 -74.488978 -1.300078 0.301222 -10.422268 45 | 44 -74.128257 -1.293782 0.305954 -10.286886 46 | 45 -73.767535 -1.287486 0.311194 -10.139387 47 | 46 -73.406814 -1.281191 0.316967 -9.979731 48 | 47 -73.046092 -1.274895 0.323296 -9.807997 49 | 48 -72.685371 -1.268599 0.330202 -9.624402 50 | 49 -72.324649 -1.262303 0.337703 -9.429307 51 | 50 -71.963928 -1.256007 0.345811 -9.223221 52 | 51 -71.603206 -1.249712 0.354536 -9.006800 53 | 52 -71.242485 -1.243416 0.363880 -8.780847 54 | 53 -70.881764 -1.237120 0.373839 -8.546303 55 | 54 -70.521042 -1.230824 0.384404 -8.304238 56 | 55 -70.160321 -1.224529 0.395556 -8.055842 57 | 56 -69.799599 -1.218233 0.407267 -7.802413 58 | 57 -69.438878 -1.211937 0.419501 -7.545345 59 | 58 -69.078156 -1.205641 0.432209 -7.286124 60 | 59 -68.717435 -1.199345 0.445332 -7.026314 61 | 60 -68.356713 -1.193050 0.458798 -6.767561 62 | 61 -67.995992 -1.186754 0.472521 -6.511587 63 | 62 -67.635271 -1.180458 0.486396 -6.260198 64 | 63 -67.274549 -1.174162 0.500306 -6.015291 65 | 64 -66.913828 -1.167867 0.514111 -5.778868 66 | 65 -66.553106 -1.161571 0.527651 -5.553058 67 | 66 -66.192385 -1.155275 0.540746 -5.340140 68 | 67 -65.831663 -1.148979 0.553186 -5.142580 69 | 68 -65.470942 -1.142684 0.564737 -4.963073 70 | 69 -65.110220 -1.136388 0.575135 -4.804600 71 | 70 -64.749499 -1.130092 0.584084 -4.670496 72 | 71 -64.388778 -1.123796 0.591253 -4.564536 73 | 72 -64.028056 -1.117500 0.596276 -4.491056 74 | 73 -63.667335 -1.111205 0.598750 -4.455092 75 | 74 -63.306613 -1.104909 0.598234 -4.462582 76 | 75 -62.945892 -1.098613 0.594249 -4.520629 77 | 76 -62.585170 -1.092317 0.586282 -4.637865 78 | 77 -62.224449 -1.086022 0.573788 -4.824965 79 | 78 -61.863727 -1.079726 0.556198 -5.095407 80 | 79 -61.503006 -1.073430 0.532930 -5.466599 81 | 80 -61.142285 -1.067134 0.503404 -5.961668 82 | 81 -60.781563 -1.060838 0.467068 -6.612398 83 | 82 -60.420842 -1.054543 0.423430 -7.464365 84 | 83 -60.060120 -1.048247 0.372109 -8.586592 85 | 84 -59.699399 -1.041951 0.312916 -10.091456 86 | 85 -59.338677 -1.035655 0.246009 -12.180971 87 | 86 -58.977956 -1.029360 0.172355 -15.271534 88 | 87 -58.617234 -1.023064 0.096208 -20.335770 89 | 88 -58.256513 -1.016768 0.054263 -25.309974 90 | 89 -57.895792 -1.010472 0.118200 -18.547620 91 | 90 -57.535070 -1.004176 0.210197 -13.547485 92 | 91 -57.174349 -0.997881 0.305155 -10.309580 93 | 92 -56.813627 -0.991585 0.396274 -8.040082 94 | 93 -56.452906 -0.985289 0.477632 -6.418128 95 | 94 -56.092184 -0.978993 0.542691 -5.308949 96 | 95 -55.731463 -0.972698 0.584254 -4.667963 97 | 96 -55.370741 -0.966402 0.594947 -4.510435 98 | 97 -55.010020 -0.960106 0.568278 -4.908781 99 | 98 -54.649299 -0.953810 0.500712 -6.008236 100 | 99 -54.288577 -0.947514 0.396218 -8.041312 101 | 100 -53.927856 -0.941219 0.280267 -11.048571 102 | 101 -53.567134 -0.934923 0.240489 -12.378111 103 | 102 -53.206413 -0.928627 0.343952 -9.270049 104 | 103 -52.845691 -0.922331 0.485799 -6.270862 105 | 104 -52.484970 -0.916036 0.577898 -4.762977 106 | 105 -52.124248 -0.909740 0.574575 -4.813071 107 | 106 -51.763527 -0.903444 0.474489 -6.475471 108 | 107 -51.402806 -0.897148 0.352722 -9.051343 109 | 108 -51.042084 -0.890852 0.307978 -10.229614 110 | 109 -50.681363 -0.884557 0.227687 -12.853230 111 | 110 -50.320641 -0.878261 0.051572 -25.751692 112 | 111 -49.959920 -0.871965 0.237975 -12.469378 113 | 112 -49.599198 -0.865669 0.087146 -21.195044 114 | 113 -49.238477 -0.859374 0.393364 -8.104115 115 | 114 -48.877756 -0.853078 0.302125 -10.396259 116 | 115 -48.517034 -0.846782 0.177476 -15.017183 117 | 116 -48.156313 -0.840486 0.208083 -13.635274 118 | 117 -47.795591 -0.834190 0.039369 -28.096925 119 | 118 -47.434870 -0.827895 0.510859 -5.833976 120 | 119 -47.074148 -0.821599 0.174490 -15.164608 121 | 120 -46.713427 -0.815303 0.226161 -12.911644 122 | 121 -46.352705 -0.809007 0.299087 -10.484035 123 | 122 -45.991984 -0.802712 0.350097 -9.116232 124 | 123 -45.631263 -0.796416 0.030521 -30.308053 125 | 124 -45.270541 -0.790120 0.303972 -10.343324 126 | 125 -44.909820 -0.783824 0.089081 -21.004280 127 | 126 -44.549098 -0.777528 0.176826 -15.049101 128 | 127 -44.188377 -0.771233 0.419930 -7.536457 129 | 128 -43.827655 -0.764937 0.386306 -8.261363 130 | 129 -43.466934 -0.758641 0.308920 -10.203068 131 | 130 -43.106212 -0.752345 0.541918 -5.321328 132 | 131 -42.745491 -0.746050 0.102034 -19.825097 133 | 132 -42.384770 -0.739754 0.144529 -16.800890 134 | 133 -42.024048 -0.733458 0.177610 -15.010666 135 | 134 -41.663327 -0.727162 0.031956 -29.908942 136 | 135 -41.302605 -0.720866 0.036989 -28.638566 137 | 136 -40.941884 -0.714571 0.562948 -4.990637 138 | 137 -40.581162 -0.708275 0.253865 -11.907931 139 | 138 -40.220441 -0.701979 0.506565 -5.907299 140 | 139 -39.859719 -0.695683 0.550163 -5.190179 141 | 140 -39.498998 -0.689388 0.226246 -12.908395 142 | 141 -39.138277 -0.683092 0.265736 -11.510996 143 | 142 -38.777555 -0.676796 0.346535 -9.205058 144 | 143 -38.416834 -0.670500 0.345687 -9.226350 145 | 144 -38.056112 -0.664204 0.422926 -7.474721 146 | 145 -37.695391 -0.657909 0.519928 -5.681130 147 | 146 -37.334669 -0.651613 0.547758 -5.228223 148 | 147 -36.973948 -0.645317 0.503305 -5.963377 149 | 148 -36.613226 -0.639021 0.439817 -7.134564 150 | 149 -36.252505 -0.632726 0.433138 -7.267470 151 | 150 -35.891784 -0.626430 0.508785 -5.869306 152 | 151 -35.531062 -0.620134 0.620781 -4.141237 153 | 152 -35.170341 -0.613838 0.723994 -2.805302 154 | 153 -34.809619 -0.607542 0.796873 -1.972216 155 | 154 -34.448898 -0.601247 0.832730 -1.589920 156 | 155 -34.088176 -0.594951 0.832557 -1.591715 157 | 156 -33.727455 -0.588655 0.801164 -1.925569 158 | 157 -33.366733 -0.582359 0.745036 -2.556451 159 | 158 -33.006012 -0.576064 0.671159 -3.463490 160 | 159 -32.645291 -0.569768 0.586443 -4.635477 161 | 160 -32.284569 -0.563472 0.497611 -6.062208 162 | 161 -31.923848 -0.557176 0.411514 -7.712309 163 | 162 -31.563126 -0.550880 0.335940 -9.474761 164 | 163 -31.202405 -0.544585 0.280504 -11.041225 165 | 164 -30.841683 -0.538289 0.255088 -11.866216 166 | 165 -30.480962 -0.531993 0.262425 -11.619905 167 | 166 -30.120240 -0.525697 0.293695 -10.642083 168 | 167 -29.759519 -0.519402 0.336601 -9.457696 169 | 168 -29.398798 -0.513106 0.382499 -8.347404 170 | 169 -29.038076 -0.506810 0.426667 -7.398229 171 | 170 -28.677355 -0.500514 0.466755 -6.618214 172 | 171 -28.316633 -0.494218 0.501687 -5.991335 173 | 172 -27.955912 -0.487923 0.531068 -5.496991 174 | 173 -27.595190 -0.481627 0.554881 -5.116002 175 | 174 -27.234469 -0.475331 0.573321 -4.832041 176 | 175 -26.873747 -0.469035 0.586703 -4.631629 177 | 176 -26.513026 -0.462740 0.595406 -4.503739 178 | 177 -26.152305 -0.456444 0.599836 -4.439352 179 | 178 -25.791583 -0.450148 0.600408 -4.431077 180 | 179 -25.430862 -0.443852 0.597529 -4.472825 181 | 180 -25.070140 -0.437556 0.591591 -4.559564 182 | 181 -24.709419 -0.431261 0.582967 -4.687121 183 | 182 -24.348697 -0.424965 0.572003 -4.852031 184 | 183 -23.987976 -0.418669 0.559022 -5.051414 185 | 184 -23.627255 -0.412373 0.544322 -5.282885 186 | 185 -23.266533 -0.406078 0.528173 -5.544472 187 | 186 -22.905812 -0.399782 0.510825 -5.834562 188 | 187 -22.545090 -0.393486 0.492502 -6.151848 189 | 188 -22.184369 -0.387190 0.473408 -6.495290 190 | 189 -21.823647 -0.380895 0.453728 -6.864080 191 | 190 -21.462926 -0.374599 0.433630 -7.257613 192 | 191 -21.102204 -0.368303 0.413264 -7.675453 193 | 192 -20.741483 -0.362007 0.392767 -8.117311 194 | 193 -20.380762 -0.355711 0.372263 -8.583006 195 | 194 -20.020040 -0.349416 0.351867 -9.072427 196 | 195 -19.659319 -0.343120 0.331685 -9.585485 197 | 196 -19.298597 -0.336824 0.311816 -10.122038 198 | 197 -18.937876 -0.330528 0.292355 -10.681798 199 | 198 -18.577154 -0.324233 0.273395 -11.264189 200 | 199 -18.216433 -0.317937 0.255030 -11.868160 201 | 200 -17.855711 -0.311641 0.237359 -12.491903 202 | 201 -17.494990 -0.305345 0.220484 -13.132475 203 | 202 -17.134269 -0.299049 0.204520 -13.785281 204 | 203 -16.773547 -0.292754 0.189596 -14.443405 205 | 204 -16.412826 -0.286458 0.175857 -15.096820 206 | 205 -16.052104 -0.280162 0.163464 -15.731566 207 | 206 -15.691383 -0.273866 0.152595 -16.329197 208 | 207 -15.330661 -0.267571 0.143434 -16.866951 209 | 208 -14.969940 -0.261275 0.136155 -17.319306 210 | 209 -14.609218 -0.254979 0.130897 -17.661386 211 | 210 -14.248497 -0.248683 0.127734 -17.873857 212 | 211 -13.887776 -0.242387 0.126652 -17.947774 213 | 212 -13.527054 -0.236092 0.127540 -17.887077 214 | 213 -13.166333 -0.229796 0.130206 -17.707373 215 | 214 -12.805611 -0.223500 0.134405 -17.431691 216 | 215 -12.444890 -0.217204 0.139872 -17.085356 217 | 216 -12.084168 -0.210909 0.146354 -16.691937 218 | 217 -11.723447 -0.204613 0.153620 -16.271053 219 | 218 -11.362725 -0.198317 0.161477 -15.837764 220 | 219 -11.002004 -0.192021 0.169767 -15.402936 221 | 220 -10.641283 -0.185725 0.178361 -14.974001 222 | 221 -10.280561 -0.179430 0.187159 -14.555774 223 | 222 -9.919840 -0.173134 0.196084 -14.151170 224 | 223 -9.559118 -0.166838 0.205074 -13.761773 225 | 224 -9.198397 -0.160542 0.214086 -13.388254 226 | 225 -8.837675 -0.154247 0.223083 -13.030681 227 | 226 -8.476954 -0.147951 0.232040 -12.688734 228 | 227 -8.116232 -0.141655 0.240939 -12.361849 229 | 228 -7.755511 -0.135359 0.249766 -12.049328 230 | 229 -7.394790 -0.129063 0.258511 -11.750403 231 | 230 -7.034068 -0.122768 0.267169 -11.464283 232 | 231 -6.673347 -0.116472 0.275734 -11.190189 233 | 232 -6.312625 -0.110176 0.284205 -10.927368 234 | 233 -5.951904 -0.103880 0.292580 -10.675112 235 | 234 -5.591182 -0.097585 0.300858 -10.432762 236 | 235 -5.230461 -0.091289 0.309040 -10.199714 237 | 236 -4.869739 -0.084993 0.317124 -9.975419 238 | 237 -4.509018 -0.078697 0.325110 -9.759387 239 | 238 -4.148297 -0.072401 0.332997 -9.551184 240 | 239 -3.787575 -0.066106 0.340783 -9.350432 241 | 240 -3.426854 -0.059810 0.348465 -9.156807 242 | 241 -3.066132 -0.053514 0.356039 -8.970040 243 | 242 -2.705411 -0.047218 0.363500 -8.789913 244 | 243 -2.344689 -0.040923 0.370841 -8.616256 245 | 244 -1.983968 -0.034627 0.378053 -8.448950 246 | 245 -1.623246 -0.028331 0.385127 -8.287923 247 | 246 -1.262525 -0.022035 0.392051 -8.133147 248 | 247 -0.901804 -0.015739 0.398812 -7.984642 249 | 248 -0.541082 -0.009444 0.405393 -7.842468 250 | 249 -0.180361 -0.003148 0.411778 -7.706732 251 | 250 0.180361 0.003148 0.417947 -7.577582 252 | 251 0.541082 0.009444 0.423877 -7.455208 253 | 252 0.901804 0.015739 0.429544 -7.339845 254 | 253 1.262525 0.022035 0.434922 -7.231767 255 | 254 1.623246 0.028331 0.439982 -7.131297 256 | 255 1.983968 0.034627 0.444693 -7.038800 257 | 256 2.344689 0.040923 0.449020 -6.954687 258 | 257 2.705411 0.047218 0.452928 -6.879419 259 | 258 3.066132 0.053514 0.456378 -6.813510 260 | 259 3.426854 0.059810 0.459329 -6.757526 261 | 260 3.787575 0.066106 0.461738 -6.712095 262 | 261 4.148297 0.072401 0.463559 -6.677908 263 | 262 4.509018 0.078697 0.464744 -6.655725 264 | 263 4.869739 0.084993 0.465244 -6.646388 265 | 264 5.230461 0.091289 0.465006 -6.650822 266 | 265 5.591182 0.097585 0.463978 -6.670053 267 | 266 5.951904 0.103880 0.462104 -6.705214 268 | 267 6.312625 0.110176 0.459327 -6.757569 269 | 268 6.673347 0.116472 0.455590 -6.828523 270 | 269 7.034068 0.122768 0.450835 -6.919651 271 | 270 7.394790 0.129063 0.445004 -7.032726 272 | 271 7.755511 0.135359 0.438039 -7.169751 273 | 272 8.116232 0.141655 0.429883 -7.333003 274 | 273 8.476954 0.147951 0.420480 -7.525088 275 | 274 8.837675 0.154247 0.409779 -7.749009 276 | 275 9.198397 0.160542 0.397729 -8.008252 277 | 276 9.559118 0.166838 0.384286 -8.306899 278 | 277 9.919840 0.173134 0.369412 -8.649776 279 | 278 10.280561 0.179430 0.353076 -9.042643 280 | 279 10.641283 0.185725 0.335256 -9.492458 281 | 280 11.002004 0.192021 0.315947 -10.007724 282 | 281 11.362725 0.198317 0.295156 -10.598975 283 | 282 11.723447 0.204613 0.272916 -11.279429 284 | 283 12.084168 0.210909 0.249290 -12.065898 285 | 284 12.444890 0.217204 0.224389 -12.979983 286 | 285 12.805611 0.223500 0.198393 -14.049462 287 | 286 13.166333 0.229796 0.171609 -15.309181 288 | 287 13.527054 0.236092 0.144574 -16.798194 289 | 288 13.887776 0.242387 0.118305 -18.539961 290 | 289 14.248497 0.248683 0.094883 -20.456259 291 | 290 14.609218 0.254979 0.078552 -22.096902 292 | 291 14.969940 0.261275 0.075588 -22.430931 293 | 292 15.330661 0.267571 0.088315 -21.079296 294 | 293 15.691383 0.273866 0.111953 -19.019303 295 | 294 16.052104 0.280162 0.141220 -17.002097 296 | 295 16.412826 0.286458 0.173102 -15.233976 297 | 296 16.773547 0.292754 0.205979 -13.723532 298 | 297 17.134269 0.299049 0.238844 -12.437697 299 | 298 17.494990 0.305345 0.270947 -11.342328 300 | 299 17.855711 0.311641 0.301642 -10.410156 301 | 300 18.216433 0.317937 0.330332 -9.620989 302 | 301 18.577154 0.324233 0.356432 -8.960466 303 | 302 18.937876 0.330528 0.379367 -8.418810 304 | 303 19.298597 0.336824 0.398571 -7.989892 305 | 304 19.659319 0.343120 0.413497 -7.670561 306 | 305 20.020040 0.349416 0.423633 -7.460197 307 | 306 20.380762 0.355711 0.428529 -7.360401 308 | 307 20.741483 0.362007 0.427821 -7.374751 309 | 308 21.102204 0.368303 0.421284 -7.508505 310 | 309 21.462926 0.374599 0.408881 -7.768054 311 | 310 21.823647 0.380895 0.390854 -8.159710 312 | 311 22.184369 0.387190 0.367834 -8.686956 313 | 312 22.545090 0.393486 0.341021 -9.344369 314 | 313 22.905812 0.399782 0.312430 -10.104944 315 | 314 23.266533 0.406078 0.285200 -10.897007 316 | 315 23.627255 0.412373 0.263770 -11.575495 317 | 316 23.987976 0.418669 0.253302 -11.927221 318 | 317 24.348697 0.424965 0.257638 -11.779817 319 | 318 24.709419 0.431261 0.276792 -11.156926 320 | 319 25.070140 0.437556 0.306793 -10.263082 321 | 320 25.430862 0.443852 0.341858 -9.323090 322 | 321 25.791583 0.450148 0.376274 -8.489918 323 | 322 26.152305 0.456444 0.405073 -7.849342 324 | 323 26.513026 0.462740 0.424104 -7.450561 325 | 324 26.873747 0.469035 0.430034 -7.329936 326 | 325 27.234469 0.475331 0.420433 -7.526060 327 | 326 27.595190 0.481627 0.393939 -8.091416 328 | 327 27.955912 0.487923 0.350483 -9.106670 329 | 328 28.316633 0.494218 0.291503 -10.707128 330 | 329 28.677355 0.500514 0.220116 -13.146982 331 | 330 29.038076 0.506810 0.141189 -17.004002 332 | 331 29.398798 0.513106 0.061679 -24.197286 333 | 332 29.759519 0.519402 0.022412 -32.990459 334 | 333 30.120240 0.525697 0.078606 -22.090935 335 | 334 30.480962 0.531993 0.119003 -18.488854 336 | 335 30.841683 0.538289 0.134063 -17.453827 337 | 336 31.202405 0.544585 0.121174 -18.331808 338 | 337 31.563126 0.550880 0.083145 -21.603271 339 | 338 31.923848 0.557176 0.047584 -26.450798 340 | 339 32.284569 0.563472 0.100462 -19.959943 341 | 340 32.645291 0.569768 0.190287 -14.411825 342 | 341 33.006012 0.576064 0.275864 -11.186103 343 | 342 33.366733 0.582359 0.331132 -9.599985 344 | 343 33.727455 0.588655 0.328498 -9.669354 345 | 344 34.088176 0.594951 0.253359 -11.925262 346 | 345 34.448898 0.601247 0.168797 -15.452689 347 | 346 34.809619 0.607542 0.263276 -11.591765 348 | 347 35.170341 0.613838 0.381566 -8.368599 349 | 348 35.531062 0.620134 0.334284 -9.517695 350 | 349 35.891784 0.626430 0.087530 -21.156846 351 | 350 36.252505 0.632726 0.201687 -13.906444 352 | 351 36.613226 0.639021 0.246688 -12.157034 353 | 352 36.973948 0.645317 0.220799 -13.120063 354 | 353 37.334669 0.651613 0.512958 -5.798369 355 | 354 37.695391 0.657909 0.317250 -9.971973 356 | 355 38.056112 0.664204 0.305387 -10.302982 357 | 356 38.416834 0.670500 0.025271 -31.947441 358 | 357 38.777555 0.676796 0.397711 -8.008654 359 | 358 39.138277 0.683092 0.324956 -9.763498 360 | 359 39.498998 0.689388 0.081717 -21.753711 361 | 360 39.859719 0.695683 0.051958 -25.687005 362 | 361 40.220441 0.701979 0.170152 -15.383238 363 | 362 40.581162 0.708275 0.189171 -14.462910 364 | 363 40.941884 0.714571 0.285364 -10.892012 365 | 364 41.302605 0.720866 0.252057 -11.970042 366 | 365 41.663327 0.727162 0.356515 -8.958446 367 | 366 42.024048 0.733458 0.319701 -9.905116 368 | 367 42.384770 0.739754 0.404431 -7.863110 369 | 368 42.745491 0.746050 0.131757 -17.604497 370 | 369 43.106212 0.752345 0.539357 -5.362477 371 | 370 43.466934 0.758641 0.311820 -10.121922 372 | 371 43.827655 0.764937 0.194664 -14.214295 373 | 372 44.188377 0.771233 0.193483 -14.267152 374 | 373 44.549098 0.777528 0.323511 -9.802208 375 | 374 44.909820 0.783824 0.377136 -8.470048 376 | 375 45.270541 0.790120 0.508796 -5.869119 377 | 376 45.631263 0.796416 0.057116 -24.864822 378 | 377 45.991984 0.802712 0.200984 -13.936791 379 | 378 46.352705 0.809007 0.253530 -11.919398 380 | 379 46.713427 0.815303 0.179660 -14.910975 381 | 380 47.074148 0.821599 0.051731 -25.724943 382 | 381 47.434870 0.827895 0.494274 -6.120645 383 | 382 47.795591 0.834190 0.373913 -8.544579 384 | 383 48.156313 0.840486 0.280406 -11.044258 385 | 384 48.517034 0.846782 0.358544 -8.909161 386 | 385 48.877756 0.853078 0.338861 -9.399568 387 | 386 49.238477 0.859374 0.216454 -13.292685 388 | 387 49.599198 0.865669 0.131224 -17.639723 389 | 388 49.959920 0.871965 0.268629 -11.416957 390 | 389 50.320641 0.878261 0.186632 -14.580259 391 | 390 50.681363 0.884557 0.497470 -6.064663 392 | 391 51.042084 0.890852 0.250550 -12.022096 393 | 392 51.402806 0.897148 0.112863 -18.948990 394 | 393 51.763527 0.903444 0.529234 -5.527042 395 | 394 52.124248 0.909740 0.321881 -9.846101 396 | 395 52.484970 0.916036 0.445231 -7.028288 397 | 396 52.845691 0.922331 0.067877 -23.365516 398 | 397 53.206413 0.928627 0.305508 -10.299536 399 | 398 53.567134 0.934923 0.235965 -12.543064 400 | 399 53.927856 0.941219 0.249968 -12.042297 401 | 400 54.288577 0.947514 0.406166 -7.825922 402 | 401 54.649299 0.953810 0.334397 -9.514741 403 | 402 55.010020 0.960106 0.136172 -17.318247 404 | 403 55.370741 0.966402 0.052392 -25.614683 405 | 404 55.731463 0.972698 0.072651 -22.775195 406 | 405 56.092184 0.978993 0.035711 -28.944079 407 | 406 56.452906 0.985289 0.162423 -15.787067 408 | 407 56.813627 0.991585 0.274418 -11.231744 409 | 408 57.174349 0.997881 0.317431 -9.967022 410 | 409 57.535070 1.004176 0.282196 -10.988997 411 | 410 57.895792 1.010472 0.187718 -14.529871 412 | 411 58.256513 1.016768 0.067921 -23.359907 413 | 412 58.617234 1.023064 0.056622 -24.940243 414 | 413 58.977956 1.029360 0.139627 -17.100616 415 | 414 59.338677 1.035655 0.180335 -14.878398 416 | 415 59.699399 1.041951 0.174652 -15.156534 417 | 416 60.060120 1.048247 0.131573 -17.616655 418 | 417 60.420842 1.054543 0.083918 -21.522865 419 | 418 60.781563 1.060838 0.118456 -18.528883 420 | 419 61.142285 1.067134 0.212541 -13.451127 421 | 420 61.503006 1.073430 0.312315 -10.108132 422 | 421 61.863727 1.079726 0.400849 -7.940389 423 | 422 62.224449 1.086022 0.470328 -6.551976 424 | 423 62.585170 1.092317 0.517043 -5.729467 425 | 424 62.945892 1.098613 0.540192 -5.349036 426 | 425 63.306613 1.104909 0.541220 -5.332526 427 | 426 63.667335 1.111205 0.523288 -5.625185 428 | 427 64.028056 1.117500 0.490864 -6.180783 429 | 428 64.388778 1.123796 0.449445 -6.946478 430 | 429 64.749499 1.130092 0.405406 -7.842187 431 | 430 65.110220 1.136388 0.365814 -8.734786 432 | 431 65.470942 1.142684 0.337712 -9.429077 433 | 432 65.831663 1.148979 0.326255 -9.728865 434 | 433 66.192385 1.155275 0.332311 -9.569103 435 | 434 66.553106 1.161571 0.352105 -9.066556 436 | 435 66.913828 1.167867 0.379677 -8.411713 437 | 436 67.274549 1.174162 0.409497 -7.754995 438 | 437 67.635271 1.180458 0.437507 -7.180294 439 | 438 67.995992 1.186754 0.461091 -6.724258 440 | 439 68.356713 1.193050 0.478726 -6.398262 441 | 440 68.717435 1.199345 0.489660 -6.202112 442 | 441 69.078156 1.205641 0.493678 -6.131133 443 | 442 69.438878 1.211937 0.490935 -6.179526 444 | 443 69.799599 1.218233 0.481844 -6.341871 445 | 444 70.160321 1.224529 0.466997 -6.613725 446 | 445 70.521042 1.230824 0.447108 -6.991754 447 | 446 70.881764 1.237120 0.422981 -7.473589 448 | 447 71.242485 1.243416 0.395486 -8.057370 449 | 448 71.603206 1.249712 0.365559 -8.740851 450 | 449 71.963928 1.256007 0.334208 -9.519664 451 | 450 72.324649 1.262303 0.302549 -10.384078 452 | 451 72.685371 1.268599 0.271858 -11.313161 453 | 452 73.046092 1.274895 0.243636 -12.265177 454 | 453 73.406814 1.281191 0.219657 -13.165094 455 | 454 73.767535 1.287486 0.201887 -13.897847 456 | 455 74.128257 1.293782 0.192109 -14.329052 457 | 456 74.488978 1.300078 0.191253 -14.367814 458 | 457 74.849699 1.306374 0.198875 -14.028393 459 | 458 75.210421 1.312669 0.213352 -13.418058 460 | 459 75.571142 1.318965 0.232626 -12.666829 461 | 460 75.931864 1.325261 0.254822 -11.875263 462 | 461 76.292585 1.331557 0.278485 -11.103953 463 | 462 76.653307 1.337853 0.302571 -10.383452 464 | 463 77.014028 1.344148 0.326352 -9.726276 465 | 464 77.374749 1.350444 0.349329 -9.135309 466 | 465 77.735471 1.356740 0.371163 -8.608714 467 | 466 78.096192 1.363036 0.391626 -8.142566 468 | 467 78.456914 1.369331 0.410572 -7.732206 469 | 468 78.817635 1.375627 0.427912 -7.372906 470 | 469 79.178357 1.381923 0.443600 -7.060175 471 | 470 79.539078 1.388219 0.457621 -6.789882 472 | 471 79.899800 1.394515 0.469986 -6.558296 473 | 472 80.260521 1.400810 0.480725 -6.362067 474 | 473 80.621242 1.407106 0.489880 -6.198205 475 | 474 80.981964 1.413402 0.497506 -6.064036 476 | 475 81.342685 1.419698 0.503665 -5.957173 477 | 476 81.703407 1.425993 0.508424 -5.875473 478 | 477 82.064128 1.432289 0.511858 -5.817009 479 | 478 82.424850 1.438585 0.514041 -5.780043 480 | 479 82.785571 1.444881 0.515051 -5.762998 481 | 480 83.146293 1.451177 0.514965 -5.764440 482 | 481 83.507014 1.457472 0.513863 -5.783054 483 | 482 83.867735 1.463768 0.511821 -5.817633 484 | 483 84.228457 1.470064 0.508917 -5.867059 485 | 484 84.589178 1.476360 0.505226 -5.930293 486 | 485 84.949900 1.482655 0.500820 -6.006363 487 | 486 85.310621 1.488951 0.495772 -6.094353 488 | 487 85.671343 1.495247 0.490151 -6.193395 489 | 488 86.032064 1.501543 0.484024 -6.302663 490 | 489 86.392786 1.507839 0.477454 -6.421361 491 | 490 86.753507 1.514134 0.470505 -6.548721 492 | 491 87.114228 1.520430 0.463234 -6.683995 493 | 492 87.474950 1.526726 0.455698 -6.826452 494 | 493 87.835671 1.533022 0.447952 -6.975371 495 | 494 88.196393 1.539317 0.440046 -7.130037 496 | 495 88.557114 1.545613 0.432029 -7.289741 497 | 496 88.917836 1.551909 0.423947 -7.453772 498 | 497 89.278557 1.558205 0.415843 -7.621420 499 | 498 89.639279 1.564501 0.407757 -7.791969 500 | 499 90.000000 1.570796 0.399728 -7.964701 501 | -------------------------------------------------------------------------------- /fixed_beamformer/beamPattern.gnuplot: -------------------------------------------------------------------------------- 1 | reset 2 | unset key 3 | set xlabel "arrival Angle (degrees)" font "arial, 12" 4 | set ylabel "gain(dB)" font "arial,12" 5 | set grid lc rgbcolor "#BBBBBB" 6 | plot 'beamPattern.dat' u 2:5 w l 7 | -------------------------------------------------------------------------------- /fixed_beamformer/beamforming: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kreiley/Beamforming/0b1ed3f58d3820be28cba28d508adf6fb2025057/fixed_beamformer/beamforming -------------------------------------------------------------------------------- /fixed_beamformer/delay.c: -------------------------------------------------------------------------------- 1 | /****************DELAY.C*******************************/ 2 | #include "delay.h" 3 | #include "math.h" 4 | #include "FixedBeamformer.h" 5 | #include "delaytest.h" 6 | 7 | #define MAX_BUF_SIZE 64000 8 | 9 | /***************************************************************************** 10 | * Fractional delay line implementation in C: 11 | * 12 | * ---------[d_mix]-------------------------- 13 | * | | 14 | * | | 15 | * |x1 v 16 | * xin ------>[+]----->[z^-M]--[interp.]----[d_fw]-------->[+]-----> yout 17 | * ^ | 18 | * | | 19 | * |----------[d_fb]<--------| 20 | *******************************************************************************/ 21 | 22 | double d_buffer[MAX_BUF_SIZE]; 23 | 24 | /* 25 | This interface defines the delay object 26 | */ 27 | static struct fract_delay { 28 | double d_mix; /*delay blend parameter*/ 29 | short d_samples; /*delay duration in samples*/ 30 | double d_fb; /*feedback volume*/ 31 | double d_fw; /*delay tap mix volume*/ 32 | double n_fract; /*fractional part of the delay*/ 33 | double *rdPtr; /*delay read pointer*/ 34 | double *wrtPtr; /*delay write pointer*/ 35 | int mic; /*microphone number */ 36 | }; 37 | 38 | static struct fract_delay del; 39 | 40 | /* 41 | This function is used to initialize the delay object 42 | */ 43 | void Delay_Init(double delay_samples,double dfb,double dfw, double dmix, int mic) { 44 | Delay_set_delay(delay_samples); 45 | Delay_set_fb(dfb); 46 | Delay_set_fw(dfw); 47 | Delay_set_mix(dmix); 48 | Delay_set_mic(mic); 49 | del.wrtPtr = &d_buffer[MAX_BUF_SIZE-1]; 50 | } 51 | 52 | /* 53 | These functions are used as interface to the delay object, 54 | so there's not direct access to the delay object from 55 | external modules 56 | */ 57 | void Delay_set_fb(double val) { 58 | del.d_fb = val; 59 | } 60 | 61 | void Delay_set_fw(double val) { 62 | del.d_fw = val; 63 | } 64 | 65 | void Delay_set_mix(double val) { 66 | del.d_mix = val; 67 | } 68 | 69 | void Delay_set_delay(double n_delay) { 70 | /*Get the integer part of the delay*/ 71 | del.d_samples = (short)floor(n_delay); 72 | 73 | /*gets the fractional part of the delay*/ 74 | del.n_fract = (n_delay - del.d_samples); 75 | } 76 | 77 | void Delay_set_mic(int mic){ 78 | del.mic = mic; 79 | } 80 | 81 | double Delay_get_fb(void) { 82 | return del.d_fb; 83 | } 84 | 85 | double Delay_get_fw(void) { 86 | return del.d_fw; 87 | } 88 | 89 | double Delay_get_mix(void) { 90 | return del.d_mix; 91 | } 92 | 93 | 94 | 95 | /* 96 | This is the main delay task, 97 | */ 98 | double Delay_task(double xin) { 99 | double yout; 100 | double * y0; 101 | double * y1; 102 | double x1; 103 | double x_est; 104 | 105 | /*Calculates current read pointer position*/ 106 | del.rdPtr = del.wrtPtr - (short)del.d_samples; 107 | 108 | /*Wraps read pointer*/ 109 | if (del.rdPtr < d_buffer) { 110 | del.rdPtr += MAX_BUF_SIZE-1; 111 | } 112 | 113 | /*Linear interpolation to estimate the delay + the fractional part*/ 114 | y0 = del.rdPtr-1; 115 | y1 = del.rdPtr; 116 | 117 | if (y0 < d_buffer) { 118 | y0 += MAX_BUF_SIZE-1; 119 | } 120 | 121 | x_est = (*(y0) - *(y1))*del.n_fract + *(y1); 122 | 123 | /*Calculate next value to store in buffer*/ 124 | x1 = xin + x_est*del.d_fb; 125 | 126 | /*Store value in buffer*/ 127 | *(del.wrtPtr) = x1; 128 | 129 | /*Output value calculation*/ 130 | yout = x1*del.d_mix + x_est*del.d_fw; 131 | 132 | /*Increment delat write pointer*/ 133 | del.wrtPtr++; 134 | 135 | /*Wraps delay write pointer*/ 136 | if ((del.wrtPtr-&d_buffer[0]) > MAX_BUF_SIZE-1) { 137 | del.wrtPtr = &d_buffer[0]; 138 | } 139 | return yout; 140 | } 141 | 142 | 143 | -------------------------------------------------------------------------------- /fixed_beamformer/delay.h: -------------------------------------------------------------------------------- 1 | /***********DELAY.h*************************************/ 2 | #ifndef __DELAY_H__ 3 | #define __DELAY_H__ 4 | 5 | void Delay_Init(double delay_samples,double dfb,double dfw, double dmix,int mic); 6 | void Delay_set_fb(double val); 7 | void Delay_set_fw(double val); 8 | void Delay_set_mix(double val); 9 | void Delay_set_delay(double n_delay); 10 | void Delay_set_mic(int mic); 11 | double Delay_get_fb(void); 12 | double Delay_get_fw(void); 13 | double Delay_get_mix(void); 14 | double Delay_task(double xin); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /fixed_beamformer/delay_sound.c: -------------------------------------------------------------------------------- 1 | #include "delay_sound.h" 2 | #include "math.h" 3 | #include "FixedBeamformer.h" 4 | #include 5 | #include "Beamforming.h" 6 | 7 | #define BUFFER_SIZE 64000 8 | #define ORDER 3 9 | 10 | delay * delay_init(double num_samples_to_delay, double fractional_delay, double fb_v, double dtm_v, double delay_blend_param, int mic) { 11 | delay *d = malloc (sizeof(delay)); 12 | if(d == NULL){return NULL;} 13 | else{ 14 | d->buffer = malloc(sizeof (double) * BUFFER_SIZE); 15 | if(d->buffer == NULL){return NULL;} 16 | else{ 17 | for(int i = 0; i < BUFFER_SIZE ; i++){ 18 | d->buffer[i] = 0; 19 | } 20 | } 21 | } 22 | delay_set_delay(d, num_samples_to_delay, fractional_delay); 23 | delay_set_feedback_volume(d, fb_v); 24 | delay_set_delay_tap_mix_volume(d, dtm_v); 25 | delay_set_blend_param(d, delay_blend_param); 26 | delay_set_mic(d, mic); 27 | d->write_pointer = &d->buffer[BUFFER_SIZE - 1]; 28 | return d; 29 | } 30 | 31 | void delay_set_delay(delay *d, double num_samples_to_delay, double fractional_delay){ 32 | if(fractional_delay > 0.5){ 33 | num_samples_to_delay +=1; 34 | fractional_delay-=1; 35 | } 36 | fractional_delay += ORDER; 37 | float tc = fractional_delay; 38 | 39 | d->thiran_coeff_1 = -3 * (tc -3)/(tc+1); 40 | d->thiran_coeff_2 = 3 * (tc-2) * (tc - 3)/((tc + 1) * (tc+2)); 41 | d->thiran_coeff_3 = -1 * (tc -1) * (tc -2) * (tc - 3)/((tc + 1) * (tc + 2) * (tc + 3)); 42 | 43 | for(int i = 0; i < ORDER; i++){ 44 | d->prev_in[i] = 0; 45 | d->prev_out[i] = 0; 46 | } 47 | 48 | d->num_samples_to_delay = num_samples_to_delay; 49 | d->fractional_delay = fractional_delay; 50 | } 51 | 52 | void delay_set_feedback_volume(delay *d,double fb_v){ 53 | d->feedback_volume = fb_v; 54 | } 55 | 56 | void delay_set_delay_tap_mix_volume(delay *d,double dtm_v){ 57 | d->delay_tap_mix_volume = dtm_v; 58 | } 59 | 60 | void delay_set_mic(delay *d,int mic){ 61 | d->mic = mic; 62 | } 63 | 64 | void delay_set_blend_param(delay *d, double delay_blend_param){ 65 | d->delay_blend_param = delay_blend_param; 66 | } 67 | 68 | void delete_delay(delay *d){ 69 | if(d != NULL){ 70 | free(d->buffer); 71 | free(d); 72 | } 73 | } 74 | 75 | double delay_out(delay *d, double in) { 76 | double out; 77 | double x; 78 | 79 | *d->write_pointer = in; 80 | 81 | /*apply integer part of delay*/ 82 | d->read_pointer = d->write_pointer - (int)d->num_samples_to_delay; 83 | 84 | /*loop buffer*/ 85 | if(d->read_pointer < d->buffer){ 86 | d->read_pointer = d->read_pointer + BUFFER_SIZE - 1; 87 | } 88 | 89 | x = *(d->read_pointer); 90 | out = (d->prev_in[0] ) 91 | + (d->prev_in[1] * d->thiran_coeff_1) 92 | + (d->prev_in[2] * d->thiran_coeff_2) 93 | + (x * d->thiran_coeff_3) 94 | - (d->prev_out[2] * d->thiran_coeff_1) 95 | - (d->prev_out[1] * d->thiran_coeff_2) 96 | - (d->prev_out[0] * d->thiran_coeff_3); 97 | 98 | d->prev_in[0] = d->prev_in[1]; 99 | d->prev_in[1] = d->prev_in[2]; 100 | d->prev_in[2] = x; 101 | d->prev_out[0] = d->prev_out[1]; 102 | d->prev_out[1] = d->prev_out[2]; 103 | d->prev_out[2] = out; 104 | 105 | 106 | d->write_pointer = d->write_pointer + 1; 107 | 108 | if((d->write_pointer - &d->buffer[0]) > BUFFER_SIZE - 1) { 109 | d->write_pointer = &d->buffer[0]; 110 | } 111 | return out; 112 | } 113 | -------------------------------------------------------------------------------- /fixed_beamformer/delay_sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __DELAY_SOUND_H__ 2 | #define __DELAY_SOUND_H__ 3 | 4 | typedef struct delay { 5 | int mic; 6 | double *read_pointer; 7 | double *write_pointer; 8 | double num_samples_to_delay; 9 | double fractional_delay; 10 | double delay_blend_param; 11 | double delay_tap_mix_volume; 12 | double feedback_volume; 13 | double thiran_coeff_1; 14 | double thiran_coeff_2; 15 | double thiran_coeff_3; 16 | double prev_in[3]; 17 | double prev_out[3]; 18 | double *buffer; 19 | } delay; 20 | 21 | 22 | extern delay * delay_init(double num_samples_to_delay, double fractional_delay, double fb_v, double dtm_v,double blend_param, int mic); 23 | extern void delay_set_delay(delay *d, double num_samples_to_delay, double fractional_delay); 24 | void delay_set_feedback_volume(delay *d, double fb_v); 25 | void delay_set_delay_tap_mix_volume(delay *d, double dtm_v); 26 | void delay_set_mic(delay *d, int mic); 27 | void delay_set_blend_param(delay *d, double delay_blend_param); 28 | extern double delay_out(delay *d, double in); 29 | //extern void change_delay(double angle); 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /fixed_beamformer/delaytest.c: -------------------------------------------------------------------------------- 1 | #include "delay.h" 2 | #include "math.h" 3 | #include "FixedBeamformer.h" 4 | 5 | void delaytest(void); 6 | double get_delay(void); 7 | 8 | /*****USAGE EXAMPLE****************************************/ 9 | void delaytest(void) { 10 | double xin; 11 | double yout; 12 | Delay_Init(get_delay(),0.7,0.7,1,1); 13 | 14 | while(1) { 15 | //if (new_sample_flag()) { 16 | /*When there's new sample at your ADC or CODEC input*/ 17 | /*Read the sample*/ 18 | // xin = read_sample(); 19 | /*Apply the Delay_task function to the sample*/ 20 | //yout = Delay_task(xin); 21 | 22 | /*Send the output value to your ADC or codec output*/ 23 | //write_output(yout); 24 | // } 25 | 26 | } 27 | } 28 | 29 | double get_delay(){ 30 | return 85.6; 31 | } 32 | -------------------------------------------------------------------------------- /fixed_beamformer/delaytest.h: -------------------------------------------------------------------------------- 1 | /***********DELAYTEST.h*************************************/ 2 | #ifndef __DELAYTEST_H__ 3 | #define __DELAYTEST_H__ 4 | 5 | void delaytest(void); 6 | double get_delay(void); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /fixed_beamformer/localization.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "localization.h" 6 | 7 | #define threshold 0.5 8 | #define speed_of_sound 343.0 9 | #define freq 16000 10 | 11 | /*must be equalateral triangle microphone array because its easier*/ 12 | 13 | int buffer_size = 0; 14 | double distance12 = 0; 15 | double distance13 = 0; 16 | double distance23 = 0; 17 | double angle12 = 0; 18 | double angle13 = 0; 19 | double angle21 = 0; 20 | double angle23 = 0; 21 | double angle31 = 0; 22 | double angle32 = 0; 23 | 24 | microphone * build_mic(double x, double y){ 25 | microphone * mic = malloc(sizeof(microphone)); 26 | mic->x = x; 27 | mic->y = y; 28 | mic->buffer = NULL; 29 | return mic; 30 | } 31 | 32 | /*tan((speed of sound * number of samples / freq)/ distance) = angle */ 33 | 34 | double find_source(microphone * m1, microphone * m2, microphone * m3){ 35 | bool done1 = false; 36 | bool done2 = false; 37 | bool done3 = false; 38 | int first = 0; 39 | int second = 0; 40 | int third = 0; 41 | int num_samples1 = -1; 42 | int num_samples2 = -1; 43 | for(int i = 0; i < buffer_size; i++){ 44 | printf("m1 = %f m2 =%f m3 =%f\n", m1->buffer[i], m2->buffer[i], m3->buffer[i]); 45 | if(!done1 && m1->buffer[i] >= threshold){ 46 | done1 = true; 47 | if(!first){first = 1;} 48 | else if(!second){second = 1;} 49 | else {third = 1;} 50 | } 51 | if(!done2 && m2->buffer[i] >= threshold){ 52 | done2 = true; 53 | if(!first){first = 2;} 54 | else if(!second){second = 2;} 55 | else {third = 2;} 56 | 57 | } 58 | if(!done3 && m3->buffer[i] >= threshold){ 59 | done3 = true; 60 | if(!first){first = 3;} 61 | else if(!second){second = 3;} 62 | else {third = 3;} 63 | 64 | } 65 | if(first > 0 && second == 0){ 66 | num_samples1++; 67 | num_samples2++; 68 | printf("num_samples1 = %d, num_samples2 = %d\n", num_samples1, num_samples2); 69 | } 70 | if(second > 0 && third == 0){ 71 | if(num_samples1 < 0){num_samples1 = 0;} 72 | num_samples2++; 73 | printf("num_samples2 = %d\n",num_samples2); 74 | } 75 | if(third > 0){ 76 | printf("\nfirst = %d, second = %d, third = %d\n", first, second, third); 77 | break; 78 | } 79 | } 80 | printf("m1 x = %f y = %f, m2 x = %f y = %f, m3 x = %f y = %f\n",m1->x,m1->y,m2->x,m2->y,m3->x,m3->y); 81 | if(num_samples1 < 0){return -1;} 82 | double delay = (speed_of_sound * num_samples1)/freq; 83 | if (first == 1 && second == 2){return calc_left (delay, distance12, angle12);} 84 | else if(first == 1 && second == 3){return calc_right(delay, distance13, angle13);} 85 | else if(first == 2 && second == 1){return calc_right(delay, distance12, angle21);} 86 | else if(first == 2 && second == 3){return calc_left (delay, distance23, angle23);} 87 | else if(first == 3 && second == 1){return calc_left (delay, distance13, angle31);} 88 | else if(first == 3 && second == 2){return calc_right(delay, distance23, angle32);} 89 | return -1; 90 | } 91 | 92 | double calc_right(double delay, double distance, double angle){ 93 | return to_degrees(asin(delay/distance) + angle + M_PI/2); 94 | } 95 | 96 | double calc_left(double delay, double distance, double angle){ 97 | return to_degrees(angle - (asin(delay/distance) + M_PI/2)); 98 | } 99 | 100 | double to_degrees (double angle){ 101 | while(angle > 2*M_PI){ 102 | angle-=(2*M_PI); 103 | } 104 | while(angle < 0){ 105 | angle+=(2*M_PI); 106 | } 107 | return angle * 180/M_PI; 108 | } 109 | 110 | void set_buffer_size(int bf_size){ 111 | buffer_size = bf_size; 112 | } 113 | 114 | void set_buffer(microphone * m1, double * buffer){ 115 | m1->buffer = buffer; 116 | } 117 | 118 | double distance_calc(microphone * m1, microphone * m2){ 119 | double a, b; 120 | a = m1->x - m2->x; 121 | b = m1->y - m2->y; 122 | return sqrt(a*a + b*b); 123 | } 124 | 125 | double degree_calc(microphone * m1, microphone *m2){ 126 | double x , y; 127 | x = m2->x - m1->x; 128 | y = m2->y - m1->y; 129 | if(x == 0 && y == 0){printf("error");return -7;} 130 | return atan2(y,x); 131 | } 132 | 133 | void init_triangle(microphone * m1, microphone * m2, microphone * m3){ 134 | angle12 = degree_calc(m1, m2); 135 | angle13 = degree_calc(m1, m3); 136 | angle21 = degree_calc(m2, m1); 137 | angle23 = degree_calc(m2, m3); 138 | angle31 = degree_calc(m3, m1); 139 | angle32 = degree_calc(m3, m2); 140 | distance12 = distance_calc(m1, m2); 141 | distance13 = distance_calc(m1, m3); 142 | distance23 = distance_calc(m2 ,m3); 143 | find_mic_3(m1,m2); 144 | } 145 | 146 | void find_mic_3(microphone * m1, microphone * m2){ 147 | double angle1 = degree_calc(m1,m2) + 1.0472; 148 | double angle2 = degree_calc(m2,m1) - 1.0472; 149 | double b1 = m1->y - tan(angle1) * m1->x; 150 | double b2 = m2->y - tan(angle2) * m2->x; 151 | printf("angle1 = %f, angle2 = %f, b1 = %f, b2 = %f \n", angle1, angle2,b1,b2); 152 | } 153 | -------------------------------------------------------------------------------- /fixed_beamformer/localization.h: -------------------------------------------------------------------------------- 1 | /***********LOCALIZATION.h*************************************/ 2 | #ifndef __LOCALIZATION_H__ 3 | #define __LOCALIZATION_H__ 4 | 5 | typedef struct microphone { 6 | double x; 7 | double y; 8 | double * buffer; 9 | } microphone; 10 | 11 | extern microphone * build_mic(double x, double y); 12 | extern double find_source(microphone * m1, microphone * m2, microphone * m3); 13 | extern void set_buffer_size(int bf_size); 14 | double distance_calc(microphone * m1, microphone * m2); 15 | double degree_calc(microphone * m1, microphone * m2); 16 | extern void init_triangle(microphone * m1, microphone * m2, microphone * m3); 17 | extern void set_buffer(microphone * m1, double * buffer); 18 | void find_mic_3(microphone * m1, microphone * m2); 19 | double calc_right(double delay, double distance, double angle); 20 | double calc_left(double delay, double distance, double angle); 21 | double to_degrees(double angle); 22 | #endif 23 | -------------------------------------------------------------------------------- /fixed_beamformer/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | 3 | TARGET = Beamforming 4 | 5 | all: $(TARGET) 6 | 7 | $(TARGET): $(TARGET).c 8 | $(CC) -g -o $(TARGET) $(TARGET).c delay_sound.c localization.c -lm 9 | 10 | clean: 11 | $(RM) $(TARGET) 12 | -------------------------------------------------------------------------------- /fixed_beamformer/out.txt: -------------------------------------------------------------------------------- 1 | 2 | Microphone Positions: 3 | 4 | x = 5 | 0.013092 6 | 0.007873 7 | -0.025130 8 | -0.094278 9 | -0.161624 10 | -0.097193 11 | 0.310235 12 | 0.489641 13 | 14 | y = 15 | 0.007152 16 | 0.026832 17 | 0.046000 18 | 0.027662 19 | -0.088296 20 | -0.331254 21 | -0.567881 22 | 0.080550 23 | 24 | Angle is : 100.000000 25 | 26 | Slope is : -5.671282 27 | 28 | Perp Slope is : 0.176327 29 | 30 | b = 0.004844 , b/2 =0.002422 31 | m + perp_m = -5.494955 32 | b = 0.004844, x = -0.000881, y=0.004999,c=0.005076 33 | b = 0.025444 , b/2 =0.012722 34 | m + perp_m = -5.494955 35 | b = 0.025444, x = -0.004630, y=0.026261,c=0.026666 36 | b = 0.050431 , b/2 =0.025215 37 | m + perp_m = -5.494955 38 | b = 0.050431, x = -0.009178, y=0.052049,c=0.052852 39 | b = 0.044286 , b/2 =0.022143 40 | m + perp_m = -5.494955 41 | b = 0.044286, x = -0.008059, y=0.045707,c=0.046412 42 | b = -0.059797 , b/2 =-0.029899 43 | m + perp_m = -5.494955 44 | b = -0.059797, x = 0.010882, y=-0.061716,c=0.062668 45 | b = -0.314117 , b/2 =-0.157058 46 | m + perp_m = -5.494955 47 | b = -0.314117, x = 0.057165, y=-0.324196,c=0.329198 48 | b = -0.622584 , b/2 =-0.311292 49 | m + perp_m = -5.494955 50 | b = -0.622584, x = 0.113301, y=-0.642562,c=0.652474 51 | b = -0.005787 , b/2 =-0.002893 52 | m + perp_m = -5.494955 53 | b = -0.005787, x = 0.001053, y=-0.005973,c=0.006065 54 | 55 | Microphone 0: 56 | Distance of mic in meters from furthest mic from Audio Source:0.657551 57 | Time of delay in seconds: 0.001932 58 | Number of Samples to delay: 30.916283 59 | 60 | 61 | 62 | Microphone 1: 63 | Distance of mic in meters from furthest mic from Audio Source:0.679140 64 | Time of delay in seconds: 0.001996 65 | Number of Samples to delay: 31.931368 66 | 67 | 68 | 69 | Microphone 2: 70 | Distance of mic in meters from furthest mic from Audio Source:0.705327 71 | Time of delay in seconds: 0.002073 72 | Number of Samples to delay: 33.162577 73 | 74 | 75 | 76 | Microphone 3: 77 | Distance of mic in meters from furthest mic from Audio Source:0.698886 78 | Time of delay in seconds: 0.002054 79 | Number of Samples to delay: 32.859776 80 | 81 | 82 | 83 | Microphone 4: 84 | Distance of mic in meters from furthest mic from Audio Source:0.589806 85 | Time of delay in seconds: 0.001733 86 | Number of Samples to delay: 27.731131 87 | 88 | 89 | 90 | Microphone 5: 91 | Distance of mic in meters from furthest mic from Audio Source:0.323277 92 | Time of delay in seconds: 0.000950 93 | Number of Samples to delay: 15.199618 94 | 95 | 96 | 97 | Microphone 6: 98 | Distance of mic in meters from furthest mic from Audio Source:0.000000 99 | Time of delay in seconds: 0.000000 100 | Number of Samples to delay: 0.000000 101 | 102 | 103 | 104 | Microphone 7: 105 | Distance of mic in meters from furthest mic from Audio Source:0.646410 106 | Time of delay in seconds: 0.001900 107 | Number of Samples to delay: 30.392462 108 | 109 | angle1 = 0.253682, angle2 = 1.300874, b1 = -0.046392, b2 = -1.689181 110 | m1 = 0.000000 m2 =0.000000 m3 =0.000000 111 | m1 = 0.000000 m2 =0.000000 m3 =0.000000 112 | m1 = 0.000000 m2 =0.000000 m3 =0.000000 113 | m1 = 0.000000 m2 =0.000000 m3 =0.000000 114 | m1 = 0.000000 m2 =0.069756 m3 =0.000000 115 | m1 = 0.000000 m2 =0.139173 m3 =0.000000 116 | m1 = 0.000000 m2 =0.207912 m3 =0.000000 117 | m1 = 0.000000 m2 =0.275637 m3 =0.000000 118 | m1 = 0.000000 m2 =0.342020 m3 =0.000000 119 | m1 = 0.000000 m2 =0.406737 m3 =0.000000 120 | m1 = 0.000000 m2 =0.469472 m3 =0.000000 121 | m1 = 0.000000 m2 =0.529919 m3 =0.000000 122 | num_samples1 = 0, num_samples2 = 0 123 | m1 = 0.000000 m2 =0.587785 m3 =0.000000 124 | num_samples1 = 1, num_samples2 = 1 125 | m1 = 0.000000 m2 =0.642788 m3 =0.000000 126 | num_samples1 = 2, num_samples2 = 2 127 | m1 = 0.000000 m2 =0.694658 m3 =0.000000 128 | num_samples1 = 3, num_samples2 = 3 129 | m1 = 0.000000 m2 =0.743145 m3 =0.000000 130 | num_samples1 = 4, num_samples2 = 4 131 | m1 = 0.000000 m2 =0.788011 m3 =0.000000 132 | num_samples1 = 5, num_samples2 = 5 133 | m1 = 0.000000 m2 =0.829038 m3 =0.000000 134 | num_samples1 = 6, num_samples2 = 6 135 | m1 = 0.000000 m2 =0.866025 m3 =0.000000 136 | num_samples1 = 7, num_samples2 = 7 137 | m1 = 0.000000 m2 =0.898794 m3 =0.000000 138 | num_samples1 = 8, num_samples2 = 8 139 | m1 = 0.000000 m2 =0.927184 m3 =0.000000 140 | num_samples1 = 9, num_samples2 = 9 141 | m1 = 0.000000 m2 =0.951057 m3 =0.000000 142 | num_samples1 = 10, num_samples2 = 10 143 | m1 = 0.000000 m2 =0.970296 m3 =0.000000 144 | num_samples1 = 11, num_samples2 = 11 145 | m1 = 0.000000 m2 =0.984808 m3 =0.000000 146 | num_samples1 = 12, num_samples2 = 12 147 | m1 = 0.000000 m2 =0.994522 m3 =0.000000 148 | num_samples1 = 13, num_samples2 = 13 149 | m1 = 0.000000 m2 =0.999391 m3 =0.000000 150 | num_samples1 = 14, num_samples2 = 14 151 | m1 = 0.000000 m2 =0.999391 m3 =0.000000 152 | num_samples1 = 15, num_samples2 = 15 153 | m1 = 0.000000 m2 =0.994522 m3 =0.000000 154 | num_samples1 = 16, num_samples2 = 16 155 | m1 = 0.000000 m2 =0.984808 m3 =0.000000 156 | num_samples1 = 17, num_samples2 = 17 157 | m1 = 0.000235 m2 =0.970296 m3 =0.000000 158 | num_samples1 = 18, num_samples2 = 18 159 | m1 = -0.001913 m2 =0.951057 m3 =0.000000 160 | num_samples1 = 19, num_samples2 = 19 161 | m1 = 0.011551 m2 =0.927184 m3 =-0.000602 162 | num_samples1 = 20, num_samples2 = 20 163 | m1 = 0.091263 m2 =0.898794 m3 =0.003465 164 | num_samples1 = 21, num_samples2 = 21 165 | m1 = 0.156725 m2 =0.866025 m3 =-0.009890 166 | num_samples1 = 22, num_samples2 = 22 167 | m1 = 0.226571 m2 =0.829038 m3 =0.041566 168 | num_samples1 = 23, num_samples2 = 23 169 | m1 = 0.293515 m2 =0.788011 m3 =0.111424 170 | num_samples1 = 24, num_samples2 = 24 171 | m1 = 0.359637 m2 =0.743145 m3 =0.181094 172 | num_samples1 = 25, num_samples2 = 25 173 | m1 = 0.423798 m2 =0.694658 m3 =0.249247 174 | num_samples1 = 26, num_samples2 = 26 175 | m1 = 0.485966 m2 =0.642788 m3 =0.316152 176 | num_samples1 = 27, num_samples2 = 27 177 | m1 = 0.545742 m2 =0.587785 m3 =0.381555 178 | num_samples2 = 28 179 | m1 = 0.602867 m2 =0.529919 m3 =0.445106 180 | num_samples2 = 29 181 | m1 = 0.657052 m2 =0.469472 m3 =0.506488 182 | 183 | first = 2, second = 1, third = 3 184 | m1 x = -0.161624 y = -0.088296, m2 x = 0.310235 y = -0.567881, m3 x = 0.489641 y = 0.080550 185 | 186 | 187 | :::::::ANGLE = 283.886189:::::::::: 188 | 189 | 190 | ---------INPUT------- 191 | 192 | 0.000000 193 | 0.069756 194 | 0.139173 195 | 0.207912 196 | 0.275637 197 | 0.342020 198 | 0.406737 199 | 0.469472 200 | 0.529919 201 | 0.587785 202 | 0.642788 203 | 0.694658 204 | 0.743145 205 | 0.788011 206 | 0.829038 207 | 0.866025 208 | 0.898794 209 | 0.927184 210 | 0.951057 211 | 0.970296 212 | 0.984808 213 | 0.994522 214 | 0.999391 215 | 0.999391 216 | 0.994522 217 | 0.984808 218 | 0.970296 219 | 0.951057 220 | 0.927184 221 | 0.898794 222 | 0.866025 223 | 0.829038 224 | 0.788011 225 | 0.743145 226 | 0.694658 227 | 0.642788 228 | 0.587785 229 | 0.529919 230 | 0.469472 231 | 0.406737 232 | 0.342020 233 | 0.275637 234 | 0.207912 235 | 0.139173 236 | 0.069756 237 | 0.000000 238 | -0.069756 239 | -0.139173 240 | -0.207912 241 | -0.275637 242 | -0.342020 243 | -0.406737 244 | -0.469472 245 | -0.529919 246 | -0.587785 247 | -0.642788 248 | -0.694658 249 | -0.743145 250 | -0.788011 251 | -0.829038 252 | -0.866025 253 | -0.898794 254 | -0.927184 255 | -0.951057 256 | -0.970296 257 | -0.984808 258 | -0.994522 259 | -0.999391 260 | -0.999391 261 | -0.994522 262 | -0.984808 263 | -0.970296 264 | -0.951057 265 | -0.927184 266 | -0.898794 267 | -0.866025 268 | -0.829038 269 | -0.788011 270 | -0.743145 271 | -0.694658 272 | -0.642788 273 | -0.587785 274 | -0.529919 275 | -0.469472 276 | -0.406737 277 | -0.342020 278 | -0.275637 279 | -0.207912 280 | -0.139173 281 | -0.069756 282 | -0.000000 283 | 0.069756 284 | 0.139173 285 | 0.207912 286 | 0.275637 287 | 0.342020 288 | 0.406737 289 | 0.469472 290 | 0.529919 291 | 0.587785 292 | 0.642788 293 | 0.694658 294 | 0.743145 295 | 0.788011 296 | 0.829038 297 | 0.866025 298 | 0.898794 299 | 0.927184 300 | 0.951057 301 | 0.970296 302 | 0.984808 303 | 0.994522 304 | 0.999391 305 | 0.999391 306 | 0.994522 307 | 0.984808 308 | 0.970296 309 | 0.951057 310 | 0.927184 311 | 0.898794 312 | 0.866025 313 | 0.829038 314 | 0.788011 315 | 0.743145 316 | 0.694658 317 | 0.642788 318 | 0.587785 319 | 0.529919 320 | 0.469472 321 | 0.406737 322 | 0.342020 323 | 0.275637 324 | 0.207912 325 | 0.139173 326 | 0.069756 327 | 0.000000 328 | -0.069756 329 | -0.139173 330 | -0.207912 331 | -0.275637 332 | -0.342020 333 | -0.406737 334 | -0.469472 335 | -0.529919 336 | -0.587785 337 | -0.642788 338 | -0.694658 339 | -0.743145 340 | -0.788011 341 | -0.829038 342 | -0.866025 343 | -0.898794 344 | -0.927184 345 | -0.951057 346 | -0.970296 347 | -0.984808 348 | -0.994522 349 | -0.999391 350 | -0.999391 351 | -0.994522 352 | -0.984808 353 | -0.970296 354 | -0.951057 355 | -0.927184 356 | -0.898794 357 | -0.866025 358 | -0.829038 359 | -0.788011 360 | -0.743145 361 | -0.694658 362 | -0.642788 363 | -0.587785 364 | -0.529919 365 | -0.469472 366 | -0.406737 367 | -0.342020 368 | -0.275637 369 | -0.207912 370 | -0.139173 371 | -0.069756 372 | 373 | ---------MICROPHONE 0---------- 374 | 375 | 0.000000 376 | 0.000000 377 | 0.000000 378 | 0.000000 379 | 0.000000 380 | 0.000000 381 | 0.000000 382 | 0.000000 383 | 0.000000 384 | 0.000000 385 | 0.000000 386 | 0.000000 387 | 0.000000 388 | 0.000000 389 | 0.000000 390 | 0.000000 391 | 0.000000 392 | 0.000000 393 | 0.000000 394 | 0.000000 395 | 0.000000 396 | 0.000000 397 | 0.000000 398 | 0.000000 399 | 0.000000 400 | 0.000000 401 | 0.000000 402 | 0.000000 403 | 0.000000 404 | 0.000000 405 | 0.000000 406 | 0.000000 407 | 0.000090 408 | -0.000660 409 | 0.003122 410 | 0.076344 411 | 0.144796 412 | 0.213648 413 | 0.281246 414 | 0.347507 415 | 0.412069 416 | 0.474624 417 | 0.534867 418 | 0.592504 419 | 0.647254 420 | 0.698851 421 | 0.747043 422 | 0.791596 423 | 0.832292 424 | 0.868933 425 | 0.901341 426 | 0.929357 427 | 0.952846 428 | 0.971693 429 | 0.985806 430 | 0.995116 431 | 0.999578 432 | 0.999170 433 | 0.993894 434 | 0.983776 435 | 0.968865 436 | 0.949234 437 | 0.924979 438 | 0.896217 439 | 0.863088 440 | 0.825755 441 | 0.784399 442 | 0.739221 443 | 0.690442 444 | 0.638299 445 | 0.583047 446 | 0.524954 447 | 0.464303 448 | 0.401390 449 | 0.336522 450 | 0.270015 451 | 0.202191 452 | 0.133383 453 | 0.063925 454 | -0.005844 455 | -0.075586 456 | -0.144958 457 | -0.213625 458 | -0.281251 459 | -0.347506 460 | -0.412069 461 | -0.474624 462 | -0.534867 463 | -0.592504 464 | -0.647254 465 | -0.698851 466 | -0.747043 467 | -0.791596 468 | -0.832292 469 | -0.868933 470 | -0.901341 471 | -0.929357 472 | -0.952846 473 | -0.971693 474 | -0.985806 475 | -0.995116 476 | -0.999578 477 | -0.999170 478 | -0.993894 479 | -0.983776 480 | -0.968865 481 | -0.949234 482 | -0.924979 483 | -0.896217 484 | -0.863088 485 | -0.825755 486 | -0.784399 487 | -0.739221 488 | -0.690442 489 | -0.638299 490 | -0.583047 491 | -0.524954 492 | -0.464303 493 | -0.401390 494 | -0.336522 495 | -0.270015 496 | -0.202191 497 | -0.133383 498 | -0.063925 499 | 0.005844 500 | 0.075586 501 | 0.144958 502 | 0.213625 503 | 0.281251 504 | 0.347506 505 | 0.412069 506 | 0.474624 507 | 0.534867 508 | 0.592504 509 | 0.647254 510 | 0.698851 511 | 0.747043 512 | 0.791596 513 | 0.832292 514 | 0.868933 515 | 0.901341 516 | 0.929357 517 | 0.952846 518 | 0.971693 519 | 0.985806 520 | 0.995116 521 | 0.999578 522 | 0.999170 523 | 0.993894 524 | 0.983776 525 | 0.968865 526 | 0.949234 527 | 0.924979 528 | 0.896217 529 | 0.863088 530 | 0.825755 531 | 0.784399 532 | 0.739221 533 | 0.690442 534 | 0.638299 535 | 0.583047 536 | 0.524954 537 | 0.464303 538 | 0.401390 539 | 0.336522 540 | 0.270015 541 | 0.202191 542 | 0.133383 543 | 0.063925 544 | -0.005844 545 | -0.075586 546 | -0.144958 547 | -0.213625 548 | -0.281251 549 | -0.347506 550 | -0.412069 551 | -0.474624 552 | -0.534867 553 | -0.592504 554 | -0.647254 555 | 556 | ---------MICROPHONE 1---------- 557 | 558 | 0.000000 559 | 0.000000 560 | 0.000000 561 | 0.000000 562 | 0.000000 563 | 0.000000 564 | 0.000000 565 | 0.000000 566 | 0.000000 567 | 0.000000 568 | 0.000000 569 | 0.000000 570 | 0.000000 571 | 0.000000 572 | 0.000000 573 | 0.000000 574 | 0.000000 575 | 0.000000 576 | 0.000000 577 | 0.000000 578 | 0.000000 579 | 0.000000 580 | 0.000000 581 | 0.000000 582 | 0.000000 583 | 0.000000 584 | 0.000000 585 | 0.000000 586 | 0.000000 587 | 0.000000 588 | 0.000000 589 | 0.000000 590 | 0.000000 591 | 0.000075 592 | -0.000544 593 | 0.002529 594 | 0.075147 595 | 0.143793 596 | 0.212611 597 | 0.280237 598 | 0.346519 599 | 0.411109 600 | 0.473697 601 | 0.533976 602 | 0.591655 603 | 0.646451 604 | 0.698097 605 | 0.746342 606 | 0.790952 607 | 0.831707 608 | 0.868411 609 | 0.900884 610 | 0.928968 611 | 0.952526 612 | 0.971444 613 | 0.985628 614 | 0.995011 615 | 0.999547 616 | 0.999212 617 | 0.994010 618 | 0.983964 619 | 0.969125 620 | 0.949565 621 | 0.925378 622 | 0.896683 623 | 0.863620 624 | 0.826349 625 | 0.785052 626 | 0.739930 627 | 0.691204 628 | 0.639110 629 | 0.583902 630 | 0.525850 631 | 0.465236 632 | 0.402355 633 | 0.337514 634 | 0.271028 635 | 0.203223 636 | 0.134427 637 | 0.064976 638 | -0.004791 639 | -0.074535 640 | -0.143916 641 | -0.212596 642 | -0.280240 643 | -0.346519 644 | -0.411109 645 | -0.473697 646 | -0.533976 647 | -0.591655 648 | -0.646451 649 | -0.698097 650 | -0.746342 651 | -0.790952 652 | -0.831707 653 | -0.868411 654 | -0.900884 655 | -0.928968 656 | -0.952526 657 | -0.971444 658 | -0.985628 659 | -0.995011 660 | -0.999547 661 | -0.999212 662 | -0.994010 663 | -0.983964 664 | -0.969125 665 | -0.949565 666 | -0.925378 667 | -0.896683 668 | -0.863620 669 | -0.826349 670 | -0.785052 671 | -0.739930 672 | -0.691204 673 | -0.639110 674 | -0.583902 675 | -0.525850 676 | -0.465236 677 | -0.402355 678 | -0.337514 679 | -0.271028 680 | -0.203223 681 | -0.134427 682 | -0.064976 683 | 0.004791 684 | 0.074535 685 | 0.143916 686 | 0.212596 687 | 0.280240 688 | 0.346519 689 | 0.411109 690 | 0.473697 691 | 0.533976 692 | 0.591655 693 | 0.646451 694 | 0.698097 695 | 0.746342 696 | 0.790952 697 | 0.831707 698 | 0.868411 699 | 0.900884 700 | 0.928968 701 | 0.952526 702 | 0.971444 703 | 0.985628 704 | 0.995011 705 | 0.999547 706 | 0.999212 707 | 0.994010 708 | 0.983964 709 | 0.969125 710 | 0.949565 711 | 0.925378 712 | 0.896683 713 | 0.863620 714 | 0.826349 715 | 0.785052 716 | 0.739930 717 | 0.691204 718 | 0.639110 719 | 0.583902 720 | 0.525850 721 | 0.465236 722 | 0.402355 723 | 0.337514 724 | 0.271028 725 | 0.203223 726 | 0.134427 727 | 0.064976 728 | -0.004791 729 | -0.074535 730 | -0.143916 731 | -0.212596 732 | -0.280240 733 | -0.346519 734 | -0.411109 735 | -0.473697 736 | -0.533976 737 | -0.591655 738 | 739 | ---------MICROPHONE 2---------- 740 | 741 | 0.000000 742 | 0.000000 743 | 0.000000 744 | 0.000000 745 | 0.000000 746 | 0.000000 747 | 0.000000 748 | 0.000000 749 | 0.000000 750 | 0.000000 751 | 0.000000 752 | 0.000000 753 | 0.000000 754 | 0.000000 755 | 0.000000 756 | 0.000000 757 | 0.000000 758 | 0.000000 759 | 0.000000 760 | 0.000000 761 | 0.000000 762 | 0.000000 763 | 0.000000 764 | 0.000000 765 | 0.000000 766 | 0.000000 767 | 0.000000 768 | 0.000000 769 | 0.000000 770 | 0.000000 771 | 0.000000 772 | 0.000000 773 | 0.000000 774 | 0.000000 775 | -0.000215 776 | 0.001386 777 | -0.004975 778 | 0.057465 779 | 0.127898 780 | 0.196839 781 | 0.264712 782 | 0.331332 783 | 0.396342 784 | 0.459420 785 | 0.520260 786 | 0.578565 787 | 0.634052 788 | 0.686449 789 | 0.735502 790 | 0.780972 791 | 0.822637 792 | 0.860295 793 | 0.893761 794 | 0.922872 795 | 0.947488 796 | 0.967487 797 | 0.982773 798 | 0.993271 799 | 0.998930 800 | 0.999723 801 | 0.995644 802 | 0.986715 803 | 0.972979 804 | 0.954503 805 | 0.931376 806 | 0.903712 807 | 0.871644 808 | 0.835331 809 | 0.794948 810 | 0.750691 811 | 0.702778 812 | 0.651441 813 | 0.596930 814 | 0.539510 815 | 0.479463 816 | 0.417079 817 | 0.352663 818 | 0.286530 819 | 0.219000 820 | 0.150403 821 | 0.081074 822 | 0.011350 823 | -0.058430 824 | -0.127925 825 | -0.196797 826 | -0.264710 827 | -0.331333 828 | -0.396342 829 | -0.459420 830 | -0.520260 831 | -0.578565 832 | -0.634052 833 | -0.686449 834 | -0.735502 835 | -0.780972 836 | -0.822637 837 | -0.860295 838 | -0.893761 839 | -0.922872 840 | -0.947488 841 | -0.967487 842 | -0.982773 843 | -0.993271 844 | -0.998930 845 | -0.999723 846 | -0.995644 847 | -0.986715 848 | -0.972979 849 | -0.954503 850 | -0.931376 851 | -0.903712 852 | -0.871644 853 | -0.835331 854 | -0.794948 855 | -0.750691 856 | -0.702778 857 | -0.651441 858 | -0.596930 859 | -0.539510 860 | -0.479463 861 | -0.417079 862 | -0.352663 863 | -0.286530 864 | -0.219000 865 | -0.150403 866 | -0.081074 867 | -0.011350 868 | 0.058430 869 | 0.127925 870 | 0.196797 871 | 0.264710 872 | 0.331333 873 | 0.396342 874 | 0.459420 875 | 0.520260 876 | 0.578565 877 | 0.634052 878 | 0.686449 879 | 0.735502 880 | 0.780972 881 | 0.822637 882 | 0.860295 883 | 0.893761 884 | 0.922872 885 | 0.947488 886 | 0.967487 887 | 0.982773 888 | 0.993271 889 | 0.998930 890 | 0.999723 891 | 0.995644 892 | 0.986715 893 | 0.972979 894 | 0.954503 895 | 0.931376 896 | 0.903712 897 | 0.871644 898 | 0.835331 899 | 0.794948 900 | 0.750691 901 | 0.702778 902 | 0.651441 903 | 0.596930 904 | 0.539510 905 | 0.479463 906 | 0.417079 907 | 0.352663 908 | 0.286530 909 | 0.219000 910 | 0.150403 911 | 0.081074 912 | 0.011350 913 | -0.058430 914 | -0.127925 915 | -0.196797 916 | -0.264710 917 | -0.331333 918 | -0.396342 919 | -0.459420 920 | -0.520260 921 | 922 | ---------MICROPHONE 3---------- 923 | 924 | 0.000000 925 | 0.000000 926 | 0.000000 927 | 0.000000 928 | 0.000000 929 | 0.000000 930 | 0.000000 931 | 0.000000 932 | 0.000000 933 | 0.000000 934 | 0.000000 935 | 0.000000 936 | 0.000000 937 | 0.000000 938 | 0.000000 939 | 0.000000 940 | 0.000000 941 | 0.000000 942 | 0.000000 943 | 0.000000 944 | 0.000000 945 | 0.000000 946 | 0.000000 947 | 0.000000 948 | 0.000000 949 | 0.000000 950 | 0.000000 951 | 0.000000 952 | 0.000000 953 | 0.000000 954 | 0.000000 955 | 0.000000 956 | 0.000000 957 | 0.000000 958 | 0.000142 959 | -0.001077 960 | 0.005463 961 | 0.080862 962 | 0.148511 963 | 0.217550 964 | 0.285017 965 | 0.351207 966 | 0.415659 967 | 0.478093 968 | 0.538196 969 | 0.595677 970 | 0.650256 971 | 0.701667 972 | 0.749660 973 | 0.794000 974 | 0.834472 975 | 0.870879 976 | 0.903042 977 | 0.930807 978 | 0.954036 979 | 0.972617 980 | 0.986460 981 | 0.995498 982 | 0.999685 983 | 0.999001 984 | 0.993451 985 | 0.983061 986 | 0.967881 987 | 0.947986 988 | 0.923472 989 | 0.894460 990 | 0.861089 991 | 0.823524 992 | 0.781946 993 | 0.736559 994 | 0.687583 995 | 0.635258 996 | 0.579837 997 | 0.521592 998 | 0.460806 999 | 0.397774 1000 | 0.332805 1001 | 0.266214 1002 | 0.198326 1003 | 0.129472 1004 | 0.059988 1005 | -0.009789 1006 | -0.079519 1007 | -0.148860 1008 | -0.217477 1009 | -0.285034 1010 | -0.351203 1011 | -0.415660 1012 | -0.478093 1013 | -0.538196 1014 | -0.595677 1015 | -0.650256 1016 | -0.701667 1017 | -0.749660 1018 | -0.794000 1019 | -0.834472 1020 | -0.870879 1021 | -0.903042 1022 | -0.930807 1023 | -0.954036 1024 | -0.972617 1025 | -0.986460 1026 | -0.995498 1027 | -0.999685 1028 | -0.999001 1029 | -0.993451 1030 | -0.983061 1031 | -0.967881 1032 | -0.947986 1033 | -0.923472 1034 | -0.894460 1035 | -0.861089 1036 | -0.823524 1037 | -0.781946 1038 | -0.736559 1039 | -0.687583 1040 | -0.635258 1041 | -0.579837 1042 | -0.521592 1043 | -0.460806 1044 | -0.397774 1045 | -0.332805 1046 | -0.266214 1047 | -0.198326 1048 | -0.129472 1049 | -0.059988 1050 | 0.009789 1051 | 0.079519 1052 | 0.148860 1053 | 0.217477 1054 | 0.285034 1055 | 0.351203 1056 | 0.415660 1057 | 0.478093 1058 | 0.538196 1059 | 0.595677 1060 | 0.650256 1061 | 0.701667 1062 | 0.749660 1063 | 0.794000 1064 | 0.834472 1065 | 0.870879 1066 | 0.903042 1067 | 0.930807 1068 | 0.954036 1069 | 0.972617 1070 | 0.986460 1071 | 0.995498 1072 | 0.999685 1073 | 0.999001 1074 | 0.993451 1075 | 0.983061 1076 | 0.967881 1077 | 0.947986 1078 | 0.923472 1079 | 0.894460 1080 | 0.861089 1081 | 0.823524 1082 | 0.781946 1083 | 0.736559 1084 | 0.687583 1085 | 0.635258 1086 | 0.579837 1087 | 0.521592 1088 | 0.460806 1089 | 0.397774 1090 | 0.332805 1091 | 0.266214 1092 | 0.198326 1093 | 0.129472 1094 | 0.059988 1095 | -0.009789 1096 | -0.079519 1097 | -0.148860 1098 | -0.217477 1099 | -0.285034 1100 | -0.351203 1101 | -0.415660 1102 | -0.478093 1103 | -0.538196 1104 | 1105 | ---------MICROPHONE 4---------- 1106 | 1107 | 0.000000 1108 | 0.000000 1109 | 0.000000 1110 | 0.000000 1111 | 0.000000 1112 | 0.000000 1113 | 0.000000 1114 | 0.000000 1115 | 0.000000 1116 | 0.000000 1117 | 0.000000 1118 | 0.000000 1119 | 0.000000 1120 | 0.000000 1121 | 0.000000 1122 | 0.000000 1123 | 0.000000 1124 | 0.000000 1125 | 0.000000 1126 | 0.000000 1127 | 0.000000 1128 | 0.000000 1129 | 0.000000 1130 | 0.000000 1131 | 0.000000 1132 | 0.000000 1133 | 0.000000 1134 | 0.000000 1135 | 0.000000 1136 | 0.000235 1137 | -0.001913 1138 | 0.011551 1139 | 0.091263 1140 | 0.156725 1141 | 0.226571 1142 | 0.293515 1143 | 0.359637 1144 | 0.423798 1145 | 0.485966 1146 | 0.545742 1147 | 0.602867 1148 | 0.657052 1149 | 0.708038 1150 | 0.755573 1151 | 0.799428 1152 | 0.839387 1153 | 0.875258 1154 | 0.906864 1155 | 0.934052 1156 | 0.956689 1157 | 0.974666 1158 | 0.987894 1159 | 0.996309 1160 | 0.999870 1161 | 0.998560 1162 | 0.992385 1163 | 0.981375 1164 | 0.965584 1165 | 0.945089 1166 | 0.919989 1167 | 0.890408 1168 | 0.856488 1169 | 0.818396 1170 | 0.776316 1171 | 0.730455 1172 | 0.681034 1173 | 0.628296 1174 | 0.572497 1175 | 0.513908 1176 | 0.452816 1177 | 0.389518 1178 | 0.324322 1179 | 0.257546 1180 | 0.189516 1181 | 0.120562 1182 | 0.051020 1183 | -0.018770 1184 | -0.088468 1185 | -0.157735 1186 | -0.226234 1187 | -0.293631 1188 | -0.359597 1189 | -0.423812 1190 | -0.485961 1191 | -0.545743 1192 | -0.602867 1193 | -0.657053 1194 | -0.708038 1195 | -0.755573 1196 | -0.799428 1197 | -0.839387 1198 | -0.875258 1199 | -0.906864 1200 | -0.934052 1201 | -0.956689 1202 | -0.974666 1203 | -0.987894 1204 | -0.996309 1205 | -0.999870 1206 | -0.998560 1207 | -0.992385 1208 | -0.981375 1209 | -0.965584 1210 | -0.945089 1211 | -0.919989 1212 | -0.890408 1213 | -0.856488 1214 | -0.818396 1215 | -0.776316 1216 | -0.730455 1217 | -0.681034 1218 | -0.628296 1219 | -0.572497 1220 | -0.513908 1221 | -0.452816 1222 | -0.389518 1223 | -0.324322 1224 | -0.257546 1225 | -0.189516 1226 | -0.120562 1227 | -0.051020 1228 | 0.018770 1229 | 0.088468 1230 | 0.157735 1231 | 0.226234 1232 | 0.293631 1233 | 0.359597 1234 | 0.423812 1235 | 0.485961 1236 | 0.545743 1237 | 0.602867 1238 | 0.657053 1239 | 0.708038 1240 | 0.755573 1241 | 0.799428 1242 | 0.839387 1243 | 0.875258 1244 | 0.906864 1245 | 0.934052 1246 | 0.956689 1247 | 0.974666 1248 | 0.987894 1249 | 0.996309 1250 | 0.999870 1251 | 0.998560 1252 | 0.992385 1253 | 0.981375 1254 | 0.965584 1255 | 0.945089 1256 | 0.919989 1257 | 0.890408 1258 | 0.856488 1259 | 0.818396 1260 | 0.776316 1261 | 0.730455 1262 | 0.681034 1263 | 0.628296 1264 | 0.572497 1265 | 0.513908 1266 | 0.452816 1267 | 0.389518 1268 | 0.324322 1269 | 0.257546 1270 | 0.189516 1271 | 0.120562 1272 | 0.051020 1273 | -0.018770 1274 | -0.088468 1275 | -0.157735 1276 | -0.226234 1277 | -0.293631 1278 | -0.359597 1279 | -0.423812 1280 | -0.485961 1281 | -0.545743 1282 | -0.602867 1283 | -0.657053 1284 | -0.708038 1285 | -0.755573 1286 | -0.799428 1287 | 1288 | ---------MICROPHONE 5---------- 1289 | 1290 | 0.000000 1291 | 0.000000 1292 | 0.000000 1293 | 0.000000 1294 | 0.000000 1295 | 0.000000 1296 | 0.000000 1297 | 0.000000 1298 | 0.000000 1299 | 0.000000 1300 | 0.000000 1301 | 0.000000 1302 | 0.000000 1303 | 0.000000 1304 | 0.000000 1305 | 0.000000 1306 | -0.000271 1307 | 0.001715 1308 | -0.005924 1309 | 0.054776 1310 | 0.125275 1311 | 0.194315 1312 | 0.262221 1313 | 0.328891 1314 | 0.393966 1315 | 0.457122 1316 | 0.518050 1317 | 0.576454 1318 | 0.632050 1319 | 0.684567 1320 | 0.733748 1321 | 0.779355 1322 | 0.821164 1323 | 0.858974 1324 | 0.892598 1325 | 0.921873 1326 | 0.946658 1327 | 0.966830 1328 | 0.982292 1329 | 0.992969 1330 | 0.998807 1331 | 0.999780 1332 | 0.995882 1333 | 0.987132 1334 | 0.973573 1335 | 0.955270 1336 | 0.932314 1337 | 0.904816 1338 | 0.872909 1339 | 0.836750 1340 | 0.796514 1341 | 0.752397 1342 | 0.704615 1343 | 0.653400 1344 | 0.599002 1345 | 0.541686 1346 | 0.481730 1347 | 0.419428 1348 | 0.355082 1349 | 0.289006 1350 | 0.221522 1351 | 0.152959 1352 | 0.083651 1353 | 0.013936 1354 | -0.055848 1355 | -0.125360 1356 | -0.194261 1357 | -0.262215 1358 | -0.328892 1359 | -0.393966 1360 | -0.457122 1361 | -0.518050 1362 | -0.576454 1363 | -0.632050 1364 | -0.684567 1365 | -0.733748 1366 | -0.779355 1367 | -0.821164 1368 | -0.858974 1369 | -0.892598 1370 | -0.921873 1371 | -0.946658 1372 | -0.966830 1373 | -0.982292 1374 | -0.992969 1375 | -0.998807 1376 | -0.999780 1377 | -0.995882 1378 | -0.987132 1379 | -0.973573 1380 | -0.955270 1381 | -0.932314 1382 | -0.904816 1383 | -0.872909 1384 | -0.836750 1385 | -0.796514 1386 | -0.752397 1387 | -0.704615 1388 | -0.653400 1389 | -0.599002 1390 | -0.541686 1391 | -0.481730 1392 | -0.419428 1393 | -0.355082 1394 | -0.289006 1395 | -0.221522 1396 | -0.152959 1397 | -0.083651 1398 | -0.013936 1399 | 0.055848 1400 | 0.125360 1401 | 0.194261 1402 | 0.262215 1403 | 0.328892 1404 | 0.393966 1405 | 0.457122 1406 | 0.518050 1407 | 0.576454 1408 | 0.632050 1409 | 0.684567 1410 | 0.733748 1411 | 0.779355 1412 | 0.821164 1413 | 0.858974 1414 | 0.892598 1415 | 0.921873 1416 | 0.946658 1417 | 0.966830 1418 | 0.982292 1419 | 0.992969 1420 | 0.998807 1421 | 0.999780 1422 | 0.995882 1423 | 0.987132 1424 | 0.973573 1425 | 0.955270 1426 | 0.932314 1427 | 0.904816 1428 | 0.872909 1429 | 0.836750 1430 | 0.796514 1431 | 0.752397 1432 | 0.704615 1433 | 0.653400 1434 | 0.599002 1435 | 0.541686 1436 | 0.481730 1437 | 0.419428 1438 | 0.355082 1439 | 0.289006 1440 | 0.221522 1441 | 0.152959 1442 | 0.083651 1443 | 0.013936 1444 | -0.055848 1445 | -0.125360 1446 | -0.194261 1447 | -0.262215 1448 | -0.328892 1449 | -0.393966 1450 | -0.457122 1451 | -0.518050 1452 | -0.576454 1453 | -0.632050 1454 | -0.684567 1455 | -0.733748 1456 | -0.779355 1457 | -0.821164 1458 | -0.858974 1459 | -0.892598 1460 | -0.921873 1461 | -0.946658 1462 | -0.966830 1463 | -0.982292 1464 | -0.992969 1465 | -0.998807 1466 | -0.999780 1467 | -0.995882 1468 | -0.987132 1469 | -0.973573 1470 | 1471 | ---------MICROPHONE 6---------- 1472 | 1473 | 0.000000 1474 | 0.000000 1475 | 0.000000 1476 | 0.000000 1477 | 0.069756 1478 | 0.139173 1479 | 0.207912 1480 | 0.275637 1481 | 0.342020 1482 | 0.406737 1483 | 0.469472 1484 | 0.529919 1485 | 0.587785 1486 | 0.642788 1487 | 0.694658 1488 | 0.743145 1489 | 0.788011 1490 | 0.829038 1491 | 0.866025 1492 | 0.898794 1493 | 0.927184 1494 | 0.951057 1495 | 0.970296 1496 | 0.984808 1497 | 0.994522 1498 | 0.999391 1499 | 0.999391 1500 | 0.994522 1501 | 0.984808 1502 | 0.970296 1503 | 0.951057 1504 | 0.927184 1505 | 0.898794 1506 | 0.866025 1507 | 0.829038 1508 | 0.788011 1509 | 0.743145 1510 | 0.694658 1511 | 0.642788 1512 | 0.587785 1513 | 0.529919 1514 | 0.469472 1515 | 0.406737 1516 | 0.342020 1517 | 0.275637 1518 | 0.207912 1519 | 0.139173 1520 | 0.069756 1521 | 0.000000 1522 | -0.069756 1523 | -0.139173 1524 | -0.207912 1525 | -0.275637 1526 | -0.342020 1527 | -0.406737 1528 | -0.469472 1529 | -0.529919 1530 | -0.587785 1531 | -0.642788 1532 | -0.694658 1533 | -0.743145 1534 | -0.788011 1535 | -0.829038 1536 | -0.866025 1537 | -0.898794 1538 | -0.927184 1539 | -0.951057 1540 | -0.970296 1541 | -0.984808 1542 | -0.994522 1543 | -0.999391 1544 | -0.999391 1545 | -0.994522 1546 | -0.984808 1547 | -0.970296 1548 | -0.951057 1549 | -0.927184 1550 | -0.898794 1551 | -0.866025 1552 | -0.829038 1553 | -0.788011 1554 | -0.743145 1555 | -0.694658 1556 | -0.642788 1557 | -0.587785 1558 | -0.529919 1559 | -0.469472 1560 | -0.406737 1561 | -0.342020 1562 | -0.275637 1563 | -0.207912 1564 | -0.139173 1565 | -0.069756 1566 | -0.000000 1567 | 0.069756 1568 | 0.139173 1569 | 0.207912 1570 | 0.275637 1571 | 0.342020 1572 | 0.406737 1573 | 0.469472 1574 | 0.529919 1575 | 0.587785 1576 | 0.642788 1577 | 0.694658 1578 | 0.743145 1579 | 0.788011 1580 | 0.829038 1581 | 0.866025 1582 | 0.898794 1583 | 0.927184 1584 | 0.951057 1585 | 0.970296 1586 | 0.984808 1587 | 0.994522 1588 | 0.999391 1589 | 0.999391 1590 | 0.994522 1591 | 0.984808 1592 | 0.970296 1593 | 0.951057 1594 | 0.927184 1595 | 0.898794 1596 | 0.866025 1597 | 0.829038 1598 | 0.788011 1599 | 0.743145 1600 | 0.694658 1601 | 0.642788 1602 | 0.587785 1603 | 0.529919 1604 | 0.469472 1605 | 0.406737 1606 | 0.342020 1607 | 0.275637 1608 | 0.207912 1609 | 0.139173 1610 | 0.069756 1611 | 0.000000 1612 | -0.069756 1613 | -0.139173 1614 | -0.207912 1615 | -0.275637 1616 | -0.342020 1617 | -0.406737 1618 | -0.469472 1619 | -0.529919 1620 | -0.587785 1621 | -0.642788 1622 | -0.694658 1623 | -0.743145 1624 | -0.788011 1625 | -0.829038 1626 | -0.866025 1627 | -0.898794 1628 | -0.927184 1629 | -0.951057 1630 | -0.970296 1631 | -0.984808 1632 | -0.994522 1633 | -0.999391 1634 | -0.999391 1635 | -0.994522 1636 | -0.984808 1637 | -0.970296 1638 | -0.951057 1639 | -0.927184 1640 | -0.898794 1641 | -0.866025 1642 | -0.829038 1643 | -0.788011 1644 | -0.743145 1645 | -0.694658 1646 | -0.642788 1647 | -0.587785 1648 | -0.529919 1649 | -0.469472 1650 | -0.406737 1651 | -0.342020 1652 | -0.275637 1653 | 1654 | ---------MICROPHONE 7---------- 1655 | 1656 | 0.000000 1657 | 0.000000 1658 | 0.000000 1659 | 0.000000 1660 | 0.000000 1661 | 0.000000 1662 | 0.000000 1663 | 0.000000 1664 | 0.000000 1665 | 0.000000 1666 | 0.000000 1667 | 0.000000 1668 | 0.000000 1669 | 0.000000 1670 | 0.000000 1671 | 0.000000 1672 | 0.000000 1673 | 0.000000 1674 | 0.000000 1675 | 0.000000 1676 | 0.000000 1677 | 0.000000 1678 | 0.000000 1679 | 0.000000 1680 | 0.000000 1681 | 0.000000 1682 | 0.000000 1683 | 0.000000 1684 | 0.000000 1685 | 0.000000 1686 | 0.000000 1687 | -0.000602 1688 | 0.003465 1689 | -0.009890 1690 | 0.041566 1691 | 0.111424 1692 | 0.181094 1693 | 0.249247 1694 | 0.316152 1695 | 0.381555 1696 | 0.445106 1697 | 0.506488 1698 | 0.565401 1699 | 0.621560 1700 | 0.674691 1701 | 0.724535 1702 | 0.770849 1703 | 0.813407 1704 | 0.852003 1705 | 0.886447 1706 | 0.916573 1707 | 0.942234 1708 | 0.963304 1709 | 0.979681 1710 | 0.991285 1711 | 0.998060 1712 | 0.999972 1713 | 0.997012 1714 | 0.989195 1715 | 0.976559 1716 | 0.959165 1717 | 0.937098 1718 | 0.910466 1719 | 0.879398 1720 | 0.844046 1721 | 0.804581 1722 | 0.761197 1723 | 0.714104 1724 | 0.663533 1725 | 0.609728 1726 | 0.552953 1727 | 0.493484 1728 | 0.431611 1729 | 0.367635 1730 | 0.301868 1731 | 0.234631 1732 | 0.166250 1733 | 0.097059 1734 | 0.027396 1735 | -0.042401 1736 | -0.111992 1737 | -0.181037 1738 | -0.249200 1739 | -0.316148 1740 | -0.381557 1741 | -0.445106 1742 | -0.506488 1743 | -0.565401 1744 | -0.621560 1745 | -0.674691 1746 | -0.724535 1747 | -0.770849 1748 | -0.813407 1749 | -0.852003 1750 | -0.886447 1751 | -0.916573 1752 | -0.942234 1753 | -0.963304 1754 | -0.979681 1755 | -0.991285 1756 | -0.998060 1757 | -0.999972 1758 | -0.997012 1759 | -0.989195 1760 | -0.976559 1761 | -0.959165 1762 | -0.937098 1763 | -0.910466 1764 | -0.879398 1765 | -0.844046 1766 | -0.804581 1767 | -0.761197 1768 | -0.714104 1769 | -0.663533 1770 | -0.609728 1771 | -0.552953 1772 | -0.493484 1773 | -0.431611 1774 | -0.367635 1775 | -0.301868 1776 | -0.234631 1777 | -0.166250 1778 | -0.097059 1779 | -0.027396 1780 | 0.042401 1781 | 0.111992 1782 | 0.181037 1783 | 0.249200 1784 | 0.316148 1785 | 0.381557 1786 | 0.445106 1787 | 0.506488 1788 | 0.565401 1789 | 0.621560 1790 | 0.674691 1791 | 0.724535 1792 | 0.770849 1793 | 0.813407 1794 | 0.852003 1795 | 0.886447 1796 | 0.916573 1797 | 0.942234 1798 | 0.963304 1799 | 0.979681 1800 | 0.991285 1801 | 0.998060 1802 | 0.999972 1803 | 0.997012 1804 | 0.989195 1805 | 0.976559 1806 | 0.959165 1807 | 0.937098 1808 | 0.910466 1809 | 0.879398 1810 | 0.844046 1811 | 0.804581 1812 | 0.761197 1813 | 0.714104 1814 | 0.663533 1815 | 0.609728 1816 | 0.552953 1817 | 0.493484 1818 | 0.431611 1819 | 0.367635 1820 | 0.301868 1821 | 0.234631 1822 | 0.166250 1823 | 0.097059 1824 | 0.027396 1825 | -0.042401 1826 | -0.111992 1827 | -0.181037 1828 | -0.249200 1829 | -0.316148 1830 | -0.381557 1831 | -0.445106 1832 | -0.506488 1833 | -0.565401 1834 | -0.621560 1835 | -0.674691 1836 | -------------------------------------------------------------------------------- /fixed_beamformer/polar.gnuplot: -------------------------------------------------------------------------------- 1 | reset 2 | set angles degrees 3 | set polar 4 | set grid polar 30 lc rgbcolor "#999999" 5 | unset border 6 | unset param 7 | set size ratio 1 1,1 8 | set xtics axis nomirror -50,10 9 | unset ytics 10 | unset key 11 | set style data line 12 | set xrange[-50:50] 13 | set yrange[-50:50] 14 | set rrange[-50:0] 15 | set label 1 "0°" at graph 1.01,0.5 front 16 | set label 2 "180°" at graph -0.01,0.5 right front 17 | set label 3 "-90°" at graph 0.5,-0.03 center front 18 | set label 4 "90°" at graph 0.5,1.03 center front 19 | plot 'beamPattern.dat' u 2:5 20 | -------------------------------------------------------------------------------- /fixed_beamformer/sinc.gnuplot: -------------------------------------------------------------------------------- 1 | h(x)=sin(pi*x)/(pi*x) 2 | set xrange[-50:50] 3 | set yrange[-0.3:1.1] 4 | set samples 1000 5 | set grid 6 | unset key 7 | plot h(x) 8 | --------------------------------------------------------------------------------