Skip to main content
Niyathi Shenoy
Associate III
May 7, 2018
Question

Hi, I am trying to implement a low pass filter with cut off frequency 50kHz by using stm32f407. I sthere a document or a guide or manual that will help me to do the same?

  • May 7, 2018
  • 2 replies
  • 1111 views
Posted on May 07, 2018 at 09:09

I want to implement a low pass filter with cutoff frequency 50 kHz. How do I go about? I have gone through the example. But its not very clear.

    This topic has been closed for replies.

    2 replies

    waclawek.jan
    Super User
    May 7, 2018
    Posted on May 07, 2018 at 11:02

    Which example? What is not clear in it?

    JW

    Niyathi Shenoy
    Associate III
    May 7, 2018
    Posted on May 07, 2018 at 11:39

    Hi the example is arm_fir_example which is there in the following path:

    C:\Keil_v5\ARM\CMSIS\DSP_Lib\Examples\arm_fir_example.

    In this example they have done the following:

    The input signal is a sum of two sine waves: 1 kHz and 15 kHz.

    * This is processed by an FIR lowpass filter with cutoff frequency 6 kHz.

    * The lowpass filter eliminates the 15 kHz signal leaving only the 1 kHz sine wave at the output.

    The thing that is not clear is regarding the FIR coefficients generated.

    They are using fir1() MATLAB function.

    ** fir1(28, 6/24) ,then storing the generated coefficients in the following buffer:

    const float32_t firCoeffs32[NUM_TAPS] = {

    -0.0018225230f, -0.0015879294f, +0.0000000000f, +0.0036977508f, +0.0080754303f, +0.0085302217f, -0.0000000000f, -0.0173976984f,

    -0.0341458607f, -0.0333591565f, +0.0000000000f, +0.0676308395f, +0.1522061835f, +0.2229246956f, +0.2504960933f, +0.2229246956f,

    +0.1522061835f, +0.0676308395f, +0.0000000000f, -0.0333591565f, -0.0341458607f, -0.0173976984f, -0.0000000000f, +0.0085302217f,

    +0.0080754303f, +0.0036977508f, +0.0000000000f, -0.0015879294f, -0.0018225230f

    };

    However, if my input signal is different each time, how will i generate the FIR filter coefficients.

    AvaTar
    Senior III
    May 7, 2018
    Posted on May 07, 2018 at 12:13

    However, if my input signal is different each time, how will i generate the FIR filter coefficients.

    Not sure if you understand the topic. Of course the input data will change continuously, that's what it's about.

    You change filter coefficients if you want different parameters, like another cutoff frequency.

    Hi the example is arm_fir_example which is there in the following path:

    C:\Keil_v5\ARM\CMSIS\DSP_Lib\Examples\arm_fir_example.

    This is an example from ARM, and describes the same. It is not a FIR/IIR filter tutorial.