General Forums >> General Programming

Pages: 1
c_martins5



Reged: Apr 15 2005
Posts: 2
HIGH PASS FILTER!!!
      #16822 - Fri Apr 15 2005 12:14 PM

Hi,
I have a project that has a 10 Hz signal and a 100Hz signal. I need a high pass filtering algorithm to take out the 10 Hz signal, Anyone any ideas how this can be done,
Mike


Post Extras: Print Post   Remind Me!   Notify Moderator  
John Payson

****

Reged: Oct 16 2003
Posts: 1098
Re: HIGH PASS FILTER!!! [Re: c_martins5]
      #16824 - Fri Apr 15 2005 01:13 PM

Quote:

I have a project that has a 10 Hz signal and a 100Hz signal. I need a high pass filtering algorithm to take out the 10 Hz signal, Anyone any ideas how this can be done,




How constant is the 10Hz signal? If it's consistent and precise, you may want to to use a notch-reject filter instead of a high-pass filter, since a notch-reject filter can be constructed to have minimal phase distortion for anything other than the frequency of interest.

One of the things that is unfortunately missing in the C language is a good way to do a 16x16 multiply to a 32-bit result. For best precision, a good filter algorithm should probably use a 32x16 multiply to 32 bit result (shifted right 16). This would end up requiring two 32x32 multiplies on the PIC.

The generalized notch-reject procedure is:
Code:

  newsine = oldsine * const1 + oldcos * const2;
  newcos = oldcos * const3 + oldsine * const4;
  oldsine = newsine;
  newsine = oldsine;
  filteredinput = input - oldcos;
  newcos += input;


The constants const1, const2, const3, and const4 should be chosen to yield the desired filter characteristics. If they are well-chosen, the filter will have very sharp attenuation at the desired reject frequency and minimal effect at any other. In environments that support true double-precision floading point numbers effectively, they should be used. Otherwise, long ints are good if they can be handled successfully (recognizing that multiplying by any of the constants means multiplying be a big number and shifting right 16).


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
1 registered and 6 anonymous users are browsing this forum.

Moderator:  Dan Henry, jtemples, mikerj, Andrew L 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 5053

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5