Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Impedance_Fast_Circuitry by
Diff: main.cpp
- Revision:
- 72:0b554f5026b9
- Parent:
- 70:8cd7a8a2c153
- Child:
- 73:b059b5bdc664
--- a/main.cpp Wed May 17 23:10:03 2017 +0000 +++ b/main.cpp Thu May 18 20:19:12 2017 +0000 @@ -8,7 +8,7 @@ // DSP #include "dsp.h" -#define PRINT_BUFFER_LENGTH 2000 +#define PRINT_BUFFER_LENGTH 10000 // for debug purposes @@ -55,6 +55,8 @@ // This function will precompute the cos and sin tables used in the rest of the program for(int precompute_counter = 0; precompute_counter < pre_compute_length; precompute_counter++){ out_val_pre[precompute_counter] = (int) (cos(twopi * CarrierFrequency /SAMPLEFREQUENCY * precompute_counter) * 2046.0 + 2048.0); + //if(precompute_counter<len) + // static_output_array0[precompute_counter] = out_val_pre[precompute_counter]; //printf("%d\n\r",out_val_pre[precompute_counter]); //i_mod_pre[precompute_counter] = (cos(twopi * CarrierFrequency * TimerInterruptInMicroSeconds * 1e-6 * precompute_counter)); //q_mod_pre[precompute_counter] = (-sin(twopi * CarrierFrequency * TimerInterruptInMicroSeconds * 1e-6 * precompute_counter)); @@ -124,18 +126,28 @@ //printf("%d\n\r",static_input_array0[0]); for(int i = 0; i < len; i++) { - static_output_array0[i] = static_input_array0[i] >> 4; - + //static_output_array0[i] = static_input_array0[i] >> 4; + static_output_array0[i] = out_val_pre[DAC_COUNTER]; + DAC_COUNTER++; + if (DAC_COUNTER>=pre_compute_length) + { + DAC_COUNTER = 0; + } //printf("%d\n\r",static_input_array0[i]); - output_print_buffer[print_buffer_count+i] = static_input_array0[i]; - output_print_buffer2[print_buffer_count+i] = static_input_array1[i]; + - if (i>4&&static_input_array0[i]==static_input_array0[i-1]&&static_input_array0[i]==static_input_array0[i-2]) - printf("Y"); - //if (print_buffer_count+i>=PRINT_BUFFER_LENGTH) + //output_print_buffer[print_buffer_count] = static_input_array0[i]; + //output_print_buffer2[print_buffer_count] = static_input_array1[i]; + + + //if (i>4&&static_input_array0[i]==static_input_array0[i-1]&&static_input_array0[i]==static_input_array0[i-2]) + // printf("Y"); + print_buffer_count++; + + //if (print_buffer_count>=PRINT_BUFFER_LENGTH) //{ - // break; - // } + // break; + //} } //print_buffer_count+=len;