Impedance Fast Circuitry Software

Dependencies:   mbed-dsp mbed

Fork of DSP_200kHz by Mazzeo Research Group

Committer:
baxterja
Date:
Thu Aug 03 17:38:02 2017 +0000
Revision:
80:7a4856c596fc
Parent:
79:5f24cfd685d8
Child:
81:30d699e951a8
Child:
84:5b4466dd2326
Working with 200Hz and 1KHz.  About to change it to 190Hz

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donatien 0:bb128f0e952f 1 #include "mbed.h"
timmey9 22:523e316cbe70 2
timmey9 52:5a40cc58c4c2 3 // Sampling
bmazzeo 53:83a90a47c1fd 4 #include "DMA_sampling/adc.h"
bmazzeo 54:1697dc574b96 5 #include "DMA_sampling/dac.h"
bmazzeo 55:2526b3317bc8 6 #include "DMA_sampling/pdb.h"
baxterja 73:b059b5bdc664 7 #include "Jareds_DSP/filters_jared.h"
baxterja 75:8bb94685c80b 8 #include "Jareds_DSP/demodulate.h"
bmazzeo 67:ec0c58490ce6 9 // DSP
bmazzeo 67:ec0c58490ce6 10 #include "dsp.h"
baxterja 76:704fc58ffcd0 11 #include "print_data.h"
bmazzeo 67:ec0c58490ce6 12
baxterja 72:0b554f5026b9 13 #define PRINT_BUFFER_LENGTH 10000
baxterja 73:b059b5bdc664 14 #define GATHER_STATISTICS 1
bmazzeo 67:ec0c58490ce6 15
baxterja 74:ebc9f09fda11 16
timmey9 22:523e316cbe70 17 // for debug purposes
baxterja 79:5f24cfd685d8 18 DigitalOut led1(LED1);
baxterja 79:5f24cfd685d8 19 DigitalOut led2(LED2);
timmey9 18:b17ddeeb1c09 20 Serial pc(USBTX, USBRX);
timmey9 18:b17ddeeb1c09 21 DigitalOut led_red(LED_RED);
timmey9 18:b17ddeeb1c09 22 DigitalOut led_green(LED_GREEN);
timmey9 18:b17ddeeb1c09 23 DigitalOut led_blue(LED_BLUE);
bmazzeo 58:4bee89daccff 24 DigitalOut status_0(D0);
bmazzeo 58:4bee89daccff 25 DigitalOut status_1(D1);
baxterja 77:1ee17a9e9f8b 26 DigitalOut status_3(D3);
baxterja 80:7a4856c596fc 27 DigitalOut Start_sync(D4);//
baxterja 73:b059b5bdc664 28 DigitalIn sw2(SW2);//Button 2
baxterja 73:b059b5bdc664 29 DigitalIn sw3(SW3);//Button 3
timmey9 51:43143a3fc2d7 30
timmey9 52:5a40cc58c4c2 31 // defined in dma.cpp
timmey9 45:d591d138cdeb 32 extern int len;
baxterja 73:b059b5bdc664 33 extern uint16_t static_input_array0[];//ADC 0(swaps between a0 and a1. Used to measure current)
baxterja 73:b059b5bdc664 34 extern uint16_t static_input_array1[];//ADC 1(measures the voltage between the probe and ground)
baxterja 73:b059b5bdc664 35 extern uint16_t static_output_array0[];//DAC outputs whatever wave form we want.
baxterja 73:b059b5bdc664 36 extern uint16_t sampling_status;//used to determine when adc's are done reading.
bmazzeo 57:7b8c49e1c1f6 37
baxterja 73:b059b5bdc664 38 #define INPUT_ARRAY_SIZE 32
baxterja 73:b059b5bdc664 39 #define DECIMATION_FACTOR 8
baxterja 73:b059b5bdc664 40 #define DEMODULATED_SIGNAL_LENGTH 64
baxterja 73:b059b5bdc664 41
baxterja 73:b059b5bdc664 42 float *input_50k[8];
baxterja 73:b059b5bdc664 43
baxterja 79:5f24cfd685d8 44 int probe_number = -1;
baxterja 79:5f24cfd685d8 45 bool recording = false;
baxterja 73:b059b5bdc664 46
baxterja 73:b059b5bdc664 47
baxterja 73:b059b5bdc664 48
baxterja 69:014d4bbd4e03 49 #define pre_compute_length 500
baxterja 73:b059b5bdc664 50 #define demodulation_length 125
baxterja 69:014d4bbd4e03 51 #define CarrierFrequency 200
baxterja 69:014d4bbd4e03 52 #define SAMPLEFREQUENCY 100000
baxterja 73:b059b5bdc664 53 //float i_mod_pre[demodulation_length+(INPUT_ARRAY_SIZE/DECIMATION_FACTOR)];
baxterja 73:b059b5bdc664 54 //float q_mod_pre[demodulation_length+(INPUT_ARRAY_SIZE/DECIMATION_FACTOR)];
baxterja 73:b059b5bdc664 55 uint16_t out_val_pre[pre_compute_length]; //used to write values to the dac
baxterja 69:014d4bbd4e03 56 float twopi = 3.14159265359 * 2;
baxterja 69:014d4bbd4e03 57
baxterja 69:014d4bbd4e03 58
baxterja 69:014d4bbd4e03 59 void pre_compute_tables() {
baxterja 69:014d4bbd4e03 60 // This function will precompute the cos and sin tables used in the rest of the program
baxterja 69:014d4bbd4e03 61 for(int precompute_counter = 0; precompute_counter < pre_compute_length; precompute_counter++){
baxterja 78:10b2916b8f5c 62 out_val_pre[precompute_counter] = (int) ((cos(twopi * CarrierFrequency /SAMPLEFREQUENCY * precompute_counter)+cos(twopi * 1000 /SAMPLEFREQUENCY * precompute_counter+3.14159265359)) * 1023.0 + 2048.0);//12 bit cos wave
baxterja 69:014d4bbd4e03 63 }
baxterja 73:b059b5bdc664 64
baxterja 73:b059b5bdc664 65 //float decimated_frequency = 6250;
baxterja 73:b059b5bdc664 66 //for(int precompute_counter = 0; precompute_counter < demodulation_length+(INPUT_ARRAY_SIZE/DECIMATION_FACTOR); precompute_counter++){
baxterja 73:b059b5bdc664 67 // i_mod_pre[precompute_counter] = (cos(twopi * CarrierFrequency / decimated_frequency * precompute_counter));
baxterja 73:b059b5bdc664 68 // q_mod_pre[precompute_counter] = (-sin(twopi * CarrierFrequency / decimated_frequency * precompute_counter));
baxterja 73:b059b5bdc664 69
baxterja 69:014d4bbd4e03 70 }
baxterja 69:014d4bbd4e03 71
baxterja 79:5f24cfd685d8 72 void callback() {
baxterja 79:5f24cfd685d8 73 // Note: you need to actually read from the serial to clear the RX interrupt
baxterja 79:5f24cfd685d8 74 printf("%c\n", pc.getc());
baxterja 79:5f24cfd685d8 75 led2 = !led2;
baxterja 79:5f24cfd685d8 76 }
emilmont 7:65188f4a8c25 77 int main() {
baxterja 79:5f24cfd685d8 78
timmey9 22:523e316cbe70 79 led_blue = 1;
timmey9 35:df40c4566826 80 led_green = 1;
timmey9 18:b17ddeeb1c09 81 led_red = 1;
timmey9 34:44cc9b76a507 82
baxterja 79:5f24cfd685d8 83 pre_compute_tables();
baxterja 79:5f24cfd685d8 84 precompute_tables();
baxterja 79:5f24cfd685d8 85 //turn off all LEDs
baxterja 73:b059b5bdc664 86
baxterja 79:5f24cfd685d8 87
baxterja 79:5f24cfd685d8 88
baxterja 79:5f24cfd685d8 89
baxterja 73:b059b5bdc664 90
baxterja 73:b059b5bdc664 91 pc.baud(230400);
baxterja 79:5f24cfd685d8 92
baxterja 79:5f24cfd685d8 93 //pc.printf("High: %x Mid: %x Low: %x",SIM->UIDH,SIM->UIDML,SIM->UIDL);
baxterja 79:5f24cfd685d8 94
baxterja 80:7a4856c596fc 95 if(SIM->UIDH == 0x2effff && SIM->UIDML == 0x4e453154 && SIM->UIDL == 0x1004001e) probe_number = 1;
baxterja 80:7a4856c596fc 96 else if(SIM->UIDH == 0x1cffff && SIM->UIDML == 0x4e453215 && SIM->UIDL == 0x700b0003) probe_number = 2;
baxterja 80:7a4856c596fc 97 else if(SIM->UIDH == 0x2effff && SIM->UIDML == 0x4e453215 && SIM->UIDL == 0x700b0021) probe_number = 3;
baxterja 80:7a4856c596fc 98 else if(SIM->UIDH == 0x14ffff && SIM->UIDML == 0x4e453154 && SIM->UIDL == 0x5009002b) probe_number = 4;
baxterja 80:7a4856c596fc 99 else if(SIM->UIDH == 0x12ffff && SIM->UIDML == 0x4e453103 && SIM->UIDL == 0x60010030) probe_number = 5;
baxterja 80:7a4856c596fc 100 else if(SIM->UIDH == 0x10ffff && SIM->UIDML == 0x4e453105 && SIM->UIDL == 0x100b0031) probe_number = 6;
baxterja 80:7a4856c596fc 101 else if(SIM->UIDH == 0x19ffff && SIM->UIDML == 0x4d441504 && SIM->UIDL == 0x90110031) probe_number = 7;//this FRDM board had a bad usb connection
baxterja 80:7a4856c596fc 102 else
baxterja 80:7a4856c596fc 103 {
baxterja 80:7a4856c596fc 104 pc.printf("FRDM BOARD NOT RECOGNIZED. Here is the new ID:\n\r");
baxterja 80:7a4856c596fc 105 pc.printf("High: %x Mid: %x Low: %x\n\r",SIM->UIDH,SIM->UIDML,SIM->UIDL);
baxterja 80:7a4856c596fc 106 probe_number = 6;
baxterja 80:7a4856c596fc 107 }
baxterja 80:7a4856c596fc 108 pc.printf("PROBE #%d",probe_number);
baxterja 80:7a4856c596fc 109 wait(1.0f);
baxterja 79:5f24cfd685d8 110 /*
baxterja 79:5f24cfd685d8 111 while(!pc.readable())
baxterja 79:5f24cfd685d8 112 {
baxterja 79:5f24cfd685d8 113 continue;
baxterja 79:5f24cfd685d8 114 }
baxterja 79:5f24cfd685d8 115 pc.printf("%d",probe_number);
baxterja 79:5f24cfd685d8 116 */
baxterja 79:5f24cfd685d8 117 int DAC_COUNTER = 0;
baxterja 79:5f24cfd685d8 118 //SIM_UIDH == 0x20ffff && SIM_UIDML == 0x4e453103 && SIM_UIDL == 0x60010028)
baxterja 79:5f24cfd685d8 119 //printf("High: %x Mid: %x Low: %x",SIM->UIDH,SIM->UIDML,SIM->UIDL);
baxterja 78:10b2916b8f5c 120
baxterja 78:10b2916b8f5c 121 //Fs = 100000, FPass = 1500, FStop = 4500, -40db
baxterja 78:10b2916b8f5c 122 float Coeffs_100k[64] = {0.00368762746013400, -0.00390835182721185, -0.00352466159836192, -0.00378044968164769, -0.00434746630849834, -0.00502920744118478, -0.00570543677799210, -0.00628464650365093, -0.00668691824262464, -0.00683917139561193, -0.00667505410229485, -0.00613341508706847, -0.00516232410283893, -0.00371868951723358, -0.00177417571286934, 0.000685809876396031, 0.00365648516386919, 0.00711658039739992, 0.0110234409358280, 0.0153179248880130, 0.0199204447074274, 0.0247385052308702, 0.0296636617979935, 0.0345813441342327, 0.0393672306749833, 0.0438989152744108, 0.0480511039644129, 0.0517108728403463, 0.0547710075854812, 0.0571509837193129, 0.0587848911618005, 0.0596038010741317, 0.0596038010741317, 0.0587848911618005, 0.0571509837193129, 0.0547710075854812, 0.0517108728403463, 0.0480511039644129, 0.0438989152744108, 0.0393672306749833, 0.0345813441342327, 0.0296636617979935, 0.0247385052308702, 0.0199204447074274, 0.0153179248880130, 0.0110234409358280, 0.00711658039739992, 0.00365648516386919, 0.000685809876396031, -0.00177417571286934, -0.00371868951723358, -0.00516232410283893, -0.00613341508706847, -0.00667505410229485, -0.00683917139561193, -0.00668691824262464, -0.00628464650365093, -0.00570543677799210, -0.00502920744118478, -0.00434746630849834, -0.00378044968164769, -0.00352466159836192, -0.00390835182721185, 0.00368762746013400};
baxterja 78:10b2916b8f5c 123 //FS = 12500, Fpass = 100 Fstop 595 -50 db, picks on 1KHz signal
baxterja 78:10b2916b8f5c 124 float Coeffs_12500[64] = {-0.00222124676855946, -0.00163176345559825, -0.00214372257722720, -0.00268653504526241, -0.00323192624665395, -0.00374368158669702, -0.00417907979321931, -0.00449328006488225, -0.00463658803501384, -0.00455550760053878, -0.00419848205106894, -0.00352024663122325, -0.00247317556122392, -0.00102679426345247, 0.000845020041268567, 0.00315252023354445, 0.00589238992243332, 0.00904676286706929, 0.0125796442526745, 0.0164391331165775, 0.0205582919104753, 0.0248562683452381, 0.0292399202971496, 0.0336089813533200, 0.0378556202824368, 0.0418719268554270, 0.0455508704073759, 0.0487915537931733, 0.0515035460002020, 0.0536094934833149, 0.0550483048257919, 0.0557785148825623, 0.0557785148825623, 0.0550483048257919, 0.0536094934833149, 0.0515035460002020, 0.0487915537931733, 0.0455508704073759, 0.0418719268554270, 0.0378556202824368, 0.0336089813533200, 0.0292399202971496, 0.0248562683452381, 0.0205582919104753, 0.0164391331165775, 0.0125796442526745, 0.00904676286706929, 0.00589238992243332, 0.00315252023354445, 0.000845020041268567, -0.00102679426345247, -0.00247317556122392, -0.00352024663122325, -0.00419848205106894, -0.00455550760053878, -0.00463658803501384, -0.00449328006488225, -0.00417907979321931, -0.00374368158669702, -0.00323192624665395, -0.00268653504526241, -0.00214372257722720, -0.00163176345559825, -0.00222124676855946};
baxterja 78:10b2916b8f5c 125 //Fs = 1562.5 Fpass = 100, FStop = 195.6, null at 200 Hz
baxterja 78:10b2916b8f5c 126 float Coeffs_1563[32] = {-0.00296990567211633, 0.00784631357544163, 0.00955642274001412, 0.0105078670942049, 0.00746432577935901, -0.000715888274492355, -0.0127656342089486, -0.0248578255670040, -0.0313597093257934, -0.0264804428976321, -0.00639056527392095, 0.0289495639622991, 0.0749846381319702, 0.123239880157668, 0.163403327438059, 0.186215627611441, 0.186215627611441, 0.163403327438059, 0.123239880157668, 0.0749846381319702, 0.0289495639622991, -0.00639056527392095, -0.0264804428976321, -0.0313597093257934, -0.0248578255670040, -0.0127656342089486, -0.000715888274492355, 0.00746432577935901, 0.0105078670942049, 0.00955642274001412, 0.00784631357544163, -0.00296990567211633};
baxterja 78:10b2916b8f5c 127 //Fs = 781.25, Fpass = 60, Fstop = 120, -50 Db
baxterja 78:10b2916b8f5c 128 float Coeffs_782[32] = {-0.00423132648651131, -0.00413085595827858, -0.00212955364173648, 0.00345345707266939, 0.0105870277845968, 0.0147191914630408, 0.0108878516242339, -0.00283458314983071, -0.0224398052018669, -0.0377493805765767, -0.0358474685211045, -0.00721456868509791, 0.0483564412276129, 0.119338204671425, 0.185468453617916, 0.225354002914126, 0.225354002914126, 0.185468453617916, 0.119338204671425, 0.0483564412276129, -0.00721456868509791, -0.0358474685211045, -0.0377493805765767, -0.0224398052018669, -0.00283458314983071, 0.0108878516242339, 0.0147191914630408, 0.0105870277845968, 0.00345345707266939, -0.00212955364173648, -0.00413085595827858, -0.00423132648651131};
baxterja 76:704fc58ffcd0 129
baxterja 73:b059b5bdc664 130 float Coeffs[20] = {0.0328368433284673, 0.0237706090075265, 0.0309894695180997, 0.0385253568846695, 0.0459996974310349, 0.0530165318016261, 0.0591943866845610, 0.0641755708098907, 0.0676960677594849, 0.0694621149975389, 0.0694621149975389, 0.0676960677594849, 0.0641755708098907, 0.0591943866845610, 0.0530165318016261, 0.0459996974310349, 0.0385253568846695, 0.0309894695180997, 0.0237706090075265, 0.0328368433284673};
baxterja 73:b059b5bdc664 131 float Coeffs2[20] = {-0.00506451294187997, -0.00824932319607346, -0.00986370066237912, -0.00518913235010027, 0.00950858650162284, 0.0357083149022659, 0.0711557142019980, 0.109659494661247, 0.142586101123340, 0.161603335553589, 0.161603335553589, 0.142586101123340, 0.109659494661247, 0.0711557142019980, 0.0357083149022659, 0.00950858650162284, -0.00518913235010027, -0.00986370066237912, -0.00824932319607346, -0.00506451294187997};
baxterja 73:b059b5bdc664 132
baxterja 73:b059b5bdc664 133 for(int i = 0; i < 8; i++)
baxterja 77:1ee17a9e9f8b 134 input_50k[i] = new float[64];//each array represents the input of the adcs
baxterja 78:10b2916b8f5c 135
baxterja 78:10b2916b8f5c 136
baxterja 78:10b2916b8f5c 137 filters f4 = filters(4, 8, NULL, 8, 32, Coeffs_782,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 138 filters f3 = filters(4, 2, &f4, 4, 32, Coeffs_1563,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 139 filters f2 = filters(4, 8, &f3, 8, 64, Coeffs_12500,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 140 filters f1 = filters(2, 8, &f2, 64, 64, Coeffs_100k,DEMOD_200HZ);
baxterja 73:b059b5bdc664 141
baxterja 78:10b2916b8f5c 142 filters f4_b = filters(4, 8, NULL, 8, 32, Coeffs_782,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 143 filters f3_b = filters(4, 2, &f4_b, 4, 32, Coeffs_1563,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 144 filters f2_b = filters(4, 8, &f3_b, 8, 64, Coeffs_12500,DEMOD_No_Demod);
baxterja 78:10b2916b8f5c 145 filters f1_b = filters(2, 8, &f2_b, 64, 64, Coeffs_100k,DEMOD_1000HZ);
baxterja 73:b059b5bdc664 146
baxterja 78:10b2916b8f5c 147 //filters f_pre = filters(2, 2, &f1, 64, 64, Coeffs_50k,false);
baxterja 69:014d4bbd4e03 148
baxterja 73:b059b5bdc664 149 //float output_print_buffer[PRINT_BUFFER_LENGTH];//used to store the adc0 values(current measurment)
baxterja 73:b059b5bdc664 150 //float output_print_buffer2[PRINT_BUFFER_LENGTH];//used to store the adc0 values(voltage measurment)
baxterja 70:8cd7a8a2c153 151 int print_buffer_count = 0;
baxterja 70:8cd7a8a2c153 152
bmazzeo 66:72c5c24e532c 153 pdb_init(); // Initalize PDB
bmazzeo 66:72c5c24e532c 154 dac_init(); // initializes DAC
timmey9 45:d591d138cdeb 155 adc_init(); // always initialize adc before dma
bmazzeo 53:83a90a47c1fd 156 pc.printf("ADC Initialized\r\n");
baxterja 74:ebc9f09fda11 157 dma_init2(); // initializes DMAs
bmazzeo 55:2526b3317bc8 158 dma_reset(); // This clears any DMA triggers that may have gotten things into a different state
bmazzeo 67:ec0c58490ce6 159 pc.printf("Buffer Size: %i\r\n", len);
bmazzeo 54:1697dc574b96 160
timmey9 46:a015ebf4663b 161 led_green = 1;
baxterja 79:5f24cfd685d8 162 pc.printf("High: %x Mid: %x Low: %x",SIM->UIDH,SIM->UIDML,SIM->UIDL);
timmey9 40:bd6d8c35e822 163 pc.printf("\r\n\r\n\r\n");
timmey9 37:8bdc71f3e874 164
bmazzeo 64:bb4a4bd57681 165 pdb_start();
baxterja 70:8cd7a8a2c153 166 //while(print_buffer_count<PRINT_BUFFER_LENGTH)
baxterja 73:b059b5bdc664 167 while(!GATHER_STATISTICS||print_buffer_count<PRINT_BUFFER_LENGTH)
baxterja 73:b059b5bdc664 168 {
baxterja 79:5f24cfd685d8 169 if(pc.readable())//if the python code has sent any characters recently
baxterja 79:5f24cfd685d8 170 {
baxterja 79:5f24cfd685d8 171 while(pc.readable()){pc.getc();}
baxterja 79:5f24cfd685d8 172 pc.printf("p%d",probe_number);
baxterja 79:5f24cfd685d8 173 }
baxterja 79:5f24cfd685d8 174
baxterja 73:b059b5bdc664 175 while(sampling_status == 0)//wait until the ADCs read a new value
baxterja 73:b059b5bdc664 176 {
baxterja 73:b059b5bdc664 177 status_0 = 1;
baxterja 77:1ee17a9e9f8b 178 print_filter_data(&pc);
baxterja 75:8bb94685c80b 179 //Thread::wait(.0001);
baxterja 73:b059b5bdc664 180 }
baxterja 73:b059b5bdc664 181 sampling_status = 0;//sets sampling status to 0. DMA sets it to one once ADCs sample
baxterja 73:b059b5bdc664 182 status_0 = 0;//Tied to D0. use an O-scope to measure how much free time there is to play with.
baxterja 73:b059b5bdc664 183 status_1 = 1;//Tied to D1. use an O-scope to measure how much time the processing takes
baxterja 73:b059b5bdc664 184
baxterja 77:1ee17a9e9f8b 185 for(int i = 0; i < len; i++)
bmazzeo 61:a56cca07d4a6 186 {
baxterja 73:b059b5bdc664 187 static_output_array0[i] = out_val_pre[DAC_COUNTER];//DAC output
baxterja 73:b059b5bdc664 188 DAC_COUNTER++;//Counter to kepp track of where we are in our precomputed table
baxterja 73:b059b5bdc664 189 if (DAC_COUNTER>=pre_compute_length) {DAC_COUNTER = 0;}//wrap around the counter
baxterja 77:1ee17a9e9f8b 190 //static_output_array0[i+1] = out_val_pre[DAC_COUNTER];//DAC output
baxterja 77:1ee17a9e9f8b 191 //DAC_COUNTER++;//Counter to kepp track of where we are in our precomputed table
baxterja 77:1ee17a9e9f8b 192 //if (DAC_COUNTER>=pre_compute_length) {DAC_COUNTER = 0;}//wrap around the counter
baxterja 73:b059b5bdc664 193
baxterja 77:1ee17a9e9f8b 194 input_50k[1][i]=float(static_input_array1[i]);
baxterja 77:1ee17a9e9f8b 195 // input_50k[3][i/2]=static_input_array1[i+1];
baxterja 77:1ee17a9e9f8b 196 input_50k[0][i]=float(static_input_array0[i]);
baxterja 77:1ee17a9e9f8b 197 //input_50k[2][i/2]=static_input_array0[i+1];
baxterja 73:b059b5bdc664 198
baxterja 73:b059b5bdc664 199
baxterja 73:b059b5bdc664 200
baxterja 73:b059b5bdc664 201 }//End of for loop going throught the buffer of adc samples
baxterja 77:1ee17a9e9f8b 202 //input_50k[0] = static_input_array0;
baxterja 77:1ee17a9e9f8b 203 //input_50k[1] = static_input_array1;
baxterja 78:10b2916b8f5c 204 f1.input(input_50k,64,DEMOD_200HZ);
baxterja 78:10b2916b8f5c 205 f1_b.input(input_50k,64,DEMOD_1000HZ);
baxterja 77:1ee17a9e9f8b 206 //status_3 = 1;
baxterja 77:1ee17a9e9f8b 207 //pc.printf("Y");
baxterja 77:1ee17a9e9f8b 208 //status_3 = 0;
baxterja 73:b059b5bdc664 209
baxterja 70:8cd7a8a2c153 210
baxterja 73:b059b5bdc664 211 status_1 = 0;//turn off D1 used in deterimining how long processing is taking
baxterja 73:b059b5bdc664 212 //filter_input_array[i] = (float) (((int)static_input_array0[i]) - 0x8000);
baxterja 73:b059b5bdc664 213 //arm_fir_f32(&S, filter_input_array, filter_output_array, len);
baxterja 73:b059b5bdc664 214
baxterja 73:b059b5bdc664 215 }//end of while loop
baxterja 73:b059b5bdc664 216
baxterja 73:b059b5bdc664 217 //for(int i = 0; i<PRINT_BUFFER_LENGTH; i++)//print all the adc values measured
baxterja 73:b059b5bdc664 218 //{
baxterja 73:b059b5bdc664 219 // printf("%.1f %.1f\n\r",output_print_buffer[i],output_print_buffer2[i]);
baxterja 73:b059b5bdc664 220 //}
baxterja 73:b059b5bdc664 221
baxterja 70:8cd7a8a2c153 222
bmazzeo 61:a56cca07d4a6 223 }
bmazzeo 63:7903a33e2fd4 224