///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR ANSI C/C++ Compiler V6.30.1.53127/W32 for ARM    08/Mar/2012  18:18:23 /
// Copyright 1999-2011 IAR Systems AB.                                        /
//                                                                            /
//    Cpu mode     =  thumb                                                   /
//    Endian       =  little                                                  /
//    Source file  =  D:\Profiles\b01252\My Documents\Freescale\P0\software\s /
//                    ample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_ /
//                    sc\src\projects\TWRK20D50M_Demo\fft_test\fft_test.c     /
//    Command line =  "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\src\projects\TWRK20D50M_Demo\fft_test\fft_test.c"   /
//                    -D IAR -D TOWER -D TWR_K20D50M -lCN                     /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\" /
//                     -lB "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\" -o          /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\Obj\"  /
//                    --no_cse --no_unroll --no_inline --no_code_motion       /
//                    --no_tbaa --no_clustering --no_scheduling --debug       /
//                    --endian=little --cpu=Cortex-M4 -e --fpu=None           /
//                    --dlib_config "C:\Program Files\IAR Systems\Embedded    /
//                    Workbench 6.0_5\arm\INC\c\DLib_Config_Normal.h" -I      /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\common\" -I  /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\cpu\" -I     /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\cpu\headers\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\uart\" -I        /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\drivers\mcg\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\wdog\" -I        /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\drivers\rcm\ /
//                    " -I "D:\Profiles\b01252\My                             /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\drivers\lptmr\" -I       /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\platforms\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\" -I                /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\projects\TWR /
//                    K20D50M_Demo\" -I "D:\Profiles\b01252\My                /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \dma\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \adc16\" -I "D:\Profiles\b01252\My                      /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \i2c\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \tsi\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \adc_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \angle_calculation\" -I "D:\Profiles\b01252\My          /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \buzzer\" -I "D:\Profiles\b01252\My                     /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \fft_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \irda_test\" -I "D:\Profiles\b01252\My                  /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \cmt_test\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \protocol\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \task_mgr\" -I "D:\Profiles\b01252\My                   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \TWRK20_specific\" -I "D:\Profiles\b01252\My            /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\projects\TWRK20D50M_Demo /
//                    \rtc\" -I "D:\Profiles\b01252\My                        /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Lib\Lib\interm /
//                    ediateFiles\" -I "D:\Profiles\b01252\My                 /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Lib\Include\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4 /
//                    \DeviceSupport\ARM\ARMCM4\" -I "D:\Profiles\b01252\My   /
//                    Documents\Freescale\P0\software\sample code             /
//                    cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\build\ia /
//                    r\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4\CoreSupport\"  /
//                    -I "D:\Profiles\b01252\My Documents\Freescale\P0\softwa /
//                    re\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50 /
//                    MHz_sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\CM4 /
//                    \CoreSupportLiker Options-Library\" -I                  /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\src\CMSIS\DSP_Li /
//                    b\Lib\intermediateFiles\arm_cortexM4_math.lib\" -I      /
//                    "D:\Profiles\b01252\My Documents\Freescale\P0\software\ /
//                    sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz /
//                    _sc\build\iar\TWRK20D50M_Demo\..\..\..\build\" -Ol      /
//                    --use_c++_inline -I "C:\Program Files\IAR               /
//                    Systems\Embedded Workbench 6.0_5\arm\CMSIS\Include\"    /
//                    -D ARM_MATH_CM4                                         /
//    List file    =  D:\Profiles\b01252\My Documents\Freescale\P0\software\s /
//                    ample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_ /
//                    sc\build\iar\TWRK20D50M_Demo\FLASH_128KB_PFLASH\List\ff /
//                    t_test.s                                                /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME fft_test

        #define SHT_PROGBITS 0x1

        EXTERN abs
        EXTERN adc_buffer
        EXTERN arm_cmplx_mag_q15
        EXTERN arm_rfft_init_q15
        EXTERN arm_rfft_q15
        EXTERN buffer
        EXTERN input_fall
        EXTERN max_value
        EXTERN printf

        PUBLIC ADC_test_signal
        PUBLIC adc_buffer2
        PUBLIC adc_gain
        PUBLIC adc_offset
        PUBLIC adc_sample_counter
        PUBLIC clap_counter
        PUBLIC clap_detect_threshold
        PUBLIC clap_detected
        PUBLIC clap_energy
        PUBLIC clap_filter2
        PUBLIC clap_peak_energy
        PUBLIC clap_silence_band
        PUBLIC clap_silence_threshold
        PUBLIC display_fft_info
        PUBLIC energy_scaled
        PUBLIC filter_1
        PUBLIC irfft128Flag
        PUBLIC mag_mean
        PUBLIC median_energy
        PUBLIC peak_index
        PUBLIC peak_table
        PUBLIC r128doBitReverse
        PUBLIC real128_fft
        PUBLIC rfft128Magnitud
        PUBLIC rfft128Size
        PUBLIC rfft128testOutput
        PUBLIC rfftFlag
        PUBLIC ti_msec
        PUBLIC tone_counter
        PUBLIC tone_detected
        PUBLIC tone_filer
        PUBLIC tone_filter
        PUBLIC tone_filter_init
        PUBLIC tone_silence_band

