This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: MSP432 uses CMSIS function library and arm_fir_q15 function. In this function filter, why is the result of input signal? Has anyone ever used this function? Can you enlighten me? Is there a routine of this function? Thanks

Part Number: MSP432P401R

Tool/software: Code Composer Studio

MSP432 uses CMSIS function library and arm_fir_q15 function. In this function filter, why is the result of input signal? Has anyone ever used this function? Can you enlighten me? Is there a routine of this function? Thanks

  • Hello Forum User,

    I would suggest that you first read the CMSIS DSP Support Page to understand the functions of CMSIS Library.

    arm-software.github.io/.../group__FIRLPF.html
  • Hello,

    I apologize but I did not understand the question. Are you asking us where the output of "arm_fir_q15" function is stored? I haven't used CMSIS DSPLib so far, but does the documentation of the CMSIS DSPLib not mention this information?

    Thanks,
    Sai
  • Do you have a routine for this function? Can I have one, please? Thanks
  • Do you have a routine for this function? Can I have one, please? Thanksc
  • Hello Forum User,

    Did you check the link I sent earlier and the associated example provided by ARM?
  • I can call the arm_fir_f32 function, but I still can't call the arm_fir_q15 program correctly.
  • Hello Forum User,

    Can you please post a code snippet and using the snippet elaborate on what is not working?
  • this is my code.
    #include "driverlib.h"
    #include <stdint.h>
    #include <stdbool.h>
    #include "arm_math.h"
    #include "arm_const_structs.h"
    #define TEST_LENGTH_SAMPLES 320
    #define BLOCK_SIZE 320
    #define NUM_TAPS 28
    uint32_t blockSize = BLOCK_SIZE;
    uint32_t numBlocks = TEST_LENGTH_SAMPLES/BLOCK_SIZE; /
    static int16_t testInput_q15_50Hz_200Hz[TEST_LENGTH_SAMPLES]={0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40,0,40,38,7,0,32,61,45,0,-21,0,21,0,-45,-61,-32,0,-7,-38,-40}; /* 采样点 */
    static int16_t testOutput[TEST_LENGTH_SAMPLES];
    static int16_t firStateF32[BLOCK_SIZE + NUM_TAPS -1];
    int16_t firCoeffs32LP[NUM_TAPS] = {0,0,0,1,1,1,-1,-3,-5,-3,4,14,24,31,31,24,14,4,-3,-5,-3,-1,1,1,1,0,0,0};
    static void arm_fir_q15_lp(void)
    {
    arm_fir_instance_q15 S;
    arm_fir_init_q15(&S,NUM_TAPS, &firCoeffs32LP, &firStateF32, blockSize);

    arm_fir_q15(&S,&testInput_q15_50Hz_200Hz,&testOutput, blockSize);
    }
    void main(void)
    {
    /* Stop Watchdog */
    MAP_WDT_A_holdTimer();
    arm_fir_q15_lp();
    while(1);
    }
    Low frequency filtering, fs=1000Hz, fc=125Hz for sinusoidal signal with frequency of 50Hz and 200Hz.
    The output is wrong, and it doesn't play the role of filtering.
  • Thank you very much.
  • Hello Forum User

    From where did you generate the Coefficients for the FIR? I use MatLab program to generate the Tap values and I do not see an issue. Also if you look at the example in the link I sent to you, the blocks have to be run through the FIR filter. In your case you have not done anything like that. Please check the URL I sent you to first correct the code.
  • Hello Forum user

    Was the issue resolved?

**Attention** This is a public forum