00001 /*----------------------------------------------------------------------------- 00002 * Copyright (C) 2011 ARM Limited. All rights reserved. 00003 * 00004 * $Date: 15. December 2011 00005 * $Revision: V2.0.0 00006 * 00007 * Project: Cortex-R DSP Library 00008 * Title: arm_lms_norm_init_q15.c 00009 * 00010 * Description: Q15 NLMS initialization function. 00011 * 00012 * Target Processor: Cortex-R4/R5 00013 * 00014 * Version 1.0.0 2011/03/08 00015 * Alpha release. 00016 * 00017 * Version 1.0.1 2011/09/30 00018 * Beta release. 00019 * 00020 * Version 2.0.0 2011/12/15 00021 * Final release. 00022 * 00023 * ---------------------------------------------------------------------------*/ 00024 #include "arm_math.h" 00025 #include "arm_common_tables.h" 00026 00055 void arm_lms_norm_init_q15( 00056 arm_lms_norm_instance_q15 * S, 00057 uint16_t numTaps, 00058 q15_t * pCoeffs, 00059 q15_t * pState, 00060 q15_t mu, 00061 uint32_t blockSize, 00062 uint8_t postShift) 00063 { 00064 /* Assign filter taps */ 00065 S->numTaps = numTaps; 00066 00067 /* Assign coefficient pointer */ 00068 S->pCoeffs = pCoeffs; 00069 00070 /* Clear state buffer and size is always blockSize + numTaps - 1 */ 00071 memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(q15_t)); 00072 00073 /* Assign post Shift value applied to coefficients */ 00074 S->postShift = postShift; 00075 00076 /* Assign state pointer */ 00077 S->pState = pState; 00078 00079 /* Assign Step size value */ 00080 S->mu = mu; 00081 00082 /* Initialize reciprocal pointer table */ 00083 S->recipTable = armRecipTableQ15; 00084 00085 /* Initialise Energy to zero */ 00086 S->energy = 0; 00087 00088 /* Initialise x0 to zero */ 00089 S->x0 = 0; 00090 00091 } 00092
1.7.2