// D:\Profiles\b01252\My Documents\Freescale\P0\software\sample code cesar\TWR-K20D50M_LABS_AND_CE\kinetis_50MHz_sc\src\projects\TWRK20D50M_Demo\fft_test\fft_test.c
//    1 #include "common.h"
//    2 //#include "fft_sample.h"
//    3 #include "arm_math.h" 
//    4 #include "adc_test.h"
//    5 #include "fft_test.h"
//    6 #include "TWR_K20D50M_DEF.h"
//    7 
//    8 
//    9 char filter_1(uint16 input, filter1_t   *fil);
//   10 void tone_filter_init(void);
//   11 void tone_clap_detection(void);
//   12 
//   13 
//   14 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   15  filter1_t  tone_filter;
tone_filter:
        DS8 12
//   16 
//   17 
//   18 
//   19 /************************************************Real 128 FFT Variables *********************************************************************/
//   20 
//   21 
//   22 /* ------------------------------------------------------------------- 
//   23 * External Input and Output buffer Declarations for FFT Bin Example 
//   24 * ------------------------------------------------------------------- */ 
//   25 extern int16 adc_buffer2[];
//   26 
//   27 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   28 q15_t rfft128testOutput[TEST_LENGTH_SAMPLES_RFFT_128*2]; 
rfft128testOutput:
        DS8 512

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   29 q15_t rfft128Magnitud[TEST_LENGTH_SAMPLES_RFFT_128];
rfft128Magnitud:
        DS8 256

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   30 q15_t mag_mean;
mag_mean:
        DS8 2
//   31 
//   32 /* ------------------------------------------------------------------ 
//   33 * Global variables for FFT Bin Example 
//   34 * ------------------------------------------------------------------- */ 

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   35 uint32_t rfft128Size = TEST_LENGTH_SAMPLES_RFFT_128; 
rfft128Size:
        DATA
        DC32 128

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   36 uint32_t irfft128Flag = 0; 
irfft128Flag:
        DS8 4

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   37 uint32_t r128doBitReverse = 1; 
r128doBitReverse:
        DATA
        DC32 1
//   38 
//   39 extern q15_t ADC_test_signal[]; //seņal de prueba
//   40 void tone_filer(void);
//   41 /*################################################Choose the FFT Algorithm######################################################################*/
//   42 #define REAL_FFT_128
//   43 //#undef REAL_FFT_128
//   44 //#define REAL_FFT_512
//   45 //#undef REAL_FFT_512
//   46 //#define COMPLEX_FFT_256
//   47 //#undef COMPLEX_FFT_256    
//   48 
//   49 /* Definitions */
//   50    #define NUMBER_OF_SAMPLES    128
//   51 
//   52 
//   53 /*  Variables */
//   54 //q15_t adc_buffer[NUMBER_OF_SAMPLES*2];          //ADC Samples buffer size 512 to suport all algorithm

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   55 uint16 adc_sample_counter = 0;
adc_sample_counter:
        DS8 2

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   56 uint32  ti_msec;
ti_msec:
        DS8 4

        SECTION `.data`:DATA:REORDER:NOROOT(0)
//   57 uint8 rfftFlag = 1;
rfftFlag:
        DATA
        DC8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   58 int32 clap_energy; //instant energey
clap_energy:
        DS8 4

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   59 int32 clap_peak_energy;  //this is decreased by timer
clap_peak_energy:
        DS8 4
//   60 
//   61 

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   62 char peak_index=0;
peak_index:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   63 FreqMag_t  peak_table[32];
peak_table:
        DS8 128
//   64 

        SECTION `.bss`:DATA:REORDER:NOROOT(2)
//   65 q15_t adc_buffer2[130];
adc_buffer2:
        DS8 260
//   66 extern int16 max_value;
//   67 
//   68 

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   69 int adc_gain  =     9;  //330 for 10 bits 
adc_gain:
        DATA
        DC32 9

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   70 int adc_offset = 1215;  //330 for 10 bits 
adc_offset:
        DATA
        DC32 1215
//   71 
//   72  

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   73 uint16 median_energy;
median_energy:
        DS8 2

        SECTION `.bss`:DATA:REORDER:NOROOT(1)
//   74 uint16 energy_scaled;
energy_scaled:
        DS8 2

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   75 char clap_detected;
clap_detected:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   76 char clap_counter;
clap_counter:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   77 char tone_detected;
tone_detected:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
//   78 char tone_counter;
tone_counter:
        DS8 1
//   79 
//   80 #define ADC_IN_LIMT 1500
//   81 #define CLAP_PULSE_TIME    7
//   82 #define CLAP_SILENCE_TIME 35
//   83 
//   84 #define TONE_SILENCE_TIME 40
//   85 
//   86 

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   87 uint32 clap_detect_threshold  =10000;
clap_detect_threshold:
        DATA
        DC32 10000

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   88 uint32 clap_silence_threshold = 100;
clap_silence_threshold:
        DATA
        DC32 100

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   89 uint32 clap_silence_band      = 1000;
clap_silence_band:
        DATA
        DC32 1000

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//   90 uint32 tone_silence_band      = 1000;
tone_silence_band:
        DATA
        DC32 1000
//   91 
//   92 
//   93 //runs every 7.8msec
//   94 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//   95 void clap_filter2(uint32 clap_filter)
//   96 {   static uint8 clap_trigger;
clap_filter2:
        PUSH     {R7,LR}
//   97     static uint8 time_clap_detection;
//   98     static uint8 time_clap_disabled;
//   99     
//  100     if ((abs(clap_energy - median_energy)> clap_detect_threshold)  && !clap_trigger) 
        LDR.W    R0,??DataTable4
        LDR      R0,[R0, #+0]
        LDR.W    R1,??DataTable4_1
        LDRH     R1,[R1, #+0]
        SUBS     R0,R0,R1
        BL       abs
        LDR.W    R1,??DataTable4_2
        LDR      R1,[R1, #+0]
        CMP      R1,R0
        BCS.N    ??clap_filter2_0
        LDR.W    R0,??DataTable4_3
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BNE.N    ??clap_filter2_0
//  101     {
//  102       clap_trigger=1;
        LDR.W    R0,??DataTable4_3
        MOVS     R1,#+1
        STRB     R1,[R0, #+0]
//  103       time_clap_detection=CLAP_PULSE_TIME;  //3 cycles  1/62 seg
        LDR.N    R0,??DataTable4_4
        MOVS     R1,#+7
        STRB     R1,[R0, #+0]
//  104       time_clap_disabled =CLAP_SILENCE_TIME; // time clap disabled
        LDR.N    R0,??DataTable4_5
        MOVS     R1,#+35
        STRB     R1,[R0, #+0]
//  105      }
//  106 
//  107    if (time_clap_detection)
??clap_filter2_0:
        LDR.N    R0,??DataTable4_4
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BEQ.N    ??clap_filter2_1
//  108    {
//  109      time_clap_detection--;
        LDR.N    R0,??DataTable4_4
        LDRB     R0,[R0, #+0]
        SUBS     R0,R0,#+1
        LDR.N    R1,??DataTable4_4
        STRB     R0,[R1, #+0]
//  110      if  (abs(clap_energy-median_energy)< clap_silence_threshold) clap_trigger=2;
        LDR.N    R0,??DataTable4
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable4_1
        LDRH     R1,[R1, #+0]
        SUBS     R0,R0,R1
        BL       abs
        LDR.N    R1,??DataTable4_6
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BCS.N    ??clap_filter2_2
        LDR.N    R0,??DataTable4_3
        MOVS     R1,#+2
        STRB     R1,[R0, #+0]
//  111      time_clap_disabled =CLAP_SILENCE_TIME; // time clap disabled
??clap_filter2_2:
        LDR.N    R0,??DataTable4_5
        MOVS     R1,#+35
        STRB     R1,[R0, #+0]
//  112    }
//  113    if (time_clap_disabled)
??clap_filter2_1:
        LDR.N    R0,??DataTable4_5
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BEQ.N    ??clap_filter2_3
//  114      { 
//  115      time_clap_disabled--;
        LDR.N    R0,??DataTable4_5
        LDRB     R0,[R0, #+0]
        SUBS     R0,R0,#+1
        LDR.N    R1,??DataTable4_5
        STRB     R0,[R1, #+0]
//  116      if  (abs(clap_energy-median_energy)> clap_silence_band) clap_trigger=3;
        LDR.N    R0,??DataTable4
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable4_1
        LDRH     R1,[R1, #+0]
        SUBS     R0,R0,R1
        BL       abs
        LDR.N    R1,??DataTable4_7
        LDR      R1,[R1, #+0]
        CMP      R1,R0
        BCS.N    ??clap_filter2_3
        LDR.N    R0,??DataTable4_3
        MOVS     R1,#+3
        STRB     R1,[R0, #+0]
//  117      }
//  118    if (time_clap_disabled==0 && clap_trigger)
??clap_filter2_3:
        LDR.N    R0,??DataTable4_5
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BNE.N    ??clap_filter2_4
        LDR.N    R0,??DataTable4_3
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BEQ.N    ??clap_filter2_4
//  119     {
//  120       if (clap_trigger == 2) 
        LDR.N    R0,??DataTable4_3
        LDRB     R0,[R0, #+0]
        CMP      R0,#+2
        BNE.N    ??clap_filter2_5
//  121      {
//  122        clap_detected=1;
        LDR.N    R0,??DataTable4_8
        MOVS     R1,#+1
        STRB     R1,[R0, #+0]
//  123        clap_counter++;
        LDR.N    R0,??DataTable4_9
        LDRB     R0,[R0, #+0]
        ADDS     R0,R0,#+1
        LDR.N    R1,??DataTable4_9
        STRB     R0,[R1, #+0]
//  124      }
//  125     clap_trigger=0;
??clap_filter2_5:
        LDR.N    R0,??DataTable4_3
        MOVS     R1,#+0
        STRB     R1,[R0, #+0]
//  126     } 
//  127 
//  128 }
??clap_filter2_4:
        POP      {R0,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??clap_trigger:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??time_clap_detection:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??time_clap_disabled:
        DS8 1
//  129 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  130 void tone_filer(void)
//  131 {
tone_filer:
        PUSH     {R7,LR}
//  132  static uint8 tone_trigger;
//  133  static char aux_tone_fil;
//  134  static uint8 time_tone_disabled;    
//  135  if (input_fall(tone_filter.filter_output,&aux_tone_fil))
        LDR.N    R1,??DataTable4_10
        LDR.N    R0,??DataTable4_11
        LDRB     R0,[R0, #+0]
        BL       input_fall
        CMP      R0,#+0
        BEQ.N    ??tone_filer_0
//  136   {
//  137     tone_trigger=1;
        LDR.N    R0,??DataTable4_12
        MOVS     R1,#+1
        STRB     R1,[R0, #+0]
//  138     time_tone_disabled =TONE_SILENCE_TIME;
        LDR.N    R0,??DataTable4_13
        MOVS     R1,#+40
        STRB     R1,[R0, #+0]
//  139   }
//  140   if (time_tone_disabled)
??tone_filer_0:
        LDR.N    R0,??DataTable4_13
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BEQ.N    ??tone_filer_1
//  141      { 
//  142      time_tone_disabled--;
        LDR.N    R0,??DataTable4_13
        LDRB     R0,[R0, #+0]
        SUBS     R0,R0,#+1
        LDR.N    R1,??DataTable4_13
        STRB     R0,[R1, #+0]
//  143      if  (abs(clap_energy-median_energy)> tone_silence_band) tone_trigger=3; //noise
        LDR.N    R0,??DataTable4
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable4_1
        LDRH     R1,[R1, #+0]
        SUBS     R0,R0,R1
        BL       abs
        LDR.N    R1,??DataTable4_14
        LDR      R1,[R1, #+0]
        CMP      R1,R0
        BCS.N    ??tone_filer_1
        LDR.N    R0,??DataTable4_12
        MOVS     R1,#+3
        STRB     R1,[R0, #+0]
//  144      }
//  145    if (time_tone_disabled==0 && tone_trigger)
??tone_filer_1:
        LDR.N    R0,??DataTable4_13
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BNE.N    ??tone_filer_2
        LDR.N    R0,??DataTable4_12
        LDRB     R0,[R0, #+0]
        CMP      R0,#+0
        BEQ.N    ??tone_filer_2
//  146     {
//  147       if (tone_trigger == 1) 
        LDR.N    R0,??DataTable4_12
        LDRB     R0,[R0, #+0]
        CMP      R0,#+1
        BNE.N    ??tone_filer_3
//  148      {
//  149        tone_detected=1;
        LDR.N    R0,??DataTable4_15
        MOVS     R1,#+1
        STRB     R1,[R0, #+0]
//  150        tone_counter++;
        LDR.N    R0,??DataTable4_16
        LDRB     R0,[R0, #+0]
        ADDS     R0,R0,#+1
        LDR.N    R1,??DataTable4_16
        STRB     R0,[R1, #+0]
        B.N      ??tone_filer_4
//  151      }
//  152      else tone_filter.filter_output=0; //it is was noise
??tone_filer_3:
        LDR.N    R0,??DataTable4_11
        MOVS     R1,#+0
        STRB     R1,[R0, #+0]
//  153        
//  154     tone_trigger=0;
??tone_filer_4:
        LDR.N    R0,??DataTable4_12
        MOVS     R1,#+0
        STRB     R1,[R0, #+0]
//  155     }     
//  156  
//  157  
//  158 
//  159 }
??tone_filer_2:
        POP      {R0,PC}          ;; return

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??tone_trigger:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??aux_tone_fil:
        DS8 1

        SECTION `.bss`:DATA:REORDER:NOROOT(0)
??time_tone_disabled:
        DS8 1
//  160 
//  161 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  162 void real128_fft(void)
//  163 {
real128_fft:
        PUSH     {R4,LR}
        SUB      SP,SP,#+48
//  164   arm_status status; 
//  165   arm_rfft_instance_q15 S;
//  166   arm_cfft_radix4_instance_q15 S_CFFT;  
//  167   int i,offset;
//  168   q15_t q15maximum;
//  169   char harmonic;
//  170   q15_t adc_in;
//  171   int32 i32sum;
//  172 
//  173   
//  174 
//  175   /*copy buffer as q_15 and removes offset  and clear buffer flag*/
//  176   offset = 128 * (buffer & 0x01);
        LDR.N    R0,??DataTable4_17
        LDRB     R0,[R0, #+0]
        ANDS     R0,R0,#0x1
        MOVS     R1,#+128
        MULS     R0,R1,R0
//  177   for (i=0;i<128;i++)
        MOVS     R1,#+0
        B.N      ??real128_fft_0
//  178     {
//  179       adc_in = adc_buffer[i + offset];
??real128_fft_1:
        ADDS     R2,R0,R1
        LDR.N    R3,??DataTable4_18
        LDR      R2,[R3, R2, LSL #+2]
//  180       if (adc_in>ADC_IN_LIMT) adc_in = ADC_IN_LIMT;
        MOVW     R3,#+1501
        SXTH     R2,R2            ;; SignExt  R2,R2,#+16,#+16
        CMP      R2,R3
        BLT.N    ??real128_fft_2
        MOVW     R2,#+1500
//  181       
//  182      adc_buffer2[i] = (q15_t)((adc_in-adc_offset)<<adc_gain); // 6 con generado adc a 10 bits
??real128_fft_2:
        SXTH     R2,R2            ;; SignExt  R2,R2,#+16,#+16
        LDR.N    R3,??DataTable4_19
        LDR      R3,[R3, #+0]
        SUBS     R2,R2,R3
        LDR.N    R3,??DataTable4_20
        LDR      R3,[R3, #+0]
        LSLS     R2,R2,R3
        LDR.N    R3,??DataTable4_21
        STRH     R2,[R3, R1, LSL #+1]
//  183      //adc_buffer2[i] = (q15_t)ADC_test_signal[i];        
//  184     }
        ADDS     R1,R1,#+1
??real128_fft_0:
        CMP      R1,#+128
        BLT.N    ??real128_fft_1
//  185        
//  186     status = ARM_MATH_SUCCESS; 
        MOVS     R4,#+0
//  187     rfft128Size = 128;    
        LDR.N    R0,??DataTable4_22
        MOVS     R1,#+128
        STR      R1,[R0, #+0]
//  188     /* Initialize the CFFT/CIFFT module */  
//  189     status = arm_rfft_init_q15(&S, &S_CFFT, rfft128Size, irfft128Flag, r128doBitReverse);                                                           
        LDR.N    R0,??DataTable4_23
        LDR      R0,[R0, #+0]
        STR      R0,[SP, #+0]
        LDR.N    R0,??DataTable4_24
        LDR      R3,[R0, #+0]
        LDR.N    R0,??DataTable4_22
        LDR      R2,[R0, #+0]
        ADD      R1,SP,#+4
        ADD      R0,SP,#+20
        BL       arm_rfft_init_q15
        MOVS     R4,R0
//  190                                                          
//  191     /* Process the data through the CFFT/CIFFT module */ 
//  192     arm_rfft_q15(&S, &adc_buffer2[0], &rfft128testOutput[0] );                           
        LDR.N    R2,??DataTable4_25
        LDR.N    R1,??DataTable4_21
        ADD      R0,SP,#+20
        BL       arm_rfft_q15
//  193     
//  194     /* Process the data through the Complex Magnitude Module for  
//  195     calculating the magnitude at each bin */ 
//  196     rfft128Size = TEST_LENGTH_SAMPLES_RFFT_128;
        LDR.N    R0,??DataTable4_22
        MOVS     R1,#+128
        STR      R1,[R0, #+0]
//  197     arm_cmplx_mag_q15(&rfft128testOutput[0], &rfft128Magnitud[0],  
//  198                     rfft128Size);  
        LDR.N    R0,??DataTable4_22
        LDR      R2,[R0, #+0]
        LDR.N    R1,??DataTable4_26
        LDR.N    R0,??DataTable4_25
        BL       arm_cmplx_mag_q15
//  199     
//  200  //   arm_mean_q15 (&rfft128Magnitud[1], 127, &mag_mean); 
//  201   
//  202    
//  203     // search for maximum peak
//  204    q15maximum = 0;
        MOVS     R0,#+0
//  205    harmonic = 0;
        MOVS     R2,#+0
//  206    
//  207    for (i = 4; i<40;i++)
        MOVS     R1,#+4
        B.N      ??real128_fft_3
//  208    {
//  209      if (rfft128Magnitud[i]>q15maximum) 
??real128_fft_4:
        LDR.N    R3,??DataTable4_26
        LDRSH    R3,[R3, R1, LSL #+1]
        SXTH     R0,R0            ;; SignExt  R0,R0,#+16,#+16
        CMP      R0,R3
        BGE.N    ??real128_fft_5
//  210       {
//  211         q15maximum  = rfft128Magnitud[i];
        LDR.N    R0,??DataTable4_26
        LDRSH    R0,[R0, R1, LSL #+1]
//  212         harmonic = i;  
        MOVS     R2,R1
//  213      }
//  214    }
??real128_fft_5:
        ADDS     R1,R1,#+1
??real128_fft_3:
        CMP      R1,#+40
        BLT.N    ??real128_fft_4
//  215    
//  216     //store peak of this block
//  217     peak_table[peak_index].magnitud=q15maximum;
        LDR.N    R1,??DataTable4_27
        LDRB     R1,[R1, #+0]
        LDR.N    R3,??DataTable4_28
        STRH     R0,[R3, R1, LSL #+2]
//  218     peak_table[peak_index].harmonic=harmonic;
        LDR.N    R1,??DataTable4_27
        LDRB     R1,[R1, #+0]
        LDR.N    R3,??DataTable4_28
        ADDS     R1,R3,R1, LSL #+2
        STRB     R2,[R1, #+2]
//  219     if (++peak_index > 31) peak_index = 0; 
        LDR.N    R1,??DataTable4_27
        LDRB     R1,[R1, #+0]
        ADDS     R1,R1,#+1
        LDR.N    R2,??DataTable4_27
        STRB     R1,[R2, #+0]
        UXTB     R1,R1            ;; ZeroExt  R1,R1,#+24,#+24
        CMP      R1,#+32
        BCC.N    ??real128_fft_6
        LDR.N    R1,??DataTable4_27
        MOVS     R2,#+0
        STRB     R2,[R1, #+0]
//  220    
//  221 
//  222 /*
//  223   filter tone
//  224   
//  225    params:
//  226       min_magnitud
//  227       filter_count
//  228       high_level
//  229       low_level
//  230       maximum_count
//  231    output
//  232    */
//  233    (void)filter_1(q15maximum,&tone_filter);  //check for a tone
??real128_fft_6:
        LDR.N    R1,??DataTable4_11
        UXTH     R0,R0            ;; ZeroExt  R0,R0,#+16,#+16
        BL       filter_1
        MOVS     R4,R0
//  234    tone_filer();  //check for a silence after tone
        BL       tone_filer
//  235 
//  236     // look for maximum peak and coresponding harmonic
//  237    i32sum = 0;
        MOVS     R0,#+0
//  238    
//  239    for (i=2;i<20;i++)
        MOVS     R1,#+2
        B.N      ??real128_fft_7
//  240    {
//  241      i32sum += rfft128Magnitud[i];
??real128_fft_8:
        LDR.N    R2,??DataTable4_26
        LDRSH    R2,[R2, R1, LSL #+1]
        ADDS     R0,R0,R2
//  242    } 
        ADDS     R1,R1,#+1
??real128_fft_7:
        CMP      R1,#+20
        BLT.N    ??real128_fft_8
//  243   // (void)filter_1(q15maximum,&clap_filter);
//  244     clap_energy = i32sum;
        LDR.N    R1,??DataTable4
        STR      R0,[R1, #+0]
//  245    
//  246    if (clap_energy > clap_peak_energy) clap_peak_energy=clap_energy;
        LDR.N    R0,??DataTable4_29
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable4
        LDR      R1,[R1, #+0]
        CMP      R0,R1
        BGE.N    ??real128_fft_9
        LDR.N    R0,??DataTable4_29
        LDR.N    R1,??DataTable4
        LDR      R1,[R1, #+0]
        STR      R1,[R0, #+0]
//  247    clap_filter2(clap_energy);
??real128_fft_9:
        LDR.N    R0,??DataTable4
        LDR      R0,[R0, #+0]
        BL       clap_filter2
//  248 
//  249 }
        ADD      SP,SP,#+48
        POP      {R4,PC}          ;; return
//  250 
//  251 
//  252 
//  253 
//  254 
//  255 
//  256 
//  257 
//  258 /*
//  259 
//  260    if input>min
//  261   this function is calles every 1/62msec
//  262  */

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  263 char filter_1(uint16 input, filter1_t   *fil)
//  264  {
//  265   if (input > fil->min_magnitude)
filter_1:
        LDRSH    R2,[R1, #+2]
        UXTH     R0,R0            ;; ZeroExt  R0,R0,#+16,#+16
        CMP      R2,R0
        BGE.N    ??filter_1_0
//  266     { 
//  267       fil->filter_count += fil->attack_gain;
        LDRB     R0,[R1, #+4]
        LDRSB    R2,[R1, #+8]
        ADDS     R0,R2,R0
        STRB     R0,[R1, #+4]
//  268       if ( fil->filter_count >  fil->max_count) fil->filter_count = fil->max_count;
        LDRB     R0,[R1, #+5]
        LDRSB    R2,[R1, #+4]
        SXTH     R0,R0            ;; SignExt  R0,R0,#+16,#+16
        SXTH     R2,R2            ;; SignExt  R2,R2,#+16,#+16
        CMP      R0,R2
        BGE.N    ??filter_1_1
        LDRSB    R0,[R1, #+5]
        STRB     R0,[R1, #+4]
//  269       if ( fil->filter_count >  fil->high_level) fil->filter_output = 1; 
??filter_1_1:
        LDRB     R0,[R1, #+6]
        LDRSB    R2,[R1, #+4]
        SXTH     R0,R0            ;; SignExt  R0,R0,#+16,#+16
        SXTH     R2,R2            ;; SignExt  R2,R2,#+16,#+16
        CMP      R0,R2
        BGE.N    ??filter_1_2
        MOVS     R0,#+1
        STRB     R0,[R1, #+0]
        B.N      ??filter_1_2
//  270     }
//  271   else
//  272    {
//  273      fil->filter_count -= fil->decay_gain;
??filter_1_0:
        LDRB     R0,[R1, #+4]
        LDRSB    R2,[R1, #+9]
        SUBS     R0,R0,R2
        STRB     R0,[R1, #+4]
//  274      if ( fil->filter_count < 0) fil->filter_count = 0;
        LDRSB    R0,[R1, #+4]
        CMP      R0,#+0
        BPL.N    ??filter_1_3
        MOVS     R0,#+0
        STRB     R0,[R1, #+4]
//  275      if ( fil->filter_count <  fil->low_level) fil->filter_output = 0; 
??filter_1_3:
        LDRSB    R0,[R1, #+4]
        LDRB     R2,[R1, #+7]
        SXTH     R0,R0            ;; SignExt  R0,R0,#+16,#+16
        SXTH     R2,R2            ;; SignExt  R2,R2,#+16,#+16
        CMP      R0,R2
        BGE.N    ??filter_1_2
        MOVS     R0,#+0
        STRB     R0,[R1, #+0]
//  276    }
//  277   return fil->filter_output;  
??filter_1_2:
        LDRB     R0,[R1, #+0]
        BX       LR               ;; return
//  278   
//  279   
//  280   
//  281  }
//  282 
//  283 

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  284  void tone_filter_init(void)
//  285    {
//  286      filter1_t *fil;
//  287      fil = &tone_filter;
tone_filter_init:
        LDR.N    R0,??DataTable4_11
//  288      fil->min_magnitude = 3000; //2500
        MOVW     R1,#+3000
        STRH     R1,[R0, #+2]
//  289      fil->filter_output = 0;
        MOVS     R1,#+0
        STRB     R1,[R0, #+0]
//  290      fil->filter_count  = 0;
        MOVS     R1,#+0
        STRB     R1,[R0, #+4]
//  291      fil->max_count = 32;
        MOVS     R1,#+32
        STRB     R1,[R0, #+5]
//  292      fil->high_level = 18;
        MOVS     R1,#+18
        STRB     R1,[R0, #+6]
//  293      fil->low_level  = 1;
        MOVS     R1,#+1
        STRB     R1,[R0, #+7]
//  294      fil->decay_gain = 1;
        MOVS     R1,#+1
        STRB     R1,[R0, #+9]
//  295      fil->attack_gain= 3;
        MOVS     R1,#+3
        STRB     R1,[R0, #+8]
//  296    }
        BX       LR               ;; return
//  297 
//  298 
//  299   
//  300 /*   */

        SECTION `.text`:CODE:NOROOT(1)
        THUMB
//  301 void  display_fft_info(void)
//  302 {
display_fft_info:
        PUSH     {R4,LR}
//  303     int i;
//  304     printf(" \n\r mag    mean=%i max adc = %i \n\r ",mag_mean,(int)max_value);
        LDR.N    R0,??DataTable4_30
        LDRSH    R2,[R0, #+0]
        LDR.N    R0,??DataTable4_31
        LDRSH    R1,[R0, #+0]
        LDR.N    R0,??DataTable4_32
        BL       printf
//  305     for (i=1;i<12;i++)
        MOVS     R4,#+1
        B.N      ??display_fft_info_0
//  306     {   
//  307       printf("\n\r [%03i] Mag=%05i",i,rfft128Magnitud[i]);
??display_fft_info_1:
        LDR.N    R0,??DataTable4_26
        LDRSH    R2,[R0, R4, LSL #+1]
        MOVS     R1,R4
        LDR.N    R0,??DataTable4_33
        BL       printf
//  308      // printf("\n\r  Harmonic[%03i] Mag=%05i", peak_table[i].harmonic,peak_table[i].magnitud);
//  309     }
        ADDS     R4,R4,#+1
??display_fft_info_0:
        CMP      R4,#+12
        BLT.N    ??display_fft_info_1
//  310     printf(" \n\r ");
        LDR.N    R0,??DataTable4_34
        BL       printf
//  311 
//  312 }        
        POP      {R4,PC}          ;; return

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4:
        DC32     clap_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_1:
        DC32     median_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_2:
        DC32     clap_detect_threshold

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_3:
        DC32     ??clap_trigger

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_4:
        DC32     ??time_clap_detection

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_5:
        DC32     ??time_clap_disabled

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_6:
        DC32     clap_silence_threshold

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_7:
        DC32     clap_silence_band

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_8:
        DC32     clap_detected

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_9:
        DC32     clap_counter

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_10:
        DC32     ??aux_tone_fil

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_11:
        DC32     tone_filter

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_12:
        DC32     ??tone_trigger

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_13:
        DC32     ??time_tone_disabled

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_14:
        DC32     tone_silence_band

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_15:
        DC32     tone_detected

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_16:
        DC32     tone_counter

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_17:
        DC32     buffer

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_18:
        DC32     adc_buffer

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_19:
        DC32     adc_offset

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_20:
        DC32     adc_gain

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_21:
        DC32     adc_buffer2

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_22:
        DC32     rfft128Size

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_23:
        DC32     r128doBitReverse

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_24:
        DC32     irfft128Flag

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_25:
        DC32     rfft128testOutput

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_26:
        DC32     rfft128Magnitud

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_27:
        DC32     peak_index

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_28:
        DC32     peak_table

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_29:
        DC32     clap_peak_energy

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_30:
        DC32     max_value

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_31:
        DC32     mag_mean

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_32:
        DC32     `?<Constant " \\n\\r mag    mean=%i ma...">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_33:
        DC32     `?<Constant "\\n\\r [%03i] Mag=%05i">`

        SECTION `.text`:CODE:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
??DataTable4_34:
        DC32     `?<Constant " \\n\\r ">`
//  313 
//  314 
//  315 
//  316              
//  317 

        SECTION `.data`:DATA:REORDER:NOROOT(2)
//  318 q15_t ADC_test_signal[128]=
ADC_test_signal:
        DATA
        DC16 0, 439, 862, 1251, 1592, 1874, 2089, 2230, 2297, 2294, 2226, 2104
        DC16 1940, 1748, 1544, 1342, 1159, 1005, 893, 829, 818, 861, 954, 1092
        DC16 1265, 1462, 1670, 1876, 2067, 2229, 2353, 2431, 2458, 2431, 2353
        DC16 2229, 2067, 1876, 1670, 1462, 1265, 1092, 954, 861, 818, 829, 893
        DC16 1005, 1159, 1342, 1544, 1748, 1940, 2104, 2226, 2294, 2297, 2230
        DC16 2089, 1874, 1592, 1251, 862, 439, 0, -439, -862, -1251, -1592
        DC16 -1874, -2089, -2230, -2297, -2294, -2226, -2104, -1940, -1748
        DC16 -1544, -1342, -1159, -1005, -893, -829, -818, -861, -954, -1092
        DC16 -1265, -1462, -1670, -1876, -2067, -2229, -2353, -2431, -2458
        DC16 -2431, -2353, -2229, -2067, -1876, -1670, -1462, -1265, -1092
        DC16 -954, -861, -818, -829, -893, -1005, -1159, -1342, -1544, -1748
        DC16 -1940, -2104, -2226, -2294, -2297, -2230, -2089, -1874, -1592
        DC16 -1251, -862, -439

        SECTION `.iar_vfe_header`:DATA:REORDER:NOALLOC:NOROOT(2)
        SECTION_TYPE SHT_PROGBITS, 0
        DATA
        DC32 0

        SECTION __DLIB_PERTHREAD:DATA:REORDER:NOROOT(0)
        SECTION_TYPE SHT_PROGBITS, 0

        SECTION __DLIB_PERTHREAD_init:DATA:REORDER:NOROOT(0)
        SECTION_TYPE SHT_PROGBITS, 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant " \\n\\r mag    mean=%i ma...">`:
        DATA
        DC8 " \012\015 mag    mean=%i max adc = %i \012\015 "

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant "\\n\\r [%03i] Mag=%05i">`:
        DATA
        DC8 "\012\015 [%03i] Mag=%05i"
        DC8 0

        SECTION `.rodata`:CONST:REORDER:NOROOT(2)
`?<Constant " \\n\\r ">`:
        DATA
        DC8 " \012\015 "
        DC8 0, 0, 0

        END
//  319 {
//  320         0,
//  321      439,
//  322      862,
//  323      1251,
//  324      1592,
//  325      1874,
//  326      2089,
//  327      2230,
//  328      2297,
//  329      2294,
//  330      2226,
//  331      2104,
//  332      1940,
//  333      1748,
//  334      1544,
//  335      1342,
//  336      1159,
//  337      1005,
//  338      893,
//  339      829,
//  340      818,
//  341      861,
//  342      954,
//  343      1092,
//  344      1265,
//  345      1462,
//  346      1670,
//  347      1876,
//  348      2067,
//  349      2229,
//  350      2353,
//  351      2431,
//  352      2458,
//  353      2431,
//  354      2353,
//  355      2229,
//  356      2067,
//  357      1876,
//  358      1670,
//  359      1462,
//  360      1265,
//  361      1092,
//  362      954,
//  363      861,
//  364      818,
//  365      829,
//  366      893,
//  367      1005,
//  368      1159,
//  369      1342,
//  370      1544,
//  371      1748,
//  372      1940,
//  373      2104,
//  374      2226,
//  375      2294,
//  376      2297,
//  377      2230,
//  378      2089,
//  379      1874,
//  380      1592,
//  381      1251,
//  382      862,
//  383      439,
//  384      0,
//  385      -439,
//  386      -862,
//  387      -1251,
//  388      -1592,
//  389      -1874,
//  390      -2089,
//  391      -2230,
//  392      -2297,
//  393      -2294,
//  394      -2226,
//  395      -2104,
//  396      -1940,
//  397      -1748,
//  398      -1544,
//  399      -1342,
//  400      -1159,
//  401      -1005,
//  402      -893,
//  403      -829,
//  404      -818,
//  405      -861,
//  406      -954,
//  407      -1092,
//  408      -1265,
//  409      -1462,
//  410      -1670,
//  411      -1876,
//  412      -2067,
//  413      -2229,
//  414      -2353,
//  415      -2431,
//  416      -2458,
//  417      -2431,
//  418      -2353,
//  419      -2229,
//  420      -2067,
//  421      -1876,
//  422      -1670,
//  423      -1462,
//  424      -1265,
//  425      -1092,
//  426      -954,
//  427      -861,
//  428      -818,
//  429      -829,
//  430      -893,
//  431      -1005,
//  432      -1159,
//  433      -1342,
//  434      -1544,
//  435      -1748,
//  436      -1940,
//  437      -2104,
//  438      -2226,
//  439      -2294,
//  440      -2297,
//  441      -2230,
//  442      -2089,
//  443      -1874,
//  444      -1592,
//  445      -1251,
//  446      -862,
//  447      -439,
//  448 
//  449 
//  450 
//  451   
//  452 };
// 
// 1 203 bytes in section .bss
//   289 bytes in section .data
//    64 bytes in section .rodata
//   946 bytes in section .text
// 
//   946 bytes of CODE  memory
//    64 bytes of CONST memory
// 1 492 bytes of DATA  memory
//
//Errors: none
//Warnings: 2
