├── .gitignore
├── DebugConfig
└── Anopilot_STM32F407VG.dbgconf
├── F407_FC.uvopt
├── F407_FC.uvoptx
├── F407_FC.uvproj.saved_uv4
├── F407_FC.uvprojx
├── JLinkSettings.ini
├── Libraries
├── CMSIS
│ ├── CMSIS END USER LICENCE AGREEMENT.pdf
│ ├── DSP_Lib
│ │ └── Source
│ │ │ ├── ARM
│ │ │ ├── arm_cortexM0x_math.uvopt
│ │ │ ├── arm_cortexM0x_math.uvproj
│ │ │ ├── arm_cortexM3x_math.uvopt
│ │ │ ├── arm_cortexM3x_math.uvproj
│ │ │ ├── arm_cortexM4x_math.uvopt
│ │ │ ├── arm_cortexM4x_math.uvproj
│ │ │ └── arm_cortexMx_math_Build.bat
│ │ │ ├── BasicMathFunctions
│ │ │ ├── arm_abs_f32.c
│ │ │ ├── arm_abs_q15.c
│ │ │ ├── arm_abs_q31.c
│ │ │ ├── arm_abs_q7.c
│ │ │ ├── arm_add_f32.c
│ │ │ ├── arm_add_q15.c
│ │ │ ├── arm_add_q31.c
│ │ │ ├── arm_add_q7.c
│ │ │ ├── arm_dot_prod_f32.c
│ │ │ ├── arm_dot_prod_q15.c
│ │ │ ├── arm_dot_prod_q31.c
│ │ │ ├── arm_dot_prod_q7.c
│ │ │ ├── arm_mult_f32.c
│ │ │ ├── arm_mult_q15.c
│ │ │ ├── arm_mult_q31.c
│ │ │ ├── arm_mult_q7.c
│ │ │ ├── arm_negate_f32.c
│ │ │ ├── arm_negate_q15.c
│ │ │ ├── arm_negate_q31.c
│ │ │ ├── arm_negate_q7.c
│ │ │ ├── arm_offset_f32.c
│ │ │ ├── arm_offset_q15.c
│ │ │ ├── arm_offset_q31.c
│ │ │ ├── arm_offset_q7.c
│ │ │ ├── arm_scale_f32.c
│ │ │ ├── arm_scale_q15.c
│ │ │ ├── arm_scale_q31.c
│ │ │ ├── arm_scale_q7.c
│ │ │ ├── arm_shift_q15.c
│ │ │ ├── arm_shift_q31.c
│ │ │ ├── arm_shift_q7.c
│ │ │ ├── arm_sub_f32.c
│ │ │ ├── arm_sub_q15.c
│ │ │ ├── arm_sub_q31.c
│ │ │ └── arm_sub_q7.c
│ │ │ ├── CommonTables
│ │ │ └── arm_common_tables.c
│ │ │ ├── ComplexMathFunctions
│ │ │ ├── arm_cmplx_conj_f32.c
│ │ │ ├── arm_cmplx_conj_q15.c
│ │ │ ├── arm_cmplx_conj_q31.c
│ │ │ ├── arm_cmplx_dot_prod_f32.c
│ │ │ ├── arm_cmplx_dot_prod_q15.c
│ │ │ ├── arm_cmplx_dot_prod_q31.c
│ │ │ ├── arm_cmplx_mag_f32.c
│ │ │ ├── arm_cmplx_mag_q15.c
│ │ │ ├── arm_cmplx_mag_q31.c
│ │ │ ├── arm_cmplx_mag_squared_f32.c
│ │ │ ├── arm_cmplx_mag_squared_q15.c
│ │ │ ├── arm_cmplx_mag_squared_q31.c
│ │ │ ├── arm_cmplx_mult_cmplx_f32.c
│ │ │ ├── arm_cmplx_mult_cmplx_q15.c
│ │ │ ├── arm_cmplx_mult_cmplx_q31.c
│ │ │ ├── arm_cmplx_mult_real_f32.c
│ │ │ ├── arm_cmplx_mult_real_q15.c
│ │ │ └── arm_cmplx_mult_real_q31.c
│ │ │ ├── ControllerFunctions
│ │ │ ├── arm_pid_init_f32.c
│ │ │ ├── arm_pid_init_q15.c
│ │ │ ├── arm_pid_init_q31.c
│ │ │ ├── arm_pid_reset_f32.c
│ │ │ ├── arm_pid_reset_q15.c
│ │ │ ├── arm_pid_reset_q31.c
│ │ │ ├── arm_sin_cos_f32.c
│ │ │ └── arm_sin_cos_q31.c
│ │ │ ├── FastMathFunctions
│ │ │ ├── arm_cos_f32.c
│ │ │ ├── arm_cos_q15.c
│ │ │ ├── arm_cos_q31.c
│ │ │ ├── arm_sin_f32.c
│ │ │ ├── arm_sin_q15.c
│ │ │ ├── arm_sin_q31.c
│ │ │ ├── arm_sqrt_q15.c
│ │ │ └── arm_sqrt_q31.c
│ │ │ ├── FilteringFunctions
│ │ │ ├── arm_biquad_cascade_df1_32x64_init_q31.c
│ │ │ ├── arm_biquad_cascade_df1_32x64_q31.c
│ │ │ ├── arm_biquad_cascade_df1_f32.c
│ │ │ ├── arm_biquad_cascade_df1_fast_q15.c
│ │ │ ├── arm_biquad_cascade_df1_fast_q31.c
│ │ │ ├── arm_biquad_cascade_df1_init_f32.c
│ │ │ ├── arm_biquad_cascade_df1_init_q15.c
│ │ │ ├── arm_biquad_cascade_df1_init_q31.c
│ │ │ ├── arm_biquad_cascade_df1_q15.c
│ │ │ ├── arm_biquad_cascade_df1_q31.c
│ │ │ ├── arm_biquad_cascade_df2T_f32.c
│ │ │ ├── arm_biquad_cascade_df2T_init_f32.c
│ │ │ ├── arm_conv_f32.c
│ │ │ ├── arm_conv_fast_q15.c
│ │ │ ├── arm_conv_fast_q31.c
│ │ │ ├── arm_conv_partial_f32.c
│ │ │ ├── arm_conv_partial_fast_q15.c
│ │ │ ├── arm_conv_partial_fast_q31.c
│ │ │ ├── arm_conv_partial_q15.c
│ │ │ ├── arm_conv_partial_q31.c
│ │ │ ├── arm_conv_partial_q7.c
│ │ │ ├── arm_conv_q15.c
│ │ │ ├── arm_conv_q31.c
│ │ │ ├── arm_conv_q7.c
│ │ │ ├── arm_correlate_f32.c
│ │ │ ├── arm_correlate_fast_q15.c
│ │ │ ├── arm_correlate_fast_q31.c
│ │ │ ├── arm_correlate_q15.c
│ │ │ ├── arm_correlate_q31.c
│ │ │ ├── arm_correlate_q7.c
│ │ │ ├── arm_fir_decimate_f32.c
│ │ │ ├── arm_fir_decimate_fast_q15.c
│ │ │ ├── arm_fir_decimate_fast_q31.c
│ │ │ ├── arm_fir_decimate_init_f32.c
│ │ │ ├── arm_fir_decimate_init_q15.c
│ │ │ ├── arm_fir_decimate_init_q31.c
│ │ │ ├── arm_fir_decimate_q15.c
│ │ │ ├── arm_fir_decimate_q31.c
│ │ │ ├── arm_fir_f32.c
│ │ │ ├── arm_fir_fast_q15.c
│ │ │ ├── arm_fir_fast_q31.c
│ │ │ ├── arm_fir_init_f32.c
│ │ │ ├── arm_fir_init_q15.c
│ │ │ ├── arm_fir_init_q31.c
│ │ │ ├── arm_fir_init_q7.c
│ │ │ ├── arm_fir_interpolate_f32.c
│ │ │ ├── arm_fir_interpolate_init_f32.c
│ │ │ ├── arm_fir_interpolate_init_q15.c
│ │ │ ├── arm_fir_interpolate_init_q31.c
│ │ │ ├── arm_fir_interpolate_q15.c
│ │ │ ├── arm_fir_interpolate_q31.c
│ │ │ ├── arm_fir_lattice_f32.c
│ │ │ ├── arm_fir_lattice_init_f32.c
│ │ │ ├── arm_fir_lattice_init_q15.c
│ │ │ ├── arm_fir_lattice_init_q31.c
│ │ │ ├── arm_fir_lattice_q15.c
│ │ │ ├── arm_fir_lattice_q31.c
│ │ │ ├── arm_fir_q15.c
│ │ │ ├── arm_fir_q31.c
│ │ │ ├── arm_fir_q7.c
│ │ │ ├── arm_fir_sparse_f32.c
│ │ │ ├── arm_fir_sparse_init_f32.c
│ │ │ ├── arm_fir_sparse_init_q15.c
│ │ │ ├── arm_fir_sparse_init_q31.c
│ │ │ ├── arm_fir_sparse_init_q7.c
│ │ │ ├── arm_fir_sparse_q15.c
│ │ │ ├── arm_fir_sparse_q31.c
│ │ │ ├── arm_fir_sparse_q7.c
│ │ │ ├── arm_iir_lattice_f32.c
│ │ │ ├── arm_iir_lattice_init_f32.c
│ │ │ ├── arm_iir_lattice_init_q15.c
│ │ │ ├── arm_iir_lattice_init_q31.c
│ │ │ ├── arm_iir_lattice_q15.c
│ │ │ ├── arm_iir_lattice_q31.c
│ │ │ ├── arm_lms_f32.c
│ │ │ ├── arm_lms_init_f32.c
│ │ │ ├── arm_lms_init_q15.c
│ │ │ ├── arm_lms_init_q31.c
│ │ │ ├── arm_lms_norm_f32.c
│ │ │ ├── arm_lms_norm_init_f32.c
│ │ │ ├── arm_lms_norm_init_q15.c
│ │ │ ├── arm_lms_norm_init_q31.c
│ │ │ ├── arm_lms_norm_q15.c
│ │ │ ├── arm_lms_norm_q31.c
│ │ │ ├── arm_lms_q15.c
│ │ │ └── arm_lms_q31.c
│ │ │ ├── MatrixFunctions
│ │ │ ├── arm_mat_add_f32.c
│ │ │ ├── arm_mat_add_q15.c
│ │ │ ├── arm_mat_add_q31.c
│ │ │ ├── arm_mat_init_f32.c
│ │ │ ├── arm_mat_init_q15.c
│ │ │ ├── arm_mat_init_q31.c
│ │ │ ├── arm_mat_inverse_f32.c
│ │ │ ├── arm_mat_mult_f32.c
│ │ │ ├── arm_mat_mult_fast_q15.c
│ │ │ ├── arm_mat_mult_fast_q31.c
│ │ │ ├── arm_mat_mult_q15.c
│ │ │ ├── arm_mat_mult_q31.c
│ │ │ ├── arm_mat_scale_f32.c
│ │ │ ├── arm_mat_scale_q15.c
│ │ │ ├── arm_mat_scale_q31.c
│ │ │ ├── arm_mat_sub_f32.c
│ │ │ ├── arm_mat_sub_q15.c
│ │ │ ├── arm_mat_sub_q31.c
│ │ │ ├── arm_mat_trans_f32.c
│ │ │ ├── arm_mat_trans_q15.c
│ │ │ └── arm_mat_trans_q31.c
│ │ │ ├── StatisticsFunctions
│ │ │ ├── arm_max_f32.c
│ │ │ ├── arm_max_q15.c
│ │ │ ├── arm_max_q31.c
│ │ │ ├── arm_max_q7.c
│ │ │ ├── arm_mean_f32.c
│ │ │ ├── arm_mean_q15.c
│ │ │ ├── arm_mean_q31.c
│ │ │ ├── arm_mean_q7.c
│ │ │ ├── arm_min_f32.c
│ │ │ ├── arm_min_q15.c
│ │ │ ├── arm_min_q31.c
│ │ │ ├── arm_min_q7.c
│ │ │ ├── arm_power_f32.c
│ │ │ ├── arm_power_q15.c
│ │ │ ├── arm_power_q31.c
│ │ │ ├── arm_power_q7.c
│ │ │ ├── arm_rms_f32.c
│ │ │ ├── arm_rms_q15.c
│ │ │ ├── arm_rms_q31.c
│ │ │ ├── arm_std_f32.c
│ │ │ ├── arm_std_q15.c
│ │ │ ├── arm_std_q31.c
│ │ │ ├── arm_var_f32.c
│ │ │ ├── arm_var_q15.c
│ │ │ └── arm_var_q31.c
│ │ │ ├── SupportFunctions
│ │ │ ├── arm_copy_f32.c
│ │ │ ├── arm_copy_q15.c
│ │ │ ├── arm_copy_q31.c
│ │ │ ├── arm_copy_q7.c
│ │ │ ├── arm_fill_f32.c
│ │ │ ├── arm_fill_q15.c
│ │ │ ├── arm_fill_q31.c
│ │ │ ├── arm_fill_q7.c
│ │ │ ├── arm_float_to_q15.c
│ │ │ ├── arm_float_to_q31.c
│ │ │ ├── arm_float_to_q7.c
│ │ │ ├── arm_q15_to_float.c
│ │ │ ├── arm_q15_to_q31.c
│ │ │ ├── arm_q15_to_q7.c
│ │ │ ├── arm_q31_to_float.c
│ │ │ ├── arm_q31_to_q15.c
│ │ │ ├── arm_q31_to_q7.c
│ │ │ ├── arm_q7_to_float.c
│ │ │ ├── arm_q7_to_q15.c
│ │ │ └── arm_q7_to_q31.c
│ │ │ └── TransformFunctions
│ │ │ ├── arm_cfft_radix4_f32.c
│ │ │ ├── arm_cfft_radix4_init_f32.c
│ │ │ ├── arm_cfft_radix4_init_q15.c
│ │ │ ├── arm_cfft_radix4_init_q31.c
│ │ │ ├── arm_cfft_radix4_q15.c
│ │ │ ├── arm_cfft_radix4_q31.c
│ │ │ ├── arm_dct4_f32.c
│ │ │ ├── arm_dct4_init_f32.c
│ │ │ ├── arm_dct4_init_q15.c
│ │ │ ├── arm_dct4_init_q31.c
│ │ │ ├── arm_dct4_q15.c
│ │ │ ├── arm_dct4_q31.c
│ │ │ ├── arm_rfft_f32.c
│ │ │ ├── arm_rfft_init_f32.c
│ │ │ ├── arm_rfft_init_q15.c
│ │ │ ├── arm_rfft_init_q31.c
│ │ │ ├── arm_rfft_q15.c
│ │ │ └── arm_rfft_q31.c
│ ├── Include
│ │ ├── arm_common_tables.h
│ │ ├── arm_math.h
│ │ ├── core_cm0.h
│ │ ├── core_cm3.h
│ │ ├── core_cm4.h
│ │ ├── core_cm4_simd.h
│ │ ├── core_cmFunc.h
│ │ └── core_cmInstr.h
│ ├── README.txt
│ └── ST
│ │ └── STM32F4xx
│ │ ├── Include
│ │ ├── stm32f4xx.h
│ │ └── system_stm32f4xx.h
│ │ ├── Release_Notes.html
│ │ └── Source
│ │ └── Templates
│ │ ├── TASKING
│ │ └── cstart_thumb2.asm
│ │ ├── TrueSTUDIO
│ │ └── startup_stm32f4xx.s
│ │ ├── arm
│ │ └── startup_stm32f4xx.s
│ │ ├── gcc_ride7
│ │ └── startup_stm32f4xx.s
│ │ ├── iar
│ │ └── startup_stm32f4xx.s
│ │ └── system_stm32f4xx.c
├── FatFS
│ └── src
│ │ ├── 00readme.txt
│ │ ├── diskio.c
│ │ ├── diskio.h
│ │ ├── ff.c
│ │ ├── ff.h
│ │ ├── ffconf.h
│ │ ├── integer.h
│ │ └── option
│ │ ├── cc932.c
│ │ ├── cc936.c
│ │ ├── cc949.c
│ │ ├── cc950.c
│ │ ├── ccsbcs.c
│ │ ├── syscall.c
│ │ └── unicode.c
├── SConscript
├── STM32F4xx_StdPeriph_Driver
│ ├── Release_Notes.html
│ ├── inc
│ │ ├── misc.h
│ │ ├── stm32f4xx_adc.h
│ │ ├── stm32f4xx_can.h
│ │ ├── stm32f4xx_crc.h
│ │ ├── stm32f4xx_cryp.h
│ │ ├── stm32f4xx_dac.h
│ │ ├── stm32f4xx_dbgmcu.h
│ │ ├── stm32f4xx_dcmi.h
│ │ ├── stm32f4xx_dma.h
│ │ ├── stm32f4xx_exti.h
│ │ ├── stm32f4xx_flash.h
│ │ ├── stm32f4xx_fsmc.h
│ │ ├── stm32f4xx_gpio.h
│ │ ├── stm32f4xx_hash.h
│ │ ├── stm32f4xx_i2c.h
│ │ ├── stm32f4xx_iwdg.h
│ │ ├── stm32f4xx_pwr.h
│ │ ├── stm32f4xx_rcc.h
│ │ ├── stm32f4xx_rng.h
│ │ ├── stm32f4xx_rtc.h
│ │ ├── stm32f4xx_sdio.h
│ │ ├── stm32f4xx_spi.h
│ │ ├── stm32f4xx_syscfg.h
│ │ ├── stm32f4xx_tim.h
│ │ ├── stm32f4xx_usart.h
│ │ └── stm32f4xx_wwdg.h
│ └── src
│ │ ├── misc.c
│ │ ├── stm32f4xx_adc.c
│ │ ├── stm32f4xx_can.c
│ │ ├── stm32f4xx_crc.c
│ │ ├── stm32f4xx_cryp.c
│ │ ├── stm32f4xx_cryp_aes.c
│ │ ├── stm32f4xx_cryp_des.c
│ │ ├── stm32f4xx_cryp_tdes.c
│ │ ├── stm32f4xx_dac.c
│ │ ├── stm32f4xx_dbgmcu.c
│ │ ├── stm32f4xx_dcmi.c
│ │ ├── stm32f4xx_dma.c
│ │ ├── stm32f4xx_exti.c
│ │ ├── stm32f4xx_flash.c
│ │ ├── stm32f4xx_fsmc.c
│ │ ├── stm32f4xx_gpio.c
│ │ ├── stm32f4xx_hash.c
│ │ ├── stm32f4xx_hash_md5.c
│ │ ├── stm32f4xx_hash_sha1.c
│ │ ├── stm32f4xx_i2c.c
│ │ ├── stm32f4xx_iwdg.c
│ │ ├── stm32f4xx_pwr.c
│ │ ├── stm32f4xx_rcc.c
│ │ ├── stm32f4xx_rng.c
│ │ ├── stm32f4xx_rtc.c
│ │ ├── stm32f4xx_sdio.c
│ │ ├── stm32f4xx_spi.c
│ │ ├── stm32f4xx_syscfg.c
│ │ ├── stm32f4xx_tim.c
│ │ ├── stm32f4xx_usart.c
│ │ └── stm32f4xx_wwdg.c
└── USBStack
│ ├── INC
│ ├── RTL.h
│ ├── rl_usb.h
│ ├── usb.h
│ ├── usb_cdc.h
│ ├── usb_def.h
│ ├── usb_for_lib.h
│ ├── usb_hid.h
│ ├── usb_lib.c
│ ├── usb_lib.h
│ ├── usb_msc.h
│ ├── usbd_cdc.h
│ ├── usbd_cdc_acm.h
│ ├── usbd_core.h
│ ├── usbd_core_cdc.h
│ ├── usbd_core_hid.h
│ ├── usbd_core_msc.h
│ ├── usbd_desc.h
│ ├── usbd_event.h
│ ├── usbd_hid.h
│ ├── usbd_hw.h
│ ├── usbd_lib_cdc.h
│ ├── usbd_lib_hid.h
│ ├── usbd_lib_msc.h
│ └── usbd_msc.h
│ └── SRC
│ ├── usbd_cdc_acm.c
│ ├── usbd_core.c
│ ├── usbd_core_cdc.c
│ ├── usbd_core_hid.c
│ ├── usbd_core_msc.c
│ ├── usbd_hid.c
│ └── usbd_msc.c
├── README.md
├── RTE
└── _Anopilot
│ └── RTE_Components.h
├── TEST.ANO
├── applications
├── PID.c
├── PID.h
├── anotc_baro_ctrl.c
├── anotc_baro_ctrl.h
├── ctrl.c
├── ctrl.h
├── data_transfer.c
├── data_transfer.h
├── data_transfer.h.orig
├── filter.c
├── filter.h
├── fly_mode.c
├── fly_mode.h
├── height_ctrl.c
├── height_ctrl.h
├── imu.c
├── imu.h
├── include.h
├── init.c
├── init.h
├── main.c
├── mymath.c
├── mymath.h
├── parameter.c
├── parameter.h
├── rc.c
├── rc.h
├── scheduler.c
├── scheduler.h
├── stm32f4xx_conf.h
├── stm32f4xx_it.c
├── usb_config.c
├── usbd_user_hid.c
├── usbd_user_hid.h
├── usbd_user_msc.c
├── version.c
└── version.h
├── build
├── F407_FC.hex
└── F407_FC.sct
├── clear编译完的东西.bat
├── doc
├── note.txt
└── record.txt
└── drivers
├── ak8975.c
├── ak8975.h
├── drv_w25qxx.c
├── drv_w25qxx.h
├── i2c_soft.c
├── i2c_soft.h
├── led.c
├── led.h
├── mpu6050.c
├── mpu6050.c.orig
├── mpu6050.h
├── ms5611.c
├── ms5611.h
├── pwm_in.c
├── pwm_in.h
├── pwm_out.c
├── pwm_out.h
├── time.c
├── time.h
├── ultrasonic.c
├── ultrasonic.h
├── usart.c
├── usart.h
└── usbd_STM32F4xx_FS.c
/.gitignore:
--------------------------------------------------------------------------------
1 | *.bak
2 | *.ddk
3 | *.edk
4 | *.lst
5 | *.lnp
6 | *.mpf
7 | *.mpj
8 | *.obj
9 | *.omf
10 | *.plg
11 | *.rpt
12 | *.tmp
13 | *.__i
14 | *.crf
15 | *.o
16 | *.d
17 | *.axf
18 | *.tra
19 | *.dep
20 | JLinkLog.txt
21 |
22 | *.iex
23 | *.htm
24 | *.map
25 |
--------------------------------------------------------------------------------
/DebugConfig/Anopilot_STM32F407VG.dbgconf:
--------------------------------------------------------------------------------
1 | // <<< Use Configuration Wizard in Context Menu >>>
2 |
3 | //
45 | * pDst[n] = -pSrc[n], 0 <= n < blockSize. 46 | *47 | */ 48 | 49 | /** 50 | * @addtogroup negate 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @brief Negates the elements of a floating-point vector. 56 | * @param[in] *pSrc points to the input vector 57 | * @param[out] *pDst points to the output vector 58 | * @param[in] blockSize number of samples in the vector 59 | * @return none. 60 | */ 61 | 62 | void arm_negate_f32( 63 | float32_t * pSrc, 64 | float32_t * pDst, 65 | uint32_t blockSize) 66 | { 67 | uint32_t blkCnt; /* loop counter */ 68 | 69 | 70 | #ifndef ARM_MATH_CM0 71 | 72 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 73 | /*loop Unrolling */ 74 | blkCnt = blockSize >> 2u; 75 | 76 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 77 | ** a second loop below computes the remaining 1 to 3 samples. */ 78 | while(blkCnt > 0u) 79 | { 80 | /* C = -A */ 81 | /* Negate and then store the results in the destination buffer. */ 82 | *pDst++ = -*pSrc++; 83 | *pDst++ = -*pSrc++; 84 | *pDst++ = -*pSrc++; 85 | *pDst++ = -*pSrc++; 86 | 87 | /* Decrement the loop counter */ 88 | blkCnt--; 89 | } 90 | 91 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 92 | ** No loop unrolling is used. */ 93 | blkCnt = blockSize % 0x4u; 94 | 95 | #else 96 | 97 | /* Run the below code for Cortex-M0 */ 98 | 99 | /* Initialize blkCnt with number of samples */ 100 | blkCnt = blockSize; 101 | 102 | #endif /* #ifndef ARM_MATH_CM0 */ 103 | 104 | while(blkCnt > 0u) 105 | { 106 | /* C = -A */ 107 | /* Negate and then store the results in the destination buffer. */ 108 | *pDst++ = -*pSrc++; 109 | 110 | /* Decrement the loop counter */ 111 | blkCnt--; 112 | } 113 | } 114 | 115 | /** 116 | * @} end of negate group 117 | */ 118 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_init_f32.c 9 | * 10 | * Description: Floating-point PID Control initialization function 11 | * 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 14 | * 15 | * Version 1.0.10 2011/7/15 16 | * Big Endian support added and Merged M0 and M3/M4 Source code. 17 | * 18 | * Version 1.0.3 2010/11/29 19 | * Re-organized the CMSIS folders and updated documentation. 20 | * 21 | * Version 1.0.2 2010/11/11 22 | * Documentation updated. 23 | * 24 | * Version 1.0.1 2010/10/05 25 | * Production release and review comments incorporated. 26 | * 27 | * Version 1.0.0 2010/09/20 28 | * Production release and review comments incorporated. 29 | * ------------------------------------------------------------------- */ 30 | 31 | #include "arm_math.h" 32 | 33 | /** 34 | * @addtogroup PID 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @brief Initialization function for the floating-point PID Control. 40 | * @param[in,out] *S points to an instance of the PID structure. 41 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state & 1 = reset the state. 42 | * @return none. 43 | * \par Description: 44 | * \par 45 | * The
resetStateFlag
specifies whether to set state to zero or not. \n
46 | * The function computes the structure fields: A0
, A1
A2
47 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
48 | * also sets the state variables to all zeros.
49 | */
50 |
51 | void arm_pid_init_f32(
52 | arm_pid_instance_f32 * S,
53 | int32_t resetStateFlag)
54 | {
55 |
56 | /* Derived coefficient A0 */
57 | S->A0 = S->Kp + S->Ki + S->Kd;
58 |
59 | /* Derived coefficient A1 */
60 | S->A1 = (-S->Kp) - ((float32_t) 2.0 * S->Kd);
61 |
62 | /* Derived coefficient A2 */
63 | S->A2 = S->Kd;
64 |
65 | /* Check whether state needs reset or not */
66 | if(resetStateFlag)
67 | {
68 | /* Clear the state buffer. The size will be always 3 samples */
69 | memset(S->state, 0, 3u * sizeof(float32_t));
70 | }
71 |
72 | }
73 |
74 | /**
75 | * @} end of PID group
76 | */
77 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_init_q15.c
9 | *
10 | * Description: Q15 PID Control initialization function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * -------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @addtogroup PID
34 | * @{
35 | */
36 |
37 | /**
38 | * @details
39 | * @param[in,out] *S points to an instance of the Q15 PID structure.
40 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
41 | * @return none.
42 | * \par Description:
43 | * \par
44 | * The resetStateFlag
specifies whether to set state to zero or not. \n
45 | * The function computes the structure fields: A0
, A1
A2
46 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
47 | * also sets the state variables to all zeros.
48 | */
49 |
50 | void arm_pid_init_q15(
51 | arm_pid_instance_q15 * S,
52 | int32_t resetStateFlag)
53 | {
54 |
55 | #ifndef ARM_MATH_CM0
56 |
57 | /* Run the below code for Cortex-M4 and Cortex-M3 */
58 |
59 | /* Derived coefficient A0 */
60 | S->A0 = __QADD16(__QADD16(S->Kp, S->Ki), S->Kd);
61 |
62 | /* Derived coefficients and pack into A1 */
63 |
64 | #ifndef ARM_MATH_BIG_ENDIAN
65 |
66 | S->A1 = __PKHBT(-__QADD16(__QADD16(S->Kd, S->Kd), S->Kp), S->Kd, 16);
67 |
68 | #else
69 |
70 | S->A1 = __PKHBT(S->Kd, -__QADD16(__QADD16(S->Kd, S->Kd), S->Kp), 16);
71 |
72 | #endif /* #ifndef ARM_MATH_BIG_ENDIAN */
73 |
74 | /* Check whether state needs reset or not */
75 | if(resetStateFlag)
76 | {
77 | /* Clear the state buffer. The size will be always 3 samples */
78 | memset(S->state, 0, 3u * sizeof(q15_t));
79 | }
80 |
81 | #else
82 |
83 | /* Run the below code for Cortex-M0 */
84 |
85 | q31_t temp; /*to store the sum */
86 |
87 | /* Derived coefficient A0 */
88 | temp = S->Kp + S->Ki + S->Kd;
89 | S->A0 = (q15_t) __SSAT(temp, 16);
90 |
91 | /* Derived coefficients and pack into A1 */
92 | temp = -(S->Kd + S->Kd + S->Kp);
93 | S->A1 = (q15_t) __SSAT(temp, 16);
94 | S->A2 = S->Kd;
95 |
96 |
97 |
98 | /* Check whether state needs reset or not */
99 | if(resetStateFlag)
100 | {
101 | /* Clear the state buffer. The size will be always 3 samples */
102 | memset(S->state, 0, 3u * sizeof(q15_t));
103 | }
104 |
105 | #endif /* #ifndef ARM_MATH_CM0 */
106 |
107 | }
108 |
109 | /**
110 | * @} end of PID group
111 | */
112 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_init_q31.c
9 | *
10 | * Description: Q31 PID Control initialization function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * ------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @addtogroup PID
34 | * @{
35 | */
36 |
37 | /**
38 | * @brief Initialization function for the Q31 PID Control.
39 | * @param[in,out] *S points to an instance of the Q31 PID structure.
40 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state.
41 | * @return none.
42 | * \par Description:
43 | * \par
44 | * The resetStateFlag
specifies whether to set state to zero or not. \n
45 | * The function computes the structure fields: A0
, A1
A2
46 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd)
47 | * also sets the state variables to all zeros.
48 | */
49 |
50 | void arm_pid_init_q31(
51 | arm_pid_instance_q31 * S,
52 | int32_t resetStateFlag)
53 | {
54 |
55 | #ifndef ARM_MATH_CM0
56 |
57 | /* Run the below code for Cortex-M4 and Cortex-M3 */
58 |
59 | /* Derived coefficient A0 */
60 | S->A0 = __QADD(__QADD(S->Kp, S->Ki), S->Kd);
61 |
62 | /* Derived coefficient A1 */
63 | S->A1 = -__QADD(__QADD(S->Kd, S->Kd), S->Kp);
64 |
65 |
66 | #else
67 |
68 | /* Run the below code for Cortex-M0 */
69 |
70 | q31_t temp;
71 |
72 | /* Derived coefficient A0 */
73 | temp = clip_q63_to_q31((q63_t) S->Kp + S->Ki);
74 | S->A0 = clip_q63_to_q31((q63_t) temp + S->Kd);
75 |
76 | /* Derived coefficient A1 */
77 | temp = clip_q63_to_q31((q63_t) S->Kd + S->Kd);
78 | S->A1 = -clip_q63_to_q31((q63_t) temp + S->Kp);
79 |
80 | #endif /* #ifndef ARM_MATH_CM0 */
81 |
82 | /* Derived coefficient A2 */
83 | S->A2 = S->Kd;
84 |
85 | /* Check whether state needs reset or not */
86 | if(resetStateFlag)
87 | {
88 | /* Clear the state buffer. The size will be always 3 samples */
89 | memset(S->state, 0, 3u * sizeof(q31_t));
90 | }
91 |
92 | }
93 |
94 | /**
95 | * @} end of PID group
96 | */
97 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_f32.c
9 | *
10 | * Description: Floating-point PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * ------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @addtogroup PID
34 | * @{
35 | */
36 |
37 | /**
38 | * @brief Reset function for the floating-point PID Control.
39 | * @param[in] *S Instance pointer of PID control data structure.
40 | * @return none.
41 | * \par Description:
42 | * The function resets the state buffer to zeros.
43 | */
44 | void arm_pid_reset_f32(
45 | arm_pid_instance_f32 * S)
46 | {
47 |
48 | /* Clear the state buffer. The size will be always 3 samples */
49 | memset(S->state, 0, 3u * sizeof(float32_t));
50 | }
51 |
52 | /**
53 | * @} end of PID group
54 | */
55 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_q15.c
9 | *
10 | * Description: Q15 PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * -------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @addtogroup PID
34 | * @{
35 | */
36 |
37 | /**
38 | * @brief Reset function for the Q15 PID Control.
39 | * @param[in] *S Instance pointer of PID control data structure.
40 | * @return none.
41 | * \par Description:
42 | * The function resets the state buffer to zeros.
43 | */
44 | void arm_pid_reset_q15(
45 | arm_pid_instance_q15 * S)
46 | {
47 | /* Reset state to zero, The size will be always 3 samples */
48 | memset(S->state, 0, 3u * sizeof(q15_t));
49 | }
50 |
51 | /**
52 | * @} end of PID group
53 | */
54 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_pid_reset_q31.c
9 | *
10 | * Description: Q31 PID Control reset function
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * ------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @addtogroup PID
34 | * @{
35 | */
36 |
37 | /**
38 | * @brief Reset function for the Q31 PID Control.
39 | * @param[in] *S Instance pointer of PID control data structure.
40 | * @return none.
41 | * \par Description:
42 | * The function resets the state buffer to zeros.
43 | */
44 | void arm_pid_reset_q31(
45 | arm_pid_instance_q31 * S)
46 | {
47 |
48 | /* Clear the state buffer. The size will be always 3 samples */
49 | memset(S->state, 0, 3u * sizeof(q31_t));
50 | }
51 |
52 | /**
53 | * @} end of PID group
54 | */
55 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_biquad_cascade_df2T_init_f32.c
9 | *
10 | * Description: Initialization function for the floating-point transposed
11 | * direct form II Biquad cascade filter.
12 | *
13 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 | *
15 | * Version 1.0.10 2011/7/15
16 | * Big Endian support added and Merged M0 and M3/M4 Source code.
17 | *
18 | * Version 1.0.3 2010/11/29
19 | * Re-organized the CMSIS folders and updated documentation.
20 | *
21 | * Version 1.0.2 2010/11/11
22 | * Documentation updated.
23 | *
24 | * Version 1.0.1 2010/10/05
25 | * Production release and review comments incorporated.
26 | *
27 | * Version 1.0.0 2010/09/20
28 | * Production release and review comments incorporated
29 | *
30 | * Version 0.0.7 2010/06/10
31 | * Misra-C changes done
32 | * ---------------------------------------------------------------------------*/
33 |
34 | #include "arm_math.h"
35 |
36 | /**
37 | * @ingroup groupFilters
38 | */
39 |
40 | /**
41 | * @addtogroup BiquadCascadeDF2T
42 | * @{
43 | */
44 |
45 | /**
46 | * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
47 | * @param[in,out] *S points to an instance of the filter data structure.
48 | * @param[in] numStages number of 2nd order stages in the filter.
49 | * @param[in] *pCoeffs points to the filter coefficients.
50 | * @param[in] *pState points to the state buffer.
51 | * @return none
52 | *
53 | * Coefficient and State Ordering:
54 | * \par
55 | * The coefficients are stored in the array pCoeffs
in the following order:
56 | * 57 | * {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...} 58 | *59 | * 60 | * \par 61 | * where
b1x
and a1x
are the coefficients for the first stage,
62 | * b2x
and a2x
are the coefficients for the second stage,
63 | * and so on. The pCoeffs
array contains a total of 5*numStages
values.
64 | *
65 | * \par
66 | * The pState
is a pointer to state array.
67 | * Each Biquad stage has 2 state variables d1,
and d2
.
68 | * The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on.
69 | * The state array has a total length of 2*numStages
values.
70 | * The state variables are updated after each block of data is processed; the coefficients are untouched.
71 | */
72 |
73 | void arm_biquad_cascade_df2T_init_f32(
74 | arm_biquad_cascade_df2T_instance_f32 * S,
75 | uint8_t numStages,
76 | float32_t * pCoeffs,
77 | float32_t * pState)
78 | {
79 | /* Assign filter stages */
80 | S->numStages = numStages;
81 |
82 | /* Assign coefficient pointer */
83 | S->pCoeffs = pCoeffs;
84 |
85 | /* Clear state buffer and size is always 2 * numStages */
86 | memset(pState, 0, (2u * (uint32_t) numStages) * sizeof(float32_t));
87 |
88 | /* Assign state pointer */
89 | S->pState = pState;
90 | }
91 |
92 | /**
93 | * @} end of BiquadCascadeDF2T group
94 | */
95 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_f32.c
9 | *
10 | * Description: Floating-point FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.5 2010/04/26
30 | * incorporated review comments and updated with latest CMSIS layer
31 | *
32 | * Version 0.0.3 2010/03/10
33 | * Initial version
34 | * ---------------------------------------------------------------------------*/
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR
44 | * @{
45 | */
46 |
47 | /**
48 | * @details
49 | *
50 | * @param[in,out] *S points to an instance of the floating-point FIR filter structure.
51 | * @param[in] numTaps Number of filter coefficients in the filter.
52 | * @param[in] *pCoeffs points to the filter coefficients buffer.
53 | * @param[in] *pState points to the state buffer.
54 | * @param[in] blockSize number of samples that are processed per call.
55 | * @return none.
56 | *
57 | * Description:
58 | * \par
59 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
60 | * 61 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 62 | *63 | * \par 64 | *
pState
points to the array of state variables.
65 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_f32()
.
66 | */
67 |
68 | void arm_fir_init_f32(
69 | arm_fir_instance_f32 * S,
70 | uint16_t numTaps,
71 | float32_t * pCoeffs,
72 | float32_t * pState,
73 | uint32_t blockSize)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and the size of state buffer is (blockSize + numTaps - 1) */
82 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t));
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | }
88 |
89 | /**
90 | * @} end of FIR group
91 | */
92 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_q31.c
9 | *
10 | * Description: Q31 FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.5 2010/04/26
30 | * incorporated review comments and updated with latest CMSIS layer
31 | *
32 | * Version 0.0.3 2010/03/10
33 | * Initial version
34 | * -------------------------------------------------------------------- */
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR
44 | * @{
45 | */
46 |
47 | /**
48 | * @details
49 | *
50 | * @param[in,out] *S points to an instance of the Q31 FIR filter structure.
51 | * @param[in] numTaps Number of filter coefficients in the filter.
52 | * @param[in] *pCoeffs points to the filter coefficients buffer.
53 | * @param[in] *pState points to the state buffer.
54 | * @param[in] blockSize number of samples that are processed per call.
55 | * @return none.
56 | *
57 | * Description:
58 | * \par
59 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
60 | * 61 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 62 | *63 | * \par 64 | *
pState
points to the array of state variables.
65 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_q31()
.
66 | */
67 |
68 | void arm_fir_init_q31(
69 | arm_fir_instance_q31 * S,
70 | uint16_t numTaps,
71 | q31_t * pCoeffs,
72 | q31_t * pState,
73 | uint32_t blockSize)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and state array size is (blockSize + numTaps - 1) */
82 | memset(pState, 0, (blockSize + ((uint32_t) numTaps - 1u)) * sizeof(q31_t));
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | }
88 |
89 | /**
90 | * @} end of FIR group
91 | */
92 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_init_q7.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_init_q7.c
9 | *
10 | * Description: Q7 FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.5 2010/04/26
30 | * incorporated review comments and updated with latest CMSIS layer
31 | *
32 | * Version 0.0.3 2010/03/10
33 | * Initial version
34 | * ------------------------------------------------------------------- */
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupFilters
40 | */
41 |
42 | /**
43 | * @addtogroup FIR
44 | * @{
45 | */
46 | /**
47 | * @param[in,out] *S points to an instance of the Q7 FIR filter structure.
48 | * @param[in] numTaps Number of filter coefficients in the filter.
49 | * @param[in] *pCoeffs points to the filter coefficients buffer.
50 | * @param[in] *pState points to the state buffer.
51 | * @param[in] blockSize number of samples that are processed per call.
52 | * @return none
53 | *
54 | * Description:
55 | * \par
56 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
57 | * 58 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 59 | *60 | * \par 61 | *
pState
points to the array of state variables.
62 | * pState
is of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_fir_q7()
.
63 | */
64 |
65 | void arm_fir_init_q7(
66 | arm_fir_instance_q7 * S,
67 | uint16_t numTaps,
68 | q7_t * pCoeffs,
69 | q7_t * pState,
70 | uint32_t blockSize)
71 | {
72 |
73 | /* Assign filter taps */
74 | S->numTaps = numTaps;
75 |
76 | /* Assign coefficient pointer */
77 | S->pCoeffs = pCoeffs;
78 |
79 | /* Clear the state buffer. The size is always (blockSize + numTaps - 1) */
80 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q7_t));
81 |
82 | /* Assign state pointer */
83 | S->pState = pState;
84 |
85 | }
86 |
87 | /**
88 | * @} end of FIR group
89 | */
90 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_f32.c
9 | *
10 | * Description: Floating-point FIR Lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the floating-point FIR lattice filter.
46 | * @param[in] *S points to an instance of the floating-point FIR lattice structure.
47 | * @param[in] numStages number of filter stages.
48 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
49 | * @param[in] *pState points to the state buffer. The array is of length numStages.
50 | * @return none.
51 | */
52 |
53 | void arm_fir_lattice_init_f32(
54 | arm_fir_lattice_instance_f32 * S,
55 | uint16_t numStages,
56 | float32_t * pCoeffs,
57 | float32_t * pState)
58 | {
59 | /* Assign filter taps */
60 | S->numStages = numStages;
61 |
62 | /* Assign coefficient pointer */
63 | S->pCoeffs = pCoeffs;
64 |
65 | /* Clear state buffer and size is always numStages */
66 | memset(pState, 0, (numStages) * sizeof(float32_t));
67 |
68 | /* Assign state pointer */
69 | S->pState = pState;
70 |
71 | }
72 |
73 | /**
74 | * @} end of FIR_Lattice group
75 | */
76 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_q15.c
9 | *
10 | * Description: Q15 FIR Lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q15 FIR lattice filter.
46 | * @param[in] *S points to an instance of the Q15 FIR lattice structure.
47 | * @param[in] numStages number of filter stages.
48 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
49 | * @param[in] *pState points to the state buffer. The array is of length numStages.
50 | * @return none.
51 | */
52 |
53 | void arm_fir_lattice_init_q15(
54 | arm_fir_lattice_instance_q15 * S,
55 | uint16_t numStages,
56 | q15_t * pCoeffs,
57 | q15_t * pState)
58 | {
59 | /* Assign filter taps */
60 | S->numStages = numStages;
61 |
62 | /* Assign coefficient pointer */
63 | S->pCoeffs = pCoeffs;
64 |
65 | /* Clear state buffer and size is always numStages */
66 | memset(pState, 0, (numStages) * sizeof(q15_t));
67 |
68 | /* Assign state pointer */
69 | S->pState = pState;
70 |
71 | }
72 |
73 | /**
74 | * @} end of FIR_Lattice group
75 | */
76 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_lattice_init_q31.c
9 | *
10 | * Description: Q31 FIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q31 FIR lattice filter.
46 | * @param[in] *S points to an instance of the Q31 FIR lattice structure.
47 | * @param[in] numStages number of filter stages.
48 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages.
49 | * @param[in] *pState points to the state buffer. The array is of length numStages.
50 | * @return none.
51 | */
52 |
53 | void arm_fir_lattice_init_q31(
54 | arm_fir_lattice_instance_q31 * S,
55 | uint16_t numStages,
56 | q31_t * pCoeffs,
57 | q31_t * pState)
58 | {
59 | /* Assign filter taps */
60 | S->numStages = numStages;
61 |
62 | /* Assign coefficient pointer */
63 | S->pCoeffs = pCoeffs;
64 |
65 | /* Clear state buffer and size is always numStages */
66 | memset(pState, 0, (numStages) * sizeof(q31_t));
67 |
68 | /* Assign state pointer */
69 | S->pState = pState;
70 |
71 | }
72 |
73 | /**
74 | * @} end of FIR_Lattice group
75 | */
76 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_sparse_init_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_f32.c
9 | *
10 | * Description: Floating-point sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Sparse
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the floating-point sparse FIR filter.
46 | * @param[in,out] *S points to an instance of the floating-point sparse FIR structure.
47 | * @param[in] numTaps number of nonzero coefficients in the filter.
48 | * @param[in] *pCoeffs points to the array of filter coefficients.
49 | * @param[in] *pState points to the state buffer.
50 | * @param[in] *pTapDelay points to the array of offset times.
51 | * @param[in] maxDelay maximum offset time supported.
52 | * @param[in] blockSize number of samples that will be processed per block.
53 | * @return none
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
holds the filter coefficients and has length numTaps
.
58 | * pState
holds the filter's state variables and must be of length
59 | * maxDelay + blockSize
, where maxDelay
60 | * is the maximum number of delay line values.
61 | * blockSize
is the
62 | * number of samples processed by the arm_fir_sparse_f32()
function.
63 | */
64 |
65 | void arm_fir_sparse_init_f32(
66 | arm_fir_sparse_instance_f32 * S,
67 | uint16_t numTaps,
68 | float32_t * pCoeffs,
69 | float32_t * pState,
70 | int32_t * pTapDelay,
71 | uint16_t maxDelay,
72 | uint32_t blockSize)
73 | {
74 | /* Assign filter taps */
75 | S->numTaps = numTaps;
76 |
77 | /* Assign coefficient pointer */
78 | S->pCoeffs = pCoeffs;
79 |
80 | /* Assign TapDelay pointer */
81 | S->pTapDelay = pTapDelay;
82 |
83 | /* Assign MaxDelay */
84 | S->maxDelay = maxDelay;
85 |
86 | /* reset the stateIndex to 0 */
87 | S->stateIndex = 0u;
88 |
89 | /* Clear state buffer and size is always maxDelay + blockSize */
90 | memset(pState, 0, (maxDelay + blockSize) * sizeof(float32_t));
91 |
92 | /* Assign state pointer */
93 | S->pState = pState;
94 |
95 | }
96 |
97 | /**
98 | * @} end of FIR_Sparse group
99 | */
100 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_sparse_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q15.c
9 | *
10 | * Description: Q15 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Sparse
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q15 sparse FIR filter.
46 | * @param[in,out] *S points to an instance of the Q15 sparse FIR structure.
47 | * @param[in] numTaps number of nonzero coefficients in the filter.
48 | * @param[in] *pCoeffs points to the array of filter coefficients.
49 | * @param[in] *pState points to the state buffer.
50 | * @param[in] *pTapDelay points to the array of offset times.
51 | * @param[in] maxDelay maximum offset time supported.
52 | * @param[in] blockSize number of samples that will be processed per block.
53 | * @return none
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
holds the filter coefficients and has length numTaps
.
58 | * pState
holds the filter's state variables and must be of length
59 | * maxDelay + blockSize
, where maxDelay
60 | * is the maximum number of delay line values.
61 | * blockSize
is the
62 | * number of words processed by arm_fir_sparse_q15()
function.
63 | */
64 |
65 | void arm_fir_sparse_init_q15(
66 | arm_fir_sparse_instance_q15 * S,
67 | uint16_t numTaps,
68 | q15_t * pCoeffs,
69 | q15_t * pState,
70 | int32_t * pTapDelay,
71 | uint16_t maxDelay,
72 | uint32_t blockSize)
73 | {
74 | /* Assign filter taps */
75 | S->numTaps = numTaps;
76 |
77 | /* Assign coefficient pointer */
78 | S->pCoeffs = pCoeffs;
79 |
80 | /* Assign TapDelay pointer */
81 | S->pTapDelay = pTapDelay;
82 |
83 | /* Assign MaxDelay */
84 | S->maxDelay = maxDelay;
85 |
86 | /* reset the stateIndex to 0 */
87 | S->stateIndex = 0u;
88 |
89 | /* Clear state buffer and size is always maxDelay + blockSize */
90 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q15_t));
91 |
92 | /* Assign state pointer */
93 | S->pState = pState;
94 |
95 | }
96 |
97 | /**
98 | * @} end of FIR_Sparse group
99 | */
100 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_sparse_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q31.c
9 | *
10 | * Description: Q31 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Sparse
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q31 sparse FIR filter.
46 | * @param[in,out] *S points to an instance of the Q31 sparse FIR structure.
47 | * @param[in] numTaps number of nonzero coefficients in the filter.
48 | * @param[in] *pCoeffs points to the array of filter coefficients.
49 | * @param[in] *pState points to the state buffer.
50 | * @param[in] *pTapDelay points to the array of offset times.
51 | * @param[in] maxDelay maximum offset time supported.
52 | * @param[in] blockSize number of samples that will be processed per block.
53 | * @return none
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
holds the filter coefficients and has length numTaps
.
58 | * pState
holds the filter's state variables and must be of length
59 | * maxDelay + blockSize
, where maxDelay
60 | * is the maximum number of delay line values.
61 | * blockSize
is the number of words processed by arm_fir_sparse_q31()
function.
62 | */
63 |
64 | void arm_fir_sparse_init_q31(
65 | arm_fir_sparse_instance_q31 * S,
66 | uint16_t numTaps,
67 | q31_t * pCoeffs,
68 | q31_t * pState,
69 | int32_t * pTapDelay,
70 | uint16_t maxDelay,
71 | uint32_t blockSize)
72 | {
73 | /* Assign filter taps */
74 | S->numTaps = numTaps;
75 |
76 | /* Assign coefficient pointer */
77 | S->pCoeffs = pCoeffs;
78 |
79 | /* Assign TapDelay pointer */
80 | S->pTapDelay = pTapDelay;
81 |
82 | /* Assign MaxDelay */
83 | S->maxDelay = maxDelay;
84 |
85 | /* reset the stateIndex to 0 */
86 | S->stateIndex = 0u;
87 |
88 | /* Clear state buffer and size is always maxDelay + blockSize */
89 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q31_t));
90 |
91 | /* Assign state pointer */
92 | S->pState = pState;
93 |
94 | }
95 |
96 | /**
97 | * @} end of FIR_Sparse group
98 | */
99 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_sparse_init_q7.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_fir_sparse_init_q7.c
9 | *
10 | * Description: Q7 sparse FIR filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup FIR_Sparse
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q7 sparse FIR filter.
46 | * @param[in,out] *S points to an instance of the Q7 sparse FIR structure.
47 | * @param[in] numTaps number of nonzero coefficients in the filter.
48 | * @param[in] *pCoeffs points to the array of filter coefficients.
49 | * @param[in] *pState points to the state buffer.
50 | * @param[in] *pTapDelay points to the array of offset times.
51 | * @param[in] maxDelay maximum offset time supported.
52 | * @param[in] blockSize number of samples that will be processed per block.
53 | * @return none
54 | *
55 | * Description:
56 | * \par
57 | * pCoeffs
holds the filter coefficients and has length numTaps
.
58 | * pState
holds the filter's state variables and must be of length
59 | * maxDelay + blockSize
, where maxDelay
60 | * is the maximum number of delay line values.
61 | * blockSize
is the
62 | * number of samples processed by the arm_fir_sparse_q7()
function.
63 | */
64 |
65 | void arm_fir_sparse_init_q7(
66 | arm_fir_sparse_instance_q7 * S,
67 | uint16_t numTaps,
68 | q7_t * pCoeffs,
69 | q7_t * pState,
70 | int32_t * pTapDelay,
71 | uint16_t maxDelay,
72 | uint32_t blockSize)
73 | {
74 | /* Assign filter taps */
75 | S->numTaps = numTaps;
76 |
77 | /* Assign coefficient pointer */
78 | S->pCoeffs = pCoeffs;
79 |
80 | /* Assign TapDelay pointer */
81 | S->pTapDelay = pTapDelay;
82 |
83 | /* Assign MaxDelay */
84 | S->maxDelay = maxDelay;
85 |
86 | /* reset the stateIndex to 0 */
87 | S->stateIndex = 0u;
88 |
89 | /* Clear state buffer and size is always maxDelay + blockSize */
90 | memset(pState, 0, (maxDelay + blockSize) * sizeof(q7_t));
91 |
92 | /* Assign state pointer */
93 | S->pState = pState;
94 |
95 | }
96 |
97 | /**
98 | * @} end of FIR_Sparse group
99 | */
100 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_f32.c
9 | *
10 | * Description: Floating-point IIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup IIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the floating-point IIR lattice filter.
46 | * @param[in] *S points to an instance of the floating-point IIR lattice structure.
47 | * @param[in] numStages number of stages in the filter.
48 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
49 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
50 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
51 | * @param[in] blockSize number of samples to process.
52 | * @return none.
53 | */
54 |
55 | void arm_iir_lattice_init_f32(
56 | arm_iir_lattice_instance_f32 * S,
57 | uint16_t numStages,
58 | float32_t * pkCoeffs,
59 | float32_t * pvCoeffs,
60 | float32_t * pState,
61 | uint32_t blockSize)
62 | {
63 | /* Assign filter taps */
64 | S->numStages = numStages;
65 |
66 | /* Assign reflection coefficient pointer */
67 | S->pkCoeffs = pkCoeffs;
68 |
69 | /* Assign ladder coefficient pointer */
70 | S->pvCoeffs = pvCoeffs;
71 |
72 | /* Clear state buffer and size is always blockSize + numStages */
73 | memset(pState, 0, (numStages + blockSize) * sizeof(float32_t));
74 |
75 | /* Assign state pointer */
76 | S->pState = pState;
77 |
78 |
79 | }
80 |
81 | /**
82 | * @} end of IIR_Lattice group
83 | */
84 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_q15.c
9 | *
10 | * Description: Q15 IIR lattice filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup IIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q15 IIR lattice filter.
46 | * @param[in] *S points to an instance of the Q15 IIR lattice structure.
47 | * @param[in] numStages number of stages in the filter.
48 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages.
49 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1.
50 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize.
51 | * @param[in] blockSize number of samples to process per call.
52 | * @return none.
53 | */
54 |
55 | void arm_iir_lattice_init_q15(
56 | arm_iir_lattice_instance_q15 * S,
57 | uint16_t numStages,
58 | q15_t * pkCoeffs,
59 | q15_t * pvCoeffs,
60 | q15_t * pState,
61 | uint32_t blockSize)
62 | {
63 | /* Assign filter taps */
64 | S->numStages = numStages;
65 |
66 | /* Assign reflection coefficient pointer */
67 | S->pkCoeffs = pkCoeffs;
68 |
69 | /* Assign ladder coefficient pointer */
70 | S->pvCoeffs = pvCoeffs;
71 |
72 | /* Clear state buffer and size is always blockSize + numStages */
73 | memset(pState, 0, (numStages + blockSize) * sizeof(q15_t));
74 |
75 | /* Assign state pointer */
76 | S->pState = pState;
77 |
78 |
79 | }
80 |
81 | /**
82 | * @} end of IIR_Lattice group
83 | */
84 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_iir_lattice_init_q31.c
9 | *
10 | * Description: Initialization function for the Q31 IIR lattice filter.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup IIR_Lattice
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q31 IIR lattice filter.
46 | * @param[in] *S points to an instance of the Q31 IIR lattice structure.
47 | * @param[in] numStages number of stages in the filter.
48 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages.
49 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1.
50 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize.
51 | * @param[in] blockSize number of samples to process.
52 | * @return none.
53 | */
54 |
55 | void arm_iir_lattice_init_q31(
56 | arm_iir_lattice_instance_q31 * S,
57 | uint16_t numStages,
58 | q31_t * pkCoeffs,
59 | q31_t * pvCoeffs,
60 | q31_t * pState,
61 | uint32_t blockSize)
62 | {
63 | /* Assign filter taps */
64 | S->numStages = numStages;
65 |
66 | /* Assign reflection coefficient pointer */
67 | S->pkCoeffs = pkCoeffs;
68 |
69 | /* Assign ladder coefficient pointer */
70 | S->pvCoeffs = pvCoeffs;
71 |
72 | /* Clear state buffer and size is always blockSize + numStages */
73 | memset(pState, 0, (numStages + blockSize) * sizeof(q31_t));
74 |
75 | /* Assign state pointer */
76 | S->pState = pState;
77 |
78 |
79 | }
80 |
81 | /**
82 | * @} end of IIR_Lattice group
83 | */
84 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_f32.c
9 | *
10 | * Description: Floating-point LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @addtogroup LMS
37 | * @{
38 | */
39 |
40 | /**
41 | * @brief Initialization function for floating-point LMS filter.
42 | * @param[in] *S points to an instance of the floating-point LMS filter structure.
43 | * @param[in] numTaps number of filter coefficients.
44 | * @param[in] *pCoeffs points to the coefficient buffer.
45 | * @param[in] *pState points to state buffer.
46 | * @param[in] mu step size that controls filter coefficient updates.
47 | * @param[in] blockSize number of samples to process.
48 | * @return none.
49 | */
50 |
51 | /**
52 | * \par Description:
53 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
54 | * 55 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 56 | *57 | * The initial filter coefficients serve as a starting point for the adaptive filter. 58 | *
pState
points to an array of length numTaps+blockSize-1
samples, where blockSize
is the number of input samples processed by each call to arm_lms_f32()
.
59 | */
60 |
61 | void arm_lms_init_f32(
62 | arm_lms_instance_f32 * S,
63 | uint16_t numTaps,
64 | float32_t * pCoeffs,
65 | float32_t * pState,
66 | float32_t mu,
67 | uint32_t blockSize)
68 | {
69 | /* Assign filter taps */
70 | S->numTaps = numTaps;
71 |
72 | /* Assign coefficient pointer */
73 | S->pCoeffs = pCoeffs;
74 |
75 | /* Clear state buffer and size is always blockSize + numTaps */
76 | memset(pState, 0, (numTaps + (blockSize - 1)) * sizeof(float32_t));
77 |
78 | /* Assign state pointer */
79 | S->pState = pState;
80 |
81 | /* Assign Step size value */
82 | S->mu = mu;
83 | }
84 |
85 | /**
86 | * @} end of LMS group
87 | */
88 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_init_q15.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_q15.c
9 | *
10 | * Description: Q15 LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup LMS
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for the Q15 LMS filter.
46 | * @param[in] *S points to an instance of the Q15 LMS filter structure.
47 | * @param[in] numTaps number of filter coefficients.
48 | * @param[in] *pCoeffs points to the coefficient buffer.
49 | * @param[in] *pState points to the state buffer.
50 | * @param[in] mu step size that controls filter coefficient updates.
51 | * @param[in] blockSize number of samples to process.
52 | * @param[in] postShift bit shift applied to coefficients.
53 | * @return none.
54 | *
55 | * \par Description:
56 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
57 | * 58 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 59 | *60 | * The initial filter coefficients serve as a starting point for the adaptive filter. 61 | *
pState
points to the array of state variables and size of array is
62 | * numTaps+blockSize-1
samples, where blockSize
is the number of
63 | * input samples processed by each call to arm_lms_q15()
.
64 | */
65 |
66 | void arm_lms_init_q15(
67 | arm_lms_instance_q15 * S,
68 | uint16_t numTaps,
69 | q15_t * pCoeffs,
70 | q15_t * pState,
71 | q15_t mu,
72 | uint32_t blockSize,
73 | uint32_t postShift)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
82 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q15_t));
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | /* Assign Step size value */
88 | S->mu = mu;
89 |
90 | /* Assign postShift value to be applied */
91 | S->postShift = postShift;
92 |
93 | }
94 |
95 | /**
96 | * @} end of LMS group
97 | */
98 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_init_q31.c
9 | *
10 | * Description: Q31 LMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup LMS
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for Q31 LMS filter.
46 | * @param[in] *S points to an instance of the Q31 LMS filter structure.
47 | * @param[in] numTaps number of filter coefficients.
48 | * @param[in] *pCoeffs points to coefficient buffer.
49 | * @param[in] *pState points to state buffer.
50 | * @param[in] mu step size that controls filter coefficient updates.
51 | * @param[in] blockSize number of samples to process.
52 | * @param[in] postShift bit shift applied to coefficients.
53 | * @return none.
54 | *
55 | * \par Description:
56 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
57 | * 58 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 59 | *60 | * The initial filter coefficients serve as a starting point for the adaptive filter. 61 | *
pState
points to an array of length numTaps+blockSize-1
samples,
62 | * where blockSize
is the number of input samples processed by each call to
63 | * arm_lms_q31()
.
64 | */
65 |
66 | void arm_lms_init_q31(
67 | arm_lms_instance_q31 * S,
68 | uint16_t numTaps,
69 | q31_t * pCoeffs,
70 | q31_t * pState,
71 | q31_t mu,
72 | uint32_t blockSize,
73 | uint32_t postShift)
74 | {
75 | /* Assign filter taps */
76 | S->numTaps = numTaps;
77 |
78 | /* Assign coefficient pointer */
79 | S->pCoeffs = pCoeffs;
80 |
81 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
82 | memset(pState, 0, ((uint32_t) numTaps + (blockSize - 1u)) * sizeof(q31_t));
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | /* Assign Step size value */
88 | S->mu = mu;
89 |
90 | /* Assign postShift value to be applied */
91 | S->postShift = postShift;
92 |
93 | }
94 |
95 | /**
96 | * @} end of LMS group
97 | */
98 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_norm_init_f32.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_norm_init_f32.c
9 | *
10 | * Description: Floating-point NLMS filter initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupFilters
37 | */
38 |
39 | /**
40 | * @addtogroup LMS_NORM
41 | * @{
42 | */
43 |
44 | /**
45 | * @brief Initialization function for floating-point normalized LMS filter.
46 | * @param[in] *S points to an instance of the floating-point LMS filter structure.
47 | * @param[in] numTaps number of filter coefficients.
48 | * @param[in] *pCoeffs points to coefficient buffer.
49 | * @param[in] *pState points to state buffer.
50 | * @param[in] mu step size that controls filter coefficient updates.
51 | * @param[in] blockSize number of samples to process.
52 | * @return none.
53 | *
54 | * \par Description:
55 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
56 | * 57 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 58 | *59 | * The initial filter coefficients serve as a starting point for the adaptive filter. 60 | *
pState
points to an array of length numTaps+blockSize-1
samples,
61 | * where blockSize
is the number of input samples processed by each call to arm_lms_norm_f32()
.
62 | */
63 |
64 | void arm_lms_norm_init_f32(
65 | arm_lms_norm_instance_f32 * S,
66 | uint16_t numTaps,
67 | float32_t * pCoeffs,
68 | float32_t * pState,
69 | float32_t mu,
70 | uint32_t blockSize)
71 | {
72 | /* Assign filter taps */
73 | S->numTaps = numTaps;
74 |
75 | /* Assign coefficient pointer */
76 | S->pCoeffs = pCoeffs;
77 |
78 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
79 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t));
80 |
81 | /* Assign state pointer */
82 | S->pState = pState;
83 |
84 | /* Assign Step size value */
85 | S->mu = mu;
86 |
87 | /* Initialise Energy to zero */
88 | S->energy = 0.0f;
89 |
90 | /* Initialise x0 to zero */
91 | S->x0 = 0.0f;
92 |
93 | }
94 |
95 | /**
96 | * @} end of LMS_NORM group
97 | */
98 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_lms_norm_init_q31.c:
--------------------------------------------------------------------------------
1 | /*-----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_lms_norm_init_q31.c
9 | *
10 | * Description: Q31 NLMS initialization function.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------*/
32 |
33 | #include "arm_math.h"
34 | #include "arm_common_tables.h"
35 |
36 | /**
37 | * @addtogroup LMS_NORM
38 | * @{
39 | */
40 |
41 | /**
42 | * @brief Initialization function for Q31 normalized LMS filter.
43 | * @param[in] *S points to an instance of the Q31 normalized LMS filter structure.
44 | * @param[in] numTaps number of filter coefficients.
45 | * @param[in] *pCoeffs points to coefficient buffer.
46 | * @param[in] *pState points to state buffer.
47 | * @param[in] mu step size that controls filter coefficient updates.
48 | * @param[in] blockSize number of samples to process.
49 | * @param[in] postShift bit shift applied to coefficients.
50 | * @return none.
51 | *
52 | * Description:
53 | * \par
54 | * pCoeffs
points to the array of filter coefficients stored in time reversed order:
55 | * 56 | * {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]} 57 | *58 | * The initial filter coefficients serve as a starting point for the adaptive filter. 59 | *
pState
points to an array of length numTaps+blockSize-1
samples,
60 | * where blockSize
is the number of input samples processed by each call to arm_lms_norm_q31()
.
61 | */
62 |
63 | void arm_lms_norm_init_q31(
64 | arm_lms_norm_instance_q31 * S,
65 | uint16_t numTaps,
66 | q31_t * pCoeffs,
67 | q31_t * pState,
68 | q31_t mu,
69 | uint32_t blockSize,
70 | uint8_t postShift)
71 | {
72 | /* Assign filter taps */
73 | S->numTaps = numTaps;
74 |
75 | /* Assign coefficient pointer */
76 | S->pCoeffs = pCoeffs;
77 |
78 | /* Clear state buffer and size is always blockSize + numTaps - 1 */
79 | memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q31_t));
80 |
81 | /* Assign post Shift value applied to coefficients */
82 | S->postShift = postShift;
83 |
84 | /* Assign state pointer */
85 | S->pState = pState;
86 |
87 | /* Assign Step size value */
88 | S->mu = mu;
89 |
90 | /* Initialize reciprocal pointer table */
91 | S->recipTable = armRecipTableQ31;
92 |
93 | /* Initialise Energy to zero */
94 | S->energy = 0;
95 |
96 | /* Initialise x0 to zero */
97 | S->x0 = 0;
98 |
99 | }
100 |
101 | /**
102 | * @} end of LMS_NORM group
103 | */
104 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_f32.c
9 | *
10 | * Description: Floating-point matrix initialization.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.5 2010/04/26
30 | * incorporated review comments and updated with latest CMSIS layer
31 | *
32 | * Version 0.0.3 2010/03/10
33 | * Initial version
34 | * -------------------------------------------------------------------------- */
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupMatrix
40 | */
41 |
42 | /**
43 | * @defgroup MatrixInit Matrix Initialization
44 | *
45 | * Initializes the underlying matrix data structure.
46 | * The functions set the numRows
,
47 | * numCols
, and pData
fields
48 | * of the matrix data structure.
49 | */
50 |
51 | /**
52 | * @addtogroup MatrixInit
53 | * @{
54 | */
55 |
56 | /**
57 | * @brief Floating-point matrix initialization.
58 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
59 | * @param[in] nRows number of rows in the matrix.
60 | * @param[in] nColumns number of columns in the matrix.
61 | * @param[in] *pData points to the matrix data array.
62 | * @return none
63 | */
64 |
65 | void arm_mat_init_f32(
66 | arm_matrix_instance_f32 * S,
67 | uint16_t nRows,
68 | uint16_t nColumns,
69 | float32_t * pData)
70 | {
71 | /* Assign Number of Rows */
72 | S->numRows = nRows;
73 |
74 | /* Assign Number of Columns */
75 | S->numCols = nColumns;
76 |
77 | /* Assign Data pointer */
78 | S->pData = pData;
79 | }
80 |
81 | /**
82 | * @} end of MatrixInit group
83 | */
84 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_q15.c
9 | *
10 | * Description: Q15 matrix initialization.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.5 2010/04/26
30 | * incorporated review comments and updated with latest CMSIS layer
31 | *
32 | * Version 0.0.3 2010/03/10
33 | * Initial version
34 | * -------------------------------------------------------------------------- */
35 |
36 |
37 | #include "arm_math.h"
38 |
39 | /**
40 | * @ingroup groupMatrix
41 | */
42 |
43 | /**
44 | * @addtogroup MatrixInit
45 | * @{
46 | */
47 |
48 | /**
49 | * @brief Q15 matrix initialization.
50 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
51 | * @param[in] nRows number of rows in the matrix.
52 | * @param[in] nColumns number of columns in the matrix.
53 | * @param[in] *pData points to the matrix data array.
54 | * @return none
55 | */
56 |
57 | void arm_mat_init_q15(
58 | arm_matrix_instance_q15 * S,
59 | uint16_t nRows,
60 | uint16_t nColumns,
61 | q15_t * pData)
62 | {
63 | /* Assign Number of Rows */
64 | S->numRows = nRows;
65 |
66 | /* Assign Number of Columns */
67 | S->numCols = nColumns;
68 |
69 | /* Assign Data pointer */
70 | S->pData = pData;
71 | }
72 |
73 | /**
74 | * @} end of MatrixInit group
75 | */
76 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_mat_init_q31.c
9 | *
10 | * Description: Q31 matrix initialization.
11 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
12 | *
13 | * Version 1.0.10 2011/7/15
14 | * Big Endian support added and Merged M0 and M3/M4 Source code.
15 | *
16 | * Version 1.0.3 2010/11/29
17 | * Re-organized the CMSIS folders and updated documentation.
18 | *
19 | * Version 1.0.2 2010/11/11
20 | * Documentation updated.
21 | *
22 | * Version 1.0.1 2010/10/05
23 | * Production release and review comments incorporated.
24 | *
25 | * Version 1.0.0 2010/09/20
26 | * Production release and review comments incorporated.
27 | *
28 | * Version 0.0.5 2010/04/26
29 | * incorporated review comments and updated with latest CMSIS layer
30 | *
31 | * Version 0.0.3 2010/03/10
32 | * Initial version
33 | * -------------------------------------------------------------------------- */
34 |
35 |
36 | #include "arm_math.h"
37 |
38 | /**
39 | * @ingroup groupMatrix
40 | */
41 |
42 | /**
43 | * @defgroup MatrixInit Matrix Initialization
44 | *
45 | */
46 |
47 | /**
48 | * @addtogroup MatrixInit
49 | * @{
50 | */
51 |
52 | /**
53 | * @brief Q31 matrix initialization.
54 | * @param[in,out] *S points to an instance of the floating-point matrix structure.
55 | * @param[in] nRows number of rows in the matrix.
56 | * @param[in] nColumns number of columns in the matrix.
57 | * @param[in] *pData points to the matrix data array.
58 | * @return none
59 | */
60 |
61 | void arm_mat_init_q31(
62 | arm_matrix_instance_q31 * S,
63 | uint16_t nRows,
64 | uint16_t nColumns,
65 | q31_t * pData)
66 | {
67 | /* Assign Number of Rows */
68 | S->numRows = nRows;
69 |
70 | /* Assign Number of Columns */
71 | S->numCols = nColumns;
72 |
73 | /* Assign Data pointer */
74 | S->pData = pData;
75 | }
76 |
77 | /**
78 | * @} end of MatrixInit group
79 | */
80 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/StatisticsFunctions/arm_max_q15.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_max_q15.c
9 | *
10 | * Description: Maximum value of a Q15 vector.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * ---------------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @ingroup groupStats
34 | */
35 |
36 | /**
37 | * @addtogroup Max
38 | * @{
39 | */
40 |
41 |
42 | /**
43 | * @brief Maximum value of a Q15 vector.
44 | * @param[in] *pSrc points to the input vector
45 | * @param[in] blockSize length of the input vector
46 | * @param[out] *pResult maximum value returned here
47 | * @param[out] *pIndex index of maximum value returned here
48 | * @return none.
49 | */
50 |
51 | void arm_max_q15(
52 | q15_t * pSrc,
53 | uint32_t blockSize,
54 | q15_t * pResult,
55 | uint32_t * pIndex)
56 | {
57 | q15_t maxVal, out; /* Temporary variables to store the output value. */
58 | uint32_t blkCnt, outIndex; /* loop counter */
59 |
60 | /* Initialise the index value to zero. */
61 | outIndex = 0u;
62 | /* Load first input value that act as reference value for comparision */
63 | out = *pSrc++;
64 |
65 | /* Loop over blockSize number of values */
66 | blkCnt = (blockSize - 1u);
67 |
68 | #ifndef ARM_MATH_CM0
69 |
70 | /* Run the below code for Cortex-M4 and Cortex-M3 */
71 |
72 | do
73 | {
74 | /* Initialize maxVal to the next consecutive values one by one */
75 | maxVal = *pSrc++;
76 |
77 | /* compare for the maximum value */
78 | if(out < maxVal)
79 | {
80 | /* Update the maximum value and its index */
81 | out = maxVal;
82 | outIndex = blockSize - blkCnt;
83 | }
84 |
85 | blkCnt--;
86 |
87 | } while(blkCnt > 0u);
88 |
89 | #else
90 |
91 | /* Run the below code for Cortex-M0 */
92 |
93 | while(blkCnt > 0u)
94 | {
95 | /* Initialize maxVal to the next consecutive values one by one */
96 | maxVal = *pSrc++;
97 |
98 | /* compare for the maximum value */
99 | if(out < maxVal)
100 | {
101 | /* Update the maximum value and its index */
102 | out = maxVal;
103 | outIndex = blockSize - blkCnt;
104 | }
105 | /* Decrement the loop counter */
106 | blkCnt--;
107 |
108 | }
109 |
110 | #endif /* #ifndef ARM_MATH_CM0 */
111 |
112 | /* Store the maximum value and its index into destination pointers */
113 | *pResult = out;
114 | *pIndex = outIndex;
115 | }
116 |
117 | /**
118 | * @} end of Max group
119 | */
120 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/StatisticsFunctions/arm_max_q31.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_max_q31.c
9 | *
10 | * Description: Maximum value of a Q31 vector.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | * ---------------------------------------------------------------------------- */
29 |
30 | #include "arm_math.h"
31 |
32 | /**
33 | * @ingroup groupStats
34 | */
35 |
36 | /**
37 | * @addtogroup Max
38 | * @{
39 | */
40 |
41 |
42 | /**
43 | * @brief Maximum value of a Q31 vector.
44 | * @param[in] *pSrc points to the input vector
45 | * @param[in] blockSize length of the input vector
46 | * @param[out] *pResult maximum value returned here
47 | * @param[out] *pIndex index of maximum value returned here
48 | * @return none.
49 | */
50 |
51 | void arm_max_q31(
52 | q31_t * pSrc,
53 | uint32_t blockSize,
54 | q31_t * pResult,
55 | uint32_t * pIndex)
56 | {
57 | q31_t maxVal, out; /* Temporary variables to store the output value. */
58 | uint32_t blkCnt, outIndex; /* loop counter */
59 |
60 | /* Initialise the index value to zero. */
61 | outIndex = 0u;
62 | /* Load first input value that act as reference value for comparision */
63 | out = *pSrc++;
64 |
65 | /* Loop over blockSize number of values */
66 | blkCnt = (blockSize - 1u);
67 |
68 | #ifndef ARM_MATH_CM0
69 |
70 | /* Run the below code for Cortex-M4 and Cortex-M3 */
71 |
72 | do
73 | {
74 | /* Initialize maxVal to the next consecutive values one by one */
75 | maxVal = *pSrc++;
76 |
77 | /* compare for the maximum value */
78 | if(out < maxVal)
79 | {
80 | /* Update the maximum value and its index */
81 | out = maxVal;
82 | outIndex = blockSize - blkCnt;
83 | }
84 |
85 | /* Decrement the loop counter */
86 | blkCnt--;
87 |
88 | } while(blkCnt > 0u);
89 |
90 | #else
91 |
92 | /* Run the below code for Cortex-M0 */
93 |
94 | while(blkCnt > 0u)
95 | {
96 | /* Initialize maxVal to the next consecutive values one by one */
97 | maxVal = *pSrc++;
98 |
99 | /* Compare for the maximum value */
100 | if(out < maxVal)
101 | {
102 | /* Update the maximum value and its index */
103 | out = maxVal;
104 | outIndex = blockSize - blkCnt;
105 | }
106 |
107 | /* Decrement the loop counter */
108 | blkCnt--;
109 |
110 | }
111 |
112 | #endif /* #ifndef ARM_MATH_CM0 */
113 |
114 | /* Store the maximum value and its index into destination pointers */
115 | *pResult = out;
116 | *pIndex = outIndex;
117 | }
118 |
119 | /**
120 | * @} end of Max group
121 | */
122 |
--------------------------------------------------------------------------------
/Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_copy_f32.c:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * Copyright (C) 2010 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 15. July 2011
5 | * $Revision: V1.0.10
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_copy_f32.c
9 | *
10 | * Description: Copies the elements of a floating-point vector.
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13 | *
14 | * Version 1.0.10 2011/7/15
15 | * Big Endian support added and Merged M0 and M3/M4 Source code.
16 | *
17 | * Version 1.0.3 2010/11/29
18 | * Re-organized the CMSIS folders and updated documentation.
19 | *
20 | * Version 1.0.2 2010/11/11
21 | * Documentation updated.
22 | *
23 | * Version 1.0.1 2010/10/05
24 | * Production release and review comments incorporated.
25 | *
26 | * Version 1.0.0 2010/09/20
27 | * Production release and review comments incorporated.
28 | *
29 | * Version 0.0.7 2010/06/10
30 | * Misra-C changes done
31 | * ---------------------------------------------------------------------------- */
32 |
33 | #include "arm_math.h"
34 |
35 | /**
36 | * @ingroup groupSupport
37 | */
38 |
39 | /**
40 | * @defgroup copy Vector Copy
41 | *
42 | * Copies sample by sample from source vector to destination vector.
43 | *
44 | * 45 | * pDst[n] = pSrc[n]; 0 <= n < blockSize. 46 | *47 | * 48 | * There are separate functions for floating point, Q31, Q15, and Q7 data types. 49 | */ 50 | 51 | /** 52 | * @addtogroup copy 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @brief Copies the elements of a floating-point vector. 58 | * @param[in] *pSrc points to input vector 59 | * @param[out] *pDst points to output vector 60 | * @param[in] blockSize length of the input vector 61 | * @return none. 62 | * 63 | */ 64 | 65 | 66 | void arm_copy_f32( 67 | float32_t * pSrc, 68 | float32_t * pDst, 69 | uint32_t blockSize) 70 | { 71 | uint32_t blkCnt; /* loop counter */ 72 | 73 | #ifndef ARM_MATH_CM0 74 | 75 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 76 | 77 | /*loop Unrolling */ 78 | blkCnt = blockSize >> 2u; 79 | 80 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 81 | ** a second loop below computes the remaining 1 to 3 samples. */ 82 | while(blkCnt > 0u) 83 | { 84 | /* C = A */ 85 | /* Copy and then store the results in the destination buffer */ 86 | *pDst++ = *pSrc++; 87 | *pDst++ = *pSrc++; 88 | *pDst++ = *pSrc++; 89 | *pDst++ = *pSrc++; 90 | 91 | /* Decrement the loop counter */ 92 | blkCnt--; 93 | } 94 | 95 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 96 | ** No loop unrolling is used. */ 97 | blkCnt = blockSize % 0x4u; 98 | 99 | #else 100 | 101 | /* Run the below code for Cortex-M0 */ 102 | 103 | /* Loop over blockSize number of values */ 104 | blkCnt = blockSize; 105 | 106 | #endif /* #ifndef ARM_MATH_CM0 */ 107 | 108 | while(blkCnt > 0u) 109 | { 110 | /* C = A */ 111 | /* Copy and then store the results in the destination buffer */ 112 | *pDst++ = *pSrc++; 113 | 114 | /* Decrement the loop counter */ 115 | blkCnt--; 116 | } 117 | } 118 | 119 | /** 120 | * @} end of BasicCopy group 121 | */ 122 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_copy_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_copy_q31.c 9 | * 10 | * Description: Copies the elements of a Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * -------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @addtogroup copy 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Copies the elements of a Q31 vector. 46 | * @param[in] *pSrc points to input vector 47 | * @param[out] *pDst points to output vector 48 | * @param[in] blockSize length of the input vector 49 | * @return none. 50 | * 51 | */ 52 | 53 | void arm_copy_q31( 54 | q31_t * pSrc, 55 | q31_t * pDst, 56 | uint32_t blockSize) 57 | { 58 | uint32_t blkCnt; /* loop counter */ 59 | 60 | 61 | #ifndef ARM_MATH_CM0 62 | 63 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 64 | 65 | /*loop Unrolling */ 66 | blkCnt = blockSize >> 2u; 67 | 68 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 69 | ** a second loop below computes the remaining 1 to 3 samples. */ 70 | while(blkCnt > 0u) 71 | { 72 | /* C = A */ 73 | /* Copy and then store the values in the destination buffer */ 74 | *pDst++ = *pSrc++; 75 | *pDst++ = *pSrc++; 76 | *pDst++ = *pSrc++; 77 | *pDst++ = *pSrc++; 78 | 79 | /* Decrement the loop counter */ 80 | blkCnt--; 81 | } 82 | 83 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 84 | ** No loop unrolling is used. */ 85 | blkCnt = blockSize % 0x4u; 86 | 87 | #else 88 | 89 | /* Run the below code for Cortex-M0 */ 90 | 91 | /* Loop over blockSize number of values */ 92 | blkCnt = blockSize; 93 | 94 | #endif /* #ifndef ARM_MATH_CM0 */ 95 | 96 | while(blkCnt > 0u) 97 | { 98 | /* C = A */ 99 | /* Copy and then store the value in the destination buffer */ 100 | *pDst++ = *pSrc++; 101 | 102 | /* Decrement the loop counter */ 103 | blkCnt--; 104 | } 105 | } 106 | 107 | /** 108 | * @} end of BasicCopy group 109 | */ 110 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_copy_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_copy_q7.c 9 | * 10 | * Description: Copies the elements of a Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * -------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @addtogroup copy 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Copies the elements of a Q7 vector. 46 | * @param[in] *pSrc points to input vector 47 | * @param[out] *pDst points to output vector 48 | * @param[in] blockSize length of the input vector 49 | * @return none. 50 | * 51 | */ 52 | 53 | void arm_copy_q7( 54 | q7_t * pSrc, 55 | q7_t * pDst, 56 | uint32_t blockSize) 57 | { 58 | uint32_t blkCnt; /* loop counter */ 59 | 60 | #ifndef ARM_MATH_CM0 61 | 62 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 63 | 64 | /*loop Unrolling */ 65 | blkCnt = blockSize >> 2u; 66 | 67 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 68 | ** a second loop below computes the remaining 1 to 3 samples. */ 69 | while(blkCnt > 0u) 70 | { 71 | /* C = A */ 72 | /* Copy and then store the results in the destination buffer */ 73 | /* 4 samples are copied and stored at a time using SIMD */ 74 | *__SIMD32(pDst)++ = *__SIMD32(pSrc)++; 75 | 76 | /* Decrement the loop counter */ 77 | blkCnt--; 78 | } 79 | 80 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 81 | ** No loop unrolling is used. */ 82 | blkCnt = blockSize % 0x4u; 83 | 84 | #else 85 | 86 | /* Run the below code for Cortex-M0 */ 87 | 88 | /* Loop over blockSize number of values */ 89 | blkCnt = blockSize; 90 | 91 | #endif /* #ifndef ARM_MATH_CM0 */ 92 | 93 | 94 | while(blkCnt > 0u) 95 | { 96 | /* C = A */ 97 | /* Copy and then store the results in the destination buffer */ 98 | *pDst++ = *pSrc++; 99 | 100 | /* Decrement the loop counter */ 101 | blkCnt--; 102 | } 103 | } 104 | 105 | /** 106 | * @} end of BasicCopy group 107 | */ 108 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_fill_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_f32.c 9 | * 10 | * Description: Fills a constant value into a floating-point vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * ---------------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @defgroup Fill Vector Fill 41 | * 42 | * Fills the destination vector with a constant value. 43 | * 44 | *
45 | * pDst[n] = value; 0 <= n < blockSize. 46 | *47 | * 48 | * There are separate functions for floating point, Q31, Q15, and Q7 data types. 49 | */ 50 | 51 | /** 52 | * @addtogroup Fill 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @brief Fills a constant value into a floating-point vector. 58 | * @param[in] value input value to be filled 59 | * @param[out] *pDst points to output vector 60 | * @param[in] blockSize length of the output vector 61 | * @return none. 62 | * 63 | */ 64 | 65 | 66 | void arm_fill_f32( 67 | float32_t value, 68 | float32_t * pDst, 69 | uint32_t blockSize) 70 | { 71 | uint32_t blkCnt; /* loop counter */ 72 | 73 | #ifndef ARM_MATH_CM0 74 | 75 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 76 | 77 | /*loop Unrolling */ 78 | blkCnt = blockSize >> 2u; 79 | 80 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 81 | ** a second loop below computes the remaining 1 to 3 samples. */ 82 | while(blkCnt > 0u) 83 | { 84 | /* C = value */ 85 | /* Fill the value in the destination buffer */ 86 | *pDst++ = value; 87 | *pDst++ = value; 88 | *pDst++ = value; 89 | *pDst++ = value; 90 | 91 | /* Decrement the loop counter */ 92 | blkCnt--; 93 | } 94 | 95 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 96 | ** No loop unrolling is used. */ 97 | blkCnt = blockSize % 0x4u; 98 | 99 | #else 100 | 101 | /* Run the below code for Cortex-M0 */ 102 | 103 | /* Loop over blockSize number of values */ 104 | blkCnt = blockSize; 105 | 106 | #endif /* #ifndef ARM_MATH_CM0 */ 107 | 108 | 109 | while(blkCnt > 0u) 110 | { 111 | /* C = value */ 112 | /* Fill the value in the destination buffer */ 113 | *pDst++ = value; 114 | 115 | /* Decrement the loop counter */ 116 | blkCnt--; 117 | } 118 | } 119 | 120 | /** 121 | * @} end of Fill group 122 | */ 123 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_fill_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q15.c 9 | * 10 | * Description: Fills a constant value into a Q15 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * -------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @addtogroup Fill 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Fills a constant value into a Q15 vector. 46 | * @param[in] value input value to be filled 47 | * @param[out] *pDst points to output vector 48 | * @param[in] blockSize length of the output vector 49 | * @return none. 50 | * 51 | */ 52 | 53 | void arm_fill_q15( 54 | q15_t value, 55 | q15_t * pDst, 56 | uint32_t blockSize) 57 | { 58 | uint32_t blkCnt; /* loop counter */ 59 | 60 | #ifndef ARM_MATH_CM0 61 | 62 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 63 | 64 | q31_t packedValue; /* value packed to 32 bits */ 65 | 66 | 67 | /*loop Unrolling */ 68 | blkCnt = blockSize >> 2u; 69 | 70 | /* Packing two 16 bit values to 32 bit value in order to use SIMD */ 71 | packedValue = __PKHBT(value, value, 16u); 72 | 73 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 74 | ** a second loop below computes the remaining 1 to 3 samples. */ 75 | while(blkCnt > 0u) 76 | { 77 | /* C = value */ 78 | /* Fill the value in the destination buffer */ 79 | *__SIMD32(pDst)++ = packedValue; 80 | *__SIMD32(pDst)++ = packedValue; 81 | 82 | /* Decrement the loop counter */ 83 | blkCnt--; 84 | } 85 | 86 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 87 | ** No loop unrolling is used. */ 88 | blkCnt = blockSize % 0x4u; 89 | 90 | #else 91 | 92 | /* Run the below code for Cortex-M0 */ 93 | 94 | /* Loop over blockSize number of values */ 95 | blkCnt = blockSize; 96 | 97 | #endif /* #ifndef ARM_MATH_CM0 */ 98 | 99 | while(blkCnt > 0u) 100 | { 101 | /* C = value */ 102 | /* Fill the value in the destination buffer */ 103 | *pDst++ = value; 104 | 105 | /* Decrement the loop counter */ 106 | blkCnt--; 107 | } 108 | } 109 | 110 | /** 111 | * @} end of Fill group 112 | */ 113 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_fill_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q31.c 9 | * 10 | * Description: Fills a constant value into a Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * -------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @addtogroup Fill 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Fills a constant value into a Q31 vector. 46 | * @param[in] value input value to be filled 47 | * @param[out] *pDst points to output vector 48 | * @param[in] blockSize length of the output vector 49 | * @return none. 50 | * 51 | */ 52 | 53 | void arm_fill_q31( 54 | q31_t value, 55 | q31_t * pDst, 56 | uint32_t blockSize) 57 | { 58 | uint32_t blkCnt; /* loop counter */ 59 | 60 | 61 | #ifndef ARM_MATH_CM0 62 | 63 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 64 | 65 | /*loop Unrolling */ 66 | blkCnt = blockSize >> 2u; 67 | 68 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 69 | ** a second loop below computes the remaining 1 to 3 samples. */ 70 | while(blkCnt > 0u) 71 | { 72 | /* C = value */ 73 | /* Fill the value in the destination buffer */ 74 | *pDst++ = value; 75 | *pDst++ = value; 76 | *pDst++ = value; 77 | *pDst++ = value; 78 | 79 | /* Decrement the loop counter */ 80 | blkCnt--; 81 | } 82 | 83 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 84 | ** No loop unrolling is used. */ 85 | blkCnt = blockSize % 0x4u; 86 | 87 | #else 88 | 89 | /* Run the below code for Cortex-M0 */ 90 | 91 | /* Loop over blockSize number of values */ 92 | blkCnt = blockSize; 93 | 94 | #endif /* #ifndef ARM_MATH_CM0 */ 95 | 96 | while(blkCnt > 0u) 97 | { 98 | /* C = value */ 99 | /* Fill the value in the destination buffer */ 100 | *pDst++ = value; 101 | 102 | /* Decrement the loop counter */ 103 | blkCnt--; 104 | } 105 | } 106 | 107 | /** 108 | * @} end of Fill group 109 | */ 110 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_fill_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fill_q7.c 9 | * 10 | * Description: Fills a constant value into a Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * 29 | * Version 0.0.7 2010/06/10 30 | * Misra-C changes done 31 | * -------------------------------------------------------------------- */ 32 | 33 | #include "arm_math.h" 34 | 35 | /** 36 | * @ingroup groupSupport 37 | */ 38 | 39 | /** 40 | * @addtogroup Fill 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Fills a constant value into a Q7 vector. 46 | * @param[in] value input value to be filled 47 | * @param[out] *pDst points to output vector 48 | * @param[in] blockSize length of the output vector 49 | * @return none. 50 | * 51 | */ 52 | 53 | void arm_fill_q7( 54 | q7_t value, 55 | q7_t * pDst, 56 | uint32_t blockSize) 57 | { 58 | uint32_t blkCnt; /* loop counter */ 59 | 60 | #ifndef ARM_MATH_CM0 61 | 62 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 63 | 64 | q31_t packedValue; /* value packed to 32 bits */ 65 | 66 | /*loop Unrolling */ 67 | blkCnt = blockSize >> 2u; 68 | 69 | /* Packing four 8 bit values to 32 bit value in order to use SIMD */ 70 | packedValue = __PACKq7(value, value, value, value); 71 | 72 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 73 | ** a second loop below computes the remaining 1 to 3 samples. */ 74 | while(blkCnt > 0u) 75 | { 76 | /* C = value */ 77 | /* Fill the value in the destination buffer */ 78 | *__SIMD32(pDst)++ = packedValue; 79 | 80 | /* Decrement the loop counter */ 81 | blkCnt--; 82 | } 83 | 84 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 85 | ** No loop unrolling is used. */ 86 | blkCnt = blockSize % 0x4u; 87 | 88 | #else 89 | 90 | /* Run the below code for Cortex-M0 */ 91 | 92 | /* Loop over blockSize number of values */ 93 | blkCnt = blockSize; 94 | 95 | #endif /* #ifndef ARM_MATH_CM0 */ 96 | 97 | while(blkCnt > 0u) 98 | { 99 | /* C = value */ 100 | /* Fill the value in the destination buffer */ 101 | *pDst++ = value; 102 | 103 | /* Decrement the loop counter */ 104 | blkCnt--; 105 | } 106 | } 107 | 108 | /** 109 | * @} end of Fill group 110 | */ 111 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_q15_to_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q15_to_q31.c 9 | * 10 | * Description: Converts the elements of the Q15 vector to Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * ---------------------------------------------------------------------------- */ 29 | 30 | #include "arm_math.h" 31 | 32 | /** 33 | * @ingroup groupSupport 34 | */ 35 | 36 | /** 37 | * @addtogroup q15_to_x 38 | * @{ 39 | */ 40 | 41 | /** 42 | * @brief Converts the elements of the Q15 vector to Q31 vector. 43 | * @param[in] *pSrc points to the Q15 input vector 44 | * @param[out] *pDst points to the Q31 output vector 45 | * @param[in] blockSize length of the input vector 46 | * @return none. 47 | * 48 | * \par Description: 49 | * 50 | * The equation used for the conversion process is: 51 | * 52 | *
53 | * pDst[n] = (q31_t) pSrc[n] << 16; 0 <= n < blockSize. 54 | *55 | * 56 | */ 57 | 58 | 59 | void arm_q15_to_q31( 60 | q15_t * pSrc, 61 | q31_t * pDst, 62 | uint32_t blockSize) 63 | { 64 | q15_t *pIn = pSrc; /* Src pointer */ 65 | uint32_t blkCnt; /* loop counter */ 66 | 67 | #ifndef ARM_MATH_CM0 68 | 69 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 70 | 71 | /*loop Unrolling */ 72 | blkCnt = blockSize >> 2u; 73 | 74 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 75 | ** a second loop below computes the remaining 1 to 3 samples. */ 76 | while(blkCnt > 0u) 77 | { 78 | /* C = (q31_t)A << 16 */ 79 | /* convert from q15 to q31 and then store the results in the destination buffer */ 80 | *pDst++ = (q31_t) * pIn++ << 16; 81 | *pDst++ = (q31_t) * pIn++ << 16; 82 | *pDst++ = (q31_t) * pIn++ << 16; 83 | *pDst++ = (q31_t) * pIn++ << 16; 84 | 85 | /* Decrement the loop counter */ 86 | blkCnt--; 87 | } 88 | 89 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 90 | ** No loop unrolling is used. */ 91 | blkCnt = blockSize % 0x4u; 92 | 93 | #else 94 | 95 | /* Run the below code for Cortex-M0 */ 96 | 97 | /* Loop over blockSize number of values */ 98 | blkCnt = blockSize; 99 | 100 | #endif /* #ifndef ARM_MATH_CM0 */ 101 | 102 | while(blkCnt > 0u) 103 | { 104 | /* C = (q31_t)A << 16 */ 105 | /* convert from q15 to q31 and then store the results in the destination buffer */ 106 | *pDst++ = (q31_t) * pIn++ << 16; 107 | 108 | /* Decrement the loop counter */ 109 | blkCnt--; 110 | } 111 | 112 | } 113 | 114 | /** 115 | * @} end of q15_to_x group 116 | */ 117 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_q15_to_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q15_to_q7.c 9 | * 10 | * Description: Converts the elements of the Q15 vector to Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * ---------------------------------------------------------------------------- */ 29 | 30 | #include "arm_math.h" 31 | 32 | /** 33 | * @ingroup groupSupport 34 | */ 35 | 36 | /** 37 | * @addtogroup q15_to_x 38 | * @{ 39 | */ 40 | 41 | 42 | /** 43 | * @brief Converts the elements of the Q15 vector to Q7 vector. 44 | * @param[in] *pSrc points to the Q15 input vector 45 | * @param[out] *pDst points to the Q7 output vector 46 | * @param[in] blockSize length of the input vector 47 | * @return none. 48 | * 49 | * \par Description: 50 | * 51 | * The equation used for the conversion process is: 52 | * 53 | *
54 | * pDst[n] = (q7_t) pSrc[n] >> 8; 0 <= n < blockSize. 55 | *56 | * 57 | */ 58 | 59 | 60 | void arm_q15_to_q7( 61 | q15_t * pSrc, 62 | q7_t * pDst, 63 | uint32_t blockSize) 64 | { 65 | q15_t *pIn = pSrc; /* Src pointer */ 66 | uint32_t blkCnt; /* loop counter */ 67 | 68 | #ifndef ARM_MATH_CM0 69 | 70 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 71 | 72 | /*loop Unrolling */ 73 | blkCnt = blockSize >> 2u; 74 | 75 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 76 | ** a second loop below computes the remaining 1 to 3 samples. */ 77 | while(blkCnt > 0u) 78 | { 79 | /* C = (q7_t) A >> 8 */ 80 | /* convert from q15 to q7 and then store the results in the destination buffer */ 81 | *pDst++ = (q7_t) (*pIn++ >> 8); 82 | *pDst++ = (q7_t) (*pIn++ >> 8); 83 | *pDst++ = (q7_t) (*pIn++ >> 8); 84 | *pDst++ = (q7_t) (*pIn++ >> 8); 85 | 86 | /* Decrement the loop counter */ 87 | blkCnt--; 88 | } 89 | 90 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 91 | ** No loop unrolling is used. */ 92 | blkCnt = blockSize % 0x4u; 93 | 94 | #else 95 | 96 | /* Run the below code for Cortex-M0 */ 97 | 98 | /* Loop over blockSize number of values */ 99 | blkCnt = blockSize; 100 | 101 | #endif /* #ifndef ARM_MATH_CM0 */ 102 | 103 | while(blkCnt > 0u) 104 | { 105 | /* C = (q7_t) A >> 8 */ 106 | /* convert from q15 to q7 and then store the results in the destination buffer */ 107 | *pDst++ = (q7_t) (*pIn++ >> 8); 108 | 109 | /* Decrement the loop counter */ 110 | blkCnt--; 111 | } 112 | 113 | } 114 | 115 | /** 116 | * @} end of q15_to_x group 117 | */ 118 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_q31_to_q7.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q31_to_q7.c 9 | * 10 | * Description: Converts the elements of the Q31 vector to Q7 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * ---------------------------------------------------------------------------- */ 29 | 30 | #include "arm_math.h" 31 | 32 | /** 33 | * @ingroup groupSupport 34 | */ 35 | 36 | /** 37 | * @addtogroup q31_to_x 38 | * @{ 39 | */ 40 | 41 | /** 42 | * @brief Converts the elements of the Q31 vector to Q7 vector. 43 | * @param[in] *pSrc points to the Q31 input vector 44 | * @param[out] *pDst points to the Q7 output vector 45 | * @param[in] blockSize length of the input vector 46 | * @return none. 47 | * 48 | * \par Description: 49 | * 50 | * The equation used for the conversion process is: 51 | * 52 | *
53 | * pDst[n] = (q7_t) pSrc[n] >> 24; 0 <= n < blockSize. 54 | *55 | * 56 | */ 57 | 58 | 59 | void arm_q31_to_q7( 60 | q31_t * pSrc, 61 | q7_t * pDst, 62 | uint32_t blockSize) 63 | { 64 | q31_t *pIn = pSrc; /* Src pointer */ 65 | uint32_t blkCnt; /* loop counter */ 66 | 67 | #ifndef ARM_MATH_CM0 68 | 69 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 70 | 71 | /*loop Unrolling */ 72 | blkCnt = blockSize >> 2u; 73 | 74 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 75 | ** a second loop below computes the remaining 1 to 3 samples. */ 76 | while(blkCnt > 0u) 77 | { 78 | /* C = (q7_t) A >> 24 */ 79 | /* convert from q31 to q7 and then store the results in the destination buffer */ 80 | *pDst++ = (q7_t) (*pIn++ >> 24); 81 | *pDst++ = (q7_t) (*pIn++ >> 24); 82 | *pDst++ = (q7_t) (*pIn++ >> 24); 83 | *pDst++ = (q7_t) (*pIn++ >> 24); 84 | 85 | /* Decrement the loop counter */ 86 | blkCnt--; 87 | } 88 | 89 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 90 | ** No loop unrolling is used. */ 91 | blkCnt = blockSize % 0x4u; 92 | 93 | #else 94 | 95 | /* Run the below code for Cortex-M0 */ 96 | 97 | /* Loop over blockSize number of values */ 98 | blkCnt = blockSize; 99 | 100 | #endif /* #ifndef ARM_MATH_CM0 */ 101 | 102 | while(blkCnt > 0u) 103 | { 104 | /* C = (q7_t) A >> 24 */ 105 | /* convert from q31 to q7 and then store the results in the destination buffer */ 106 | *pDst++ = (q7_t) (*pIn++ >> 24); 107 | 108 | /* Decrement the loop counter */ 109 | blkCnt--; 110 | } 111 | 112 | } 113 | 114 | /** 115 | * @} end of q31_to_x group 116 | */ 117 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_q7_to_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q7_to_q15.c 9 | * 10 | * Description: Converts the elements of the Q7 vector to Q15 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * ---------------------------------------------------------------------------- */ 29 | 30 | #include "arm_math.h" 31 | 32 | /** 33 | * @ingroup groupSupport 34 | */ 35 | 36 | /** 37 | * @addtogroup q7_to_x 38 | * @{ 39 | */ 40 | 41 | 42 | 43 | 44 | /** 45 | * @brief Converts the elements of the Q7 vector to Q15 vector. 46 | * @param[in] *pSrc points to the Q7 input vector 47 | * @param[out] *pDst points to the Q15 output vector 48 | * @param[in] blockSize length of the input vector 49 | * @return none. 50 | * 51 | * \par Description: 52 | * 53 | * The equation used for the conversion process is: 54 | * 55 | *
56 | * pDst[n] = (q15_t) pSrc[n] << 8; 0 <= n < blockSize. 57 | *58 | * 59 | */ 60 | 61 | 62 | void arm_q7_to_q15( 63 | q7_t * pSrc, 64 | q15_t * pDst, 65 | uint32_t blockSize) 66 | { 67 | q7_t *pIn = pSrc; /* Src pointer */ 68 | uint32_t blkCnt; /* loop counter */ 69 | 70 | #ifndef ARM_MATH_CM0 71 | 72 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 73 | 74 | /*loop Unrolling */ 75 | blkCnt = blockSize >> 2u; 76 | 77 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 78 | ** a second loop below computes the remaining 1 to 3 samples. */ 79 | while(blkCnt > 0u) 80 | { 81 | /* C = (q15_t) A << 8 */ 82 | /* convert from q7 to q15 and then store the results in the destination buffer */ 83 | *pDst++ = (q15_t) * pIn++ << 8; 84 | *pDst++ = (q15_t) * pIn++ << 8; 85 | *pDst++ = (q15_t) * pIn++ << 8; 86 | *pDst++ = (q15_t) * pIn++ << 8; 87 | 88 | /* Decrement the loop counter */ 89 | blkCnt--; 90 | } 91 | 92 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 93 | ** No loop unrolling is used. */ 94 | blkCnt = blockSize % 0x4u; 95 | 96 | #else 97 | 98 | /* Run the below code for Cortex-M0 */ 99 | 100 | /* Loop over blockSize number of values */ 101 | blkCnt = blockSize; 102 | 103 | #endif /* #ifndef ARM_MATH_CM0 */ 104 | 105 | while(blkCnt > 0u) 106 | { 107 | /* C = (q15_t) A << 8 */ 108 | /* convert from q7 to q15 and then store the results in the destination buffer */ 109 | *pDst++ = (q15_t) * pIn++ << 8; 110 | 111 | /* Decrement the loop counter */ 112 | blkCnt--; 113 | } 114 | 115 | } 116 | 117 | /** 118 | * @} end of q7_to_x group 119 | */ 120 | -------------------------------------------------------------------------------- /Libraries/CMSIS/DSP_Lib/Source/SupportFunctions/arm_q7_to_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 15. July 2011 5 | * $Revision: V1.0.10 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_q7_to_q31.c 9 | * 10 | * Description: Converts the elements of the Q7 vector to Q31 vector. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Version 1.0.10 2011/7/15 15 | * Big Endian support added and Merged M0 and M3/M4 Source code. 16 | * 17 | * Version 1.0.3 2010/11/29 18 | * Re-organized the CMSIS folders and updated documentation. 19 | * 20 | * Version 1.0.2 2010/11/11 21 | * Documentation updated. 22 | * 23 | * Version 1.0.1 2010/10/05 24 | * Production release and review comments incorporated. 25 | * 26 | * Version 1.0.0 2010/09/20 27 | * Production release and review comments incorporated. 28 | * ---------------------------------------------------------------------------- */ 29 | 30 | #include "arm_math.h" 31 | 32 | /** 33 | * @ingroup groupSupport 34 | */ 35 | 36 | /** 37 | * @addtogroup q7_to_x 38 | * @{ 39 | */ 40 | 41 | /** 42 | * @brief Converts the elements of the Q7 vector to Q31 vector. 43 | * @param[in] *pSrc points to the Q7 input vector 44 | * @param[out] *pDst points to the Q31 output vector 45 | * @param[in] blockSize length of the input vector 46 | * @return none. 47 | * 48 | * \par Description: 49 | * 50 | * The equation used for the conversion process is: 51 | * 52 | *
53 | * pDst[n] = (q31_t) pSrc[n] << 24; 0 <= n < blockSize. 54 | *55 | * 56 | */ 57 | 58 | 59 | void arm_q7_to_q31( 60 | q7_t * pSrc, 61 | q31_t * pDst, 62 | uint32_t blockSize) 63 | { 64 | q7_t *pIn = pSrc; /* Src pointer */ 65 | uint32_t blkCnt; /* loop counter */ 66 | 67 | #ifndef ARM_MATH_CM0 68 | 69 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 70 | 71 | /*loop Unrolling */ 72 | blkCnt = blockSize >> 2u; 73 | 74 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 75 | ** a second loop below computes the remaining 1 to 3 samples. */ 76 | while(blkCnt > 0u) 77 | { 78 | /* C = (q31_t) A << 24 */ 79 | /* convert from q7 to q31 and then store the results in the destination buffer */ 80 | *pDst++ = (q31_t) * pIn++ << 24; 81 | *pDst++ = (q31_t) * pIn++ << 24; 82 | *pDst++ = (q31_t) * pIn++ << 24; 83 | *pDst++ = (q31_t) * pIn++ << 24; 84 | 85 | /* Decrement the loop counter */ 86 | blkCnt--; 87 | } 88 | 89 | /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 90 | ** No loop unrolling is used. */ 91 | blkCnt = blockSize % 0x4u; 92 | 93 | #else 94 | 95 | /* Run the below code for Cortex-M0 */ 96 | 97 | /* Loop over blockSize number of values */ 98 | blkCnt = blockSize; 99 | 100 | #endif /* #ifndef ARM_MATH_CM0 */ 101 | 102 | while(blkCnt > 0u) 103 | { 104 | /* C = (q31_t) A << 24 */ 105 | /* convert from q7 to q31 and then store the results in the destination buffer */ 106 | *pDst++ = (q31_t) * pIn++ << 24; 107 | 108 | /* Decrement the loop counter */ 109 | blkCnt--; 110 | } 111 | 112 | } 113 | 114 | /** 115 | * @} end of q7_to_x group 116 | */ 117 | -------------------------------------------------------------------------------- /Libraries/CMSIS/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern uint16_t armBitRevTable[256]; 30 | extern q15_t armRecipTableQ15[64]; 31 | extern q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | 35 | #endif /* ARM_COMMON_TABLES_H */ 36 | -------------------------------------------------------------------------------- /Libraries/CMSIS/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011 ARM Limited. All rights reserved. 3 | * 4 | * Date: 25 July 2011 5 | * Revision: V2.10 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Binaries 34 | --- -------------------------------------------------------------------------------- /Libraries/CMSIS/ST/STM32F4xx/Include/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.0.0 6 | * @date 30-September-2011 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *