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.

How to modify the filter output if only first half of filter coefficients are used for filtering the signal

Hello,

I have been working from long time to implement the digital fitler with CCS and I need help in modifying the fitler output.

I am scaling the filter coefficients obtained from matlab by a factor of 2^15=32768.Then I am only using the first half of the filter coefficients to filter the signal.

But how to modify the result obtained from this filter function.I mean should I divide the filter output with the number of the second of filter coefficeints or anything else is needed.

can someone give any suggestions.Thanks.

  • Stefan,

    Go back to MatLab and regenerate the coefficients to implement the length of filter that you want to actually run.

    Arbitrarily dropping some of the coefficients could have a large effect on your filter results by changing the overall gain of the system. But that might not be the case in every filter. So if you do not know the science behind the filter design and the filter order, it is best to go back to MatLab where the science is embedded in the calculations.

    Regards,
    RandyP

  • Hello Randy,

    I designed the lowpass filter with cutoff frequency of 4Hz (correct me if the filter designed is wrong itself) in matlab as shown below 

    d = fdesign.lowpass('N,Fc',31,4,100);
    Hd1 = design(d);
    coef=Hd1.Numerator;

    Fitler coefficients are 

    [-0.0012   -0.0010   -0.0007    0.0000    0.0017    0.0047    0.0094  0.0160    0.0244    0.0344    0.0454    0.0565        0.0670     0.0758   0.0822      0.0856    0.0856    0.0822    0.0758  0.0670    0.0565    0.0454    0.0344    0.0244    0.0160    0.0094    0.0047       0.0017     0.0000   -0.0007   -0.0010   -0.0012]

    Can I know how to use(or modify) these filter coefficients to implement digital filter with microcontroller.

    And I will check this filter behaviour by feeding a pulse signal form fucntion generator which will varied(manually) form 2Hz to 6Hz .

  • Hi Stefan,

    Thanks for your post. In my opinion, MATLAB would be the best optimizing tool to tune the filter coefficients and by the way, you should try to optimize in such a way that, it should use the complete filter coefficients to filter the signal to have better quality output.

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------
     

     

  • Thanks Sivaraj Kuppuraj  but you didn't answered my question.