lab 1 code

Dependencies:   CMSIS-DSP_for_STM32F746G BSP_DISCO_F746NG

Committer:
bmazzeo
Date:
Wed Jan 01 20:47:48 2020 +0000
Revision:
28:fe7747b89fb3
Parent:
27:0d65cfcc9001
Child:
29:7d3fff4ac41b
DOA computes phase angle correctly (it appears) - conversion to degrees still needs to happen.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bmazzeo 23:d938f87dd1ee 1 /**
bmazzeo 23:d938f87dd1ee 2 ******************************************************************************
bmazzeo 23:d938f87dd1ee 3 * @file signal_processing.c
bmazzeo 23:d938f87dd1ee 4 * @author Brian Mazzeo
bmazzeo 23:d938f87dd1ee 5 * @date 2020
bmazzeo 23:d938f87dd1ee 6 * @brief This file provides a set of code for signal processing in 487.
bmazzeo 23:d938f87dd1ee 7 * Parts are taken from example code from STMIcroelectronics
bmazzeo 23:d938f87dd1ee 8 ******************************************************************************
bmazzeo 23:d938f87dd1ee 9 * @attention
bmazzeo 23:d938f87dd1ee 10 * This code was specifically developed for BYU ECEn 487 course
bmazzeo 23:d938f87dd1ee 11 * Introduction to Digital Signal Processing.
bmazzeo 23:d938f87dd1ee 12 *
bmazzeo 23:d938f87dd1ee 13 *
bmazzeo 23:d938f87dd1ee 14 ******************************************************************************
bmazzeo 23:d938f87dd1ee 15 */
bmazzeo 23:d938f87dd1ee 16
bmazzeo 23:d938f87dd1ee 17 #include "mbed.h"
bmazzeo 23:d938f87dd1ee 18 #include "stm32746g_discovery_lcd.h"
bmazzeo 24:9ac1187f9012 19 #include "arm_math.h"
bmazzeo 24:9ac1187f9012 20
bmazzeo 24:9ac1187f9012 21
bmazzeo 24:9ac1187f9012 22 /* ----------------------------------------------------------------------
bmazzeo 27:0d65cfcc9001 23 ** Defines for signal processing
bmazzeo 24:9ac1187f9012 24 ** ------------------------------------------------------------------- */
bmazzeo 24:9ac1187f9012 25
bmazzeo 24:9ac1187f9012 26 #define AUDIO_BLOCK_SAMPLES ((uint32_t)128) // Number of samples (L and R) in audio block (each samples is 16 bits)
bmazzeo 28:fe7747b89fb3 27 #define NUM_TAPS 64
bmazzeo 28:fe7747b89fb3 28
bmazzeo 28:fe7747b89fb3 29 #define mic_distance 0.0211 // [m] Distance between microphones on ST32F746G
bmazzeo 28:fe7747b89fb3 30 #define c_sound 344 // [m/s] Speed of sound at 71 deg Fahrenheit
bmazzeo 28:fe7747b89fb3 31 #define Omega_S 16000 // [Hz] Sample rate
bmazzeo 28:fe7747b89fb3 32 #define Omega_C 1000 // [Hz] Carrier frequency
bmazzeo 28:fe7747b89fb3 33 #define omega_c 2*PI*Omega_C/Omega_S // Hilbert Transform Frequency
bmazzeo 24:9ac1187f9012 34
bmazzeo 24:9ac1187f9012 35 /* ----------------------------------------------------------------------
bmazzeo 25:5412779376a7 36 ** FIR Coefficients buffer generated using fdatool MATLAB function.
bmazzeo 28:fe7747b89fb3 37 ** Fpass = 100
bmazzeo 28:fe7747b89fb3 38 ** Fstop = 400
bmazzeo 28:fe7747b89fb3 39 ** Order = 255
bmazzeo 28:fe7747b89fb3 40 ** Type = equiripple
bmazzeo 28:fe7747b89fb3 41 ** Precision = Single-precision floating point
bmazzeo 25:5412779376a7 42 ** ------------------------------------------------------------------- */
bmazzeo 25:5412779376a7 43
bmazzeo 28:fe7747b89fb3 44 const float32_t LPF_coeffs[256] = {
bmazzeo 28:fe7747b89fb3 45 -3.166635361e-05,-1.870986307e-05,-2.394712101e-05,-2.990036774e-05,-3.658870264e-05,
bmazzeo 28:fe7747b89fb3 46 -4.399371028e-05,-5.209316805e-05,-6.081685933e-05,-7.011051639e-05,-7.988819561e-05,
bmazzeo 28:fe7747b89fb3 47 -9.004087042e-05,-0.000100387304,-0.000110787405,-0.0001210676273,-0.0001309535583,
bmazzeo 28:fe7747b89fb3 48 -0.0001402696507,-0.0001487127156,-0.000156007547,-0.000161856733,-0.0001659371774,
bmazzeo 28:fe7747b89fb3 49 -0.0001679307898,-0.0001674937957,-0.0001643116557,-0.0001580463286,-0.0001483879751,
bmazzeo 28:fe7747b89fb3 50 -0.0001350368111,-0.0001177328377,-9.621375648e-05,-7.031142741e-05,-3.984871728e-05,
bmazzeo 28:fe7747b89fb3 51 -4.752255791e-06,3.502548134e-05,7.943151286e-05, 0.00012836518,0.0001816200675,
bmazzeo 28:fe7747b89fb3 52 0.0002389207075,0.0002998831333,0.0003640493087,0.0004308363423,0.0004995908821,
bmazzeo 28:fe7747b89fb3 53 0.000569541764,0.0006398341502,0.0007095160545,0.0007775573758,0.0008428392466,
bmazzeo 28:fe7747b89fb3 54 0.0009041857556,0.0009603485814, 0.001010049134, 0.001051956089, 0.001084744697,
bmazzeo 28:fe7747b89fb3 55 0.001107070362, 0.001117624925, 0.001115125953, 0.001098367968, 0.001066206489,
bmazzeo 28:fe7747b89fb3 56 0.001017625327,0.0009517096914,0.0008677172009,0.0007650525076,0.0006433351082,
bmazzeo 28:fe7747b89fb3 57 0.0005023755366,0.0003422336886,0.0001632031344,-3.414340608e-05,-0.0002489731414,
bmazzeo 28:fe7747b89fb3 58 -0.0004801462928,-0.0007262464496,-0.0009855407989,-0.001256009215,-0.001535319607,
bmazzeo 28:fe7747b89fb3 59 -0.001820859499, -0.00210972107,-0.002398737939,-0.002684480743, -0.00296330289,
bmazzeo 28:fe7747b89fb3 60 -0.003231336828,-0.003484555287,-0.003718773369,-0.003929710016,-0.004113005474,
bmazzeo 28:fe7747b89fb3 61 -0.004264282528,-0.004379170015,-0.004453371279,-0.004482686054,-0.004463084508,
bmazzeo 28:fe7747b89fb3 62 -0.00439072866,-0.004262049217,-0.004073764663, -0.00382295344, -0.0035070749,
bmazzeo 28:fe7747b89fb3 63 -0.003124034265,-0.002672198461,-0.002150455024,-0.001558220945,-0.0008954905206,
bmazzeo 28:fe7747b89fb3 64 -0.0001628377504,0.0006385485176, 0.001506871195, 0.002439704956, 0.00343400985,
bmazzeo 28:fe7747b89fb3 65 0.004486127291, 0.005591807421, 0.006746214349, 0.007943967357, 0.00917916093,
bmazzeo 28:fe7747b89fb3 66 0.01044541784, 0.01173591614, 0.01304345857, 0.01436051074, 0.01567927189,
bmazzeo 28:fe7747b89fb3 67 0.01699172705, 0.01828972809, 0.01956504397, 0.02080944739, 0.02201477997,
bmazzeo 28:fe7747b89fb3 68 0.02317302115, 0.02427636459, 0.02531728894, 0.02628861926, 0.0271836035,
bmazzeo 28:fe7747b89fb3 69 0.0279959701, 0.02871998027, 0.02935049124, 0.02988300286, 0.03031369485,
bmazzeo 28:fe7747b89fb3 70 0.03063946404, 0.03085796162, 0.03096760809, 0.03096760809, 0.03085796162,
bmazzeo 28:fe7747b89fb3 71 0.03063946404, 0.03031369485, 0.02988300286, 0.02935049124, 0.02871998027,
bmazzeo 28:fe7747b89fb3 72 0.0279959701, 0.0271836035, 0.02628861926, 0.02531728894, 0.02427636459,
bmazzeo 28:fe7747b89fb3 73 0.02317302115, 0.02201477997, 0.02080944739, 0.01956504397, 0.01828972809,
bmazzeo 28:fe7747b89fb3 74 0.01699172705, 0.01567927189, 0.01436051074, 0.01304345857, 0.01173591614,
bmazzeo 28:fe7747b89fb3 75 0.01044541784, 0.00917916093, 0.007943967357, 0.006746214349, 0.005591807421,
bmazzeo 28:fe7747b89fb3 76 0.004486127291, 0.00343400985, 0.002439704956, 0.001506871195,0.0006385485176,
bmazzeo 28:fe7747b89fb3 77 -0.0001628377504,-0.0008954905206,-0.001558220945,-0.002150455024,-0.002672198461,
bmazzeo 28:fe7747b89fb3 78 -0.003124034265, -0.0035070749, -0.00382295344,-0.004073764663,-0.004262049217,
bmazzeo 28:fe7747b89fb3 79 -0.00439072866,-0.004463084508,-0.004482686054,-0.004453371279,-0.004379170015,
bmazzeo 28:fe7747b89fb3 80 -0.004264282528,-0.004113005474,-0.003929710016,-0.003718773369,-0.003484555287,
bmazzeo 28:fe7747b89fb3 81 -0.003231336828, -0.00296330289,-0.002684480743,-0.002398737939, -0.00210972107,
bmazzeo 28:fe7747b89fb3 82 -0.001820859499,-0.001535319607,-0.001256009215,-0.0009855407989,-0.0007262464496,
bmazzeo 28:fe7747b89fb3 83 -0.0004801462928,-0.0002489731414,-3.414340608e-05,0.0001632031344,0.0003422336886,
bmazzeo 28:fe7747b89fb3 84 0.0005023755366,0.0006433351082,0.0007650525076,0.0008677172009,0.0009517096914,
bmazzeo 28:fe7747b89fb3 85 0.001017625327, 0.001066206489, 0.001098367968, 0.001115125953, 0.001117624925,
bmazzeo 28:fe7747b89fb3 86 0.001107070362, 0.001084744697, 0.001051956089, 0.001010049134,0.0009603485814,
bmazzeo 28:fe7747b89fb3 87 0.0009041857556,0.0008428392466,0.0007775573758,0.0007095160545,0.0006398341502,
bmazzeo 28:fe7747b89fb3 88 0.000569541764,0.0004995908821,0.0004308363423,0.0003640493087,0.0002998831333,
bmazzeo 28:fe7747b89fb3 89 0.0002389207075,0.0001816200675, 0.00012836518,7.943151286e-05,3.502548134e-05,
bmazzeo 28:fe7747b89fb3 90 -4.752255791e-06,-3.984871728e-05,-7.031142741e-05,-9.621375648e-05,-0.0001177328377,
bmazzeo 28:fe7747b89fb3 91 -0.0001350368111,-0.0001483879751,-0.0001580463286,-0.0001643116557,-0.0001674937957,
bmazzeo 28:fe7747b89fb3 92 -0.0001679307898,-0.0001659371774,-0.000161856733,-0.000156007547,-0.0001487127156,
bmazzeo 28:fe7747b89fb3 93 -0.0001402696507,-0.0001309535583,-0.0001210676273,-0.000110787405,-0.000100387304,
bmazzeo 28:fe7747b89fb3 94 -9.004087042e-05,-7.988819561e-05,-7.011051639e-05,-6.081685933e-05,-5.209316805e-05,
bmazzeo 28:fe7747b89fb3 95 -4.399371028e-05,-3.658870264e-05,-2.990036774e-05,-2.394712101e-05,-1.870986307e-05,
bmazzeo 28:fe7747b89fb3 96 -3.166635361e-05
bmazzeo 25:5412779376a7 97 };
bmazzeo 25:5412779376a7 98
bmazzeo 24:9ac1187f9012 99
bmazzeo 24:9ac1187f9012 100 /* -------------------------------------------------------------------
bmazzeo 24:9ac1187f9012 101 * Declare State buffer of size (numTaps + blockSize - 1)
bmazzeo 24:9ac1187f9012 102 * ------------------------------------------------------------------- */
bmazzeo 24:9ac1187f9012 103
bmazzeo 28:fe7747b89fb3 104 static float32_t S_0i_FIRstate[AUDIO_BLOCK_SAMPLES + NUM_TAPS - 1];
bmazzeo 28:fe7747b89fb3 105 static float32_t S_0q_FIRstate[AUDIO_BLOCK_SAMPLES + NUM_TAPS - 1];
bmazzeo 28:fe7747b89fb3 106 static float32_t S_1i_FIRstate[AUDIO_BLOCK_SAMPLES + NUM_TAPS - 1];
bmazzeo 28:fe7747b89fb3 107 static float32_t S_1q_FIRstate[AUDIO_BLOCK_SAMPLES + NUM_TAPS - 1];
bmazzeo 28:fe7747b89fb3 108
bmazzeo 28:fe7747b89fb3 109 /* Need to have multiplies pre-computed */
bmazzeo 28:fe7747b89fb3 110 static float32_t i_phase_mult_array[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 111 static float32_t q_phase_mult_array[AUDIO_BLOCK_SAMPLES];
bmazzeo 24:9ac1187f9012 112
bmazzeo 28:fe7747b89fb3 113 static float32_t x_0i[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 114 static float32_t x_0q[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 115 static float32_t x_1i[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 116 static float32_t x_1q[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 117
bmazzeo 28:fe7747b89fb3 118 static float32_t s_0i[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 119 static float32_t s_0q[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 120 static float32_t s_1i[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 121 static float32_t s_1q[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 122
bmazzeo 28:fe7747b89fb3 123 static float32_t s0_s1star_real[AUDIO_BLOCK_SAMPLES];
bmazzeo 28:fe7747b89fb3 124 static float32_t s0_s1star_imag[AUDIO_BLOCK_SAMPLES];
bmazzeo 24:9ac1187f9012 125
bmazzeo 24:9ac1187f9012 126
bmazzeo 25:5412779376a7 127 /* Important to have the structure outside of the execution so it can be initialized */
bmazzeo 28:fe7747b89fb3 128 arm_fir_instance_f32 S_0i;
bmazzeo 28:fe7747b89fb3 129 arm_fir_instance_f32 S_0q;
bmazzeo 28:fe7747b89fb3 130 arm_fir_instance_f32 S_1i;
bmazzeo 28:fe7747b89fb3 131 arm_fir_instance_f32 S_1q;
bmazzeo 23:d938f87dd1ee 132
bmazzeo 25:5412779376a7 133 /**
bmazzeo 25:5412779376a7 134 * @brief Initialize filter structures to be used in loops later
bmazzeo 25:5412779376a7 135 * @retval None
bmazzeo 25:5412779376a7 136 */
bmazzeo 25:5412779376a7 137 void initalize_signal_processing(void) {
bmazzeo 25:5412779376a7 138
bmazzeo 25:5412779376a7 139 /* Call FIR init function to initialize the instance structure. */
bmazzeo 28:fe7747b89fb3 140 //arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 141 arm_fir_init_f32(&S_0i, NUM_TAPS, (float32_t *) &LPF_coeffs[0], &S_0i_FIRstate[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 142 arm_fir_init_f32(&S_0q, NUM_TAPS, (float32_t *) &LPF_coeffs[0], &S_0q_FIRstate[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 143 arm_fir_init_f32(&S_1i, NUM_TAPS, (float32_t *) &LPF_coeffs[0], &S_1i_FIRstate[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 144 arm_fir_init_f32(&S_1q, NUM_TAPS, (float32_t *) &LPF_coeffs[0], &S_1q_FIRstate[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 25:5412779376a7 145
bmazzeo 28:fe7747b89fb3 146 uint32_t i;
bmazzeo 28:fe7747b89fb3 147 for (i=0; i<AUDIO_BLOCK_SAMPLES; i++)
bmazzeo 28:fe7747b89fb3 148 {
bmazzeo 28:fe7747b89fb3 149 i_phase_mult_array[i] = cos(omega_c * i);
bmazzeo 28:fe7747b89fb3 150 q_phase_mult_array[i] = -sin(omega_c * i);
bmazzeo 28:fe7747b89fb3 151 }
bmazzeo 25:5412779376a7 152 }
bmazzeo 23:d938f87dd1ee 153
bmazzeo 23:d938f87dd1ee 154 /**
bmazzeo 23:d938f87dd1ee 155 * @brief Process audio channel signals
bmazzeo 23:d938f87dd1ee 156 * @param L_channel: Pointer to Left channel data (float)
bmazzeo 23:d938f87dd1ee 157 * @param R_channel: Pointer to Right channel data (float)
bmazzeo 23:d938f87dd1ee 158 * @param Signal_Length: length of data to process
bmazzeo 23:d938f87dd1ee 159 * @retval None
bmazzeo 23:d938f87dd1ee 160 */
bmazzeo 23:d938f87dd1ee 161 void process_audio_channel_signals(float* L_channel, float* R_channel, uint16_t Signal_Length)
bmazzeo 23:d938f87dd1ee 162 {
bmazzeo 28:fe7747b89fb3 163 char buf[40];
bmazzeo 23:d938f87dd1ee 164 BSP_LCD_SetTextColor(LCD_COLOR_CYAN);
bmazzeo 23:d938f87dd1ee 165 sprintf(buf, "Processing Signals" );
bmazzeo 23:d938f87dd1ee 166 BSP_LCD_DisplayStringAt(0, 150, (uint8_t *) buf, LEFT_MODE);
bmazzeo 28:fe7747b89fb3 167
bmazzeo 28:fe7747b89fb3 168 uint32_t i;
bmazzeo 24:9ac1187f9012 169
bmazzeo 28:fe7747b89fb3 170 /* Need these addresses */
bmazzeo 28:fe7747b89fb3 171 float32_t* L_chan_mem_address = L_channel;
bmazzeo 28:fe7747b89fb3 172 float32_t* R_chan_mem_address = R_channel;
bmazzeo 24:9ac1187f9012 173 float32_t L_audio_value;
bmazzeo 24:9ac1187f9012 174 float32_t R_audio_value;
bmazzeo 28:fe7747b89fb3 175
bmazzeo 28:fe7747b89fb3 176 for (i=0; i<Signal_Length; i++)
bmazzeo 28:fe7747b89fb3 177 {
bmazzeo 28:fe7747b89fb3 178 L_audio_value = *L_chan_mem_address;
bmazzeo 28:fe7747b89fb3 179 x_0i[i] = L_audio_value * i_phase_mult_array[i];
bmazzeo 28:fe7747b89fb3 180 x_0q[i] = L_audio_value * q_phase_mult_array[i];
bmazzeo 23:d938f87dd1ee 181
bmazzeo 28:fe7747b89fb3 182 R_audio_value = *R_chan_mem_address;
bmazzeo 28:fe7747b89fb3 183 x_1i[i] = R_audio_value * i_phase_mult_array[i];
bmazzeo 28:fe7747b89fb3 184 x_1q[i] = R_audio_value * q_phase_mult_array[i];
bmazzeo 28:fe7747b89fb3 185
bmazzeo 28:fe7747b89fb3 186 L_chan_mem_address++;
bmazzeo 28:fe7747b89fb3 187 R_chan_mem_address++;
bmazzeo 28:fe7747b89fb3 188 }
bmazzeo 28:fe7747b89fb3 189
bmazzeo 28:fe7747b89fb3 190 /* Calls the FIR filters and proceeses the audio block */
bmazzeo 28:fe7747b89fb3 191 arm_fir_f32(&S_0i, &x_0i[0], &s_0i[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 192 arm_fir_f32(&S_0q, &x_0q[0], &s_0q[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 193 arm_fir_f32(&S_1i, &x_1i[0], &s_1i[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 194 arm_fir_f32(&S_1q, &x_1q[0], &s_1q[0], AUDIO_BLOCK_SAMPLES);
bmazzeo 28:fe7747b89fb3 195
bmazzeo 28:fe7747b89fb3 196
bmazzeo 28:fe7747b89fb3 197 float32_t s0_s1star_sum_real = 0;
bmazzeo 28:fe7747b89fb3 198 float32_t s0_s1star_sum_imag = 0;
bmazzeo 28:fe7747b89fb3 199
bmazzeo 28:fe7747b89fb3 200 /* Complex Multiply and Summation*/
bmazzeo 28:fe7747b89fb3 201 for (i=0; i<Signal_Length; i++)
bmazzeo 28:fe7747b89fb3 202 {
bmazzeo 28:fe7747b89fb3 203 s0_s1star_real[i] = s_0i[i] * s_1i[i] + s_0q[i] * s_1q[i];
bmazzeo 28:fe7747b89fb3 204 s0_s1star_imag[i] = s_0q[i] * s_1i[i] - s_0i[i] * s_1q[i];
bmazzeo 28:fe7747b89fb3 205
bmazzeo 28:fe7747b89fb3 206 s0_s1star_sum_real += s0_s1star_real[i];
bmazzeo 28:fe7747b89fb3 207 s0_s1star_sum_imag += s0_s1star_imag[i];
bmazzeo 28:fe7747b89fb3 208
bmazzeo 28:fe7747b89fb3 209 }
bmazzeo 28:fe7747b89fb3 210
bmazzeo 28:fe7747b89fb3 211 /* Compute angle */
bmazzeo 28:fe7747b89fb3 212 float32_t phase_angle = atan2(s0_s1star_sum_imag, s0_s1star_sum_real);
bmazzeo 28:fe7747b89fb3 213 float32_t direction_angle_radians = asin((c_sound / ((float32_t) mic_distance * (float32_t) Omega_C)) * phase_angle);
bmazzeo 28:fe7747b89fb3 214 float32_t direction_angle_degrees = direction_angle_radians * (180 / PI);
bmazzeo 28:fe7747b89fb3 215
bmazzeo 28:fe7747b89fb3 216 BSP_LCD_SetTextColor(LCD_COLOR_CYAN);
bmazzeo 28:fe7747b89fb3 217 sprintf(buf, "Angle:%6.2f degrees", direction_angle_degrees);
bmazzeo 28:fe7747b89fb3 218 BSP_LCD_DisplayStringAt(0, 175, (uint8_t *) buf, LEFT_MODE);
bmazzeo 28:fe7747b89fb3 219
bmazzeo 28:fe7747b89fb3 220 sprintf(buf, "PAngle:%6.2f rad", phase_angle);
bmazzeo 28:fe7747b89fb3 221 BSP_LCD_DisplayStringAt(0, 200, (uint8_t *) buf, LEFT_MODE);
bmazzeo 28:fe7747b89fb3 222
bmazzeo 23:d938f87dd1ee 223 L_chan_mem_address = L_channel;
bmazzeo 23:d938f87dd1ee 224 R_chan_mem_address = R_channel;
bmazzeo 23:d938f87dd1ee 225 for (i=0; i<Signal_Length; i++)
bmazzeo 23:d938f87dd1ee 226 {
bmazzeo 24:9ac1187f9012 227 //L_audio_value = *L_chan_mem_address;
bmazzeo 28:fe7747b89fb3 228 L_audio_value = *L_chan_mem_address;
bmazzeo 24:9ac1187f9012 229 *L_chan_mem_address = L_audio_value;
bmazzeo 23:d938f87dd1ee 230 L_chan_mem_address++;
bmazzeo 23:d938f87dd1ee 231
bmazzeo 23:d938f87dd1ee 232 R_audio_value = *R_chan_mem_address;
bmazzeo 24:9ac1187f9012 233 *R_chan_mem_address = R_audio_value;
bmazzeo 23:d938f87dd1ee 234 R_chan_mem_address++;
bmazzeo 23:d938f87dd1ee 235 }
bmazzeo 23:d938f87dd1ee 236
bmazzeo 23:d938f87dd1ee 237 }