DSPRelated.com
Forums

High pass filtering 150hz

Started by habe...@tqautomation.com February 11, 2011
hi, i am not able to block a 150 hz sine wave from my audio by using a high pass filter , i have obtained the filter coefficients from LABVIEW.

can anyone help me in this please. below is the code and the filter coefficients.

short squelch_hpf_taps[SQUELCH_HPF_ORDER] = {6,2,3,3,2,2,1,0,-2,-4,-6,-7, -9,-11,-11,-12,-11,-10,-8,-4,0,5,11,16,22,27,31,34,35, 33, 30,23,15,4,-9, -22,-37,-51,-63,-73,-80,-83,-80,-73,-59,-41,-18,9,39,70,100, 127,150,166, 173,171,157,133,98,53,0,-59,-120,-181,-238,-285,-321,-341,-343,-324,-283, -220,-137,-37,78,201,326,446,555,643,703,728,713,651,540,379,167,-91,-392, -728,-1091,-1471,-1855,-2233,-2591,-2918,-3203,-3436,-3608,-3714,46250, -3714,-3608,-3436,-3203,-2918,-2591,-2233,-1855,-1471,-1091,-728,-392,-91, 167,379,540,651,713,728,703,643,555,446,326,201,78,-37,-137,-220,-283,-324,-343,-341,-321,-285,-238,-181,-120,-59,0,53,98,133,157,171,173,166,150,127,100,70,39,9,-18,-41,-59,-73,-80,-83,-105,-96,-83,-66,-48,-29,-11,5,19,31, 39,44,45,44,41,35,29,21,14,7,0,-6,-10,-13,-15,-15,-15,-14,-12,-10,-7,-5,-3,-1,1,2,3,3,3,3,12 };

//Buffer for filter calculation using fir2 dsplib function
short squelch_hpf_buffer[SQUELCH_HPF_ORDER+2];

fir(input, squelch_hpf_taps, input, squelch_hpf_buffer, buffersize, SQUELCH_HPF_ORDER);
thanks

HAbeeb
Hi,
Please make sure that your coefficient are right bcoz No of coefficient
are too many,try with NI.

// fir(input, squelch_hpf_taps, input, squelch_hpf_buffer, buffersize,
Also take different buffer for your o/p.

Regards
Pankaj Rawat

> hi, i am not able to block a 150 hz sine wave from my audio by using a
> high pass filter , i have obtained the filter coefficients from LABVIEW.
>
> can anyone help me in this please. below is the code and the filter
> coefficients.
>
> short squelch_hpf_taps[SQUELCH_HPF_ORDER] = {6,2,3,3,2,2,1,0,-2,-4,-6,-7,
> -9,-11,-11,-12,-11,-10,-8,-4,0,5,11,16,22,27,31,34,35, 33, 30,23,15,4,-9,
> -22,-37,-51,-63,-73,-80,-83,-80,-73,-59,-41,-18,9,39,70,100, 127,150,166,
> 173,171,157,133,98,53,0,-59,-120,-181,-238,-285,-321,-341,-343,-324,-283,
> -220,-137,-37,78,201,326,446,555,643,703,728,713,651,540,379,167,-91,-392,
> -728,-1091,-1471,-1855,-2233,-2591,-2918,-3203,-3436,-3608,-3714,46250,
> -3714,-3608,-3436,-3203,-2918,-2591,-2233,-1855,-1471,-1091,-728,-392,-91,
> 167,379,540,651,713,728,703,643,555,446,326,201,78,-37,-137,-220,-283,-324,-343,-341,-321,-285,-238,-181,-120,-59,0,53,98,133,157,171,173,166,150,127,100,70,39,9,-18,-41,-59,-73,-80,-83,-105,-96,-83,-66,-48,-29,-11,5,19,31,
> 39,44,45,44,41,35,29,21,14,7,0,-6,-10,-13,-15,-15,-15,-14,-12,-10,-7,-5,-3,-1,1,2,3,3,3,3,12
> };
>
> //Buffer for filter calculation using fir2 dsplib function
> short squelch_hpf_buffer[SQUELCH_HPF_ORDER+2];
>
> fir(input, squelch_hpf_taps, input, squelch_hpf_buffer, buffersize,
> SQUELCH_HPF_ORDER);
> thanks
>
> HAbeeb
>
Hi Pankaj,

Thanks. I tried with 29 coefficients, it worked.
Thanks once again.

Best Regards
Habeeb