• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: High Pass Filter example?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: High Pass Filter example?


  • Subject: Re: High Pass Filter example?
  • From: James McCartney <email@hidden>
  • Date: Thu, 5 Jun 2003 07:12:37 -0700

On Wednesday, June 4, 2003, at 09:31 PM, email@hidden wrote:

Hi,

I'm looking for a basic single pole high pass filter. Does anyone know the
high pass version of this low pass filter?

inline double LowPassFilter(double input, double inCutoff, double& ioPrev)
{
ioPrev = (input * (1.0 - inCutoff)) + (ioPrev * inCutoff);

return ioPrev;
}


First of all let's make this one efficient. Here is the equivalent code to the above, but with one less multiply. inCoef (inCutoff is a misnomer really) should be (0..1)

inline double OnePoleLowpassFilter(double input, double inCoef, double& ioPrev)
{
ioPrev = input + inCoef * (ioPrev - input);
return ioPrev;
}

Here's a hi pass version, inCoef (0..1) as above.

inline double OnePoleHipassFilter(double input, double inCoef, double& ioPrev)
{
ioPrev = input - inCoef * (ioPrev + input);
return ioPrev;
}


Here's one where it is hipass for inCoef (-1..0), lowpass for inCoef (0..1) :

inline double OnePoleFilter(double input, double inCoef, double& ioPrev)
{
ioPrev = input * (1.0 - fabs(inCoef)) + inCoef * ioPrev;
return ioPrev;
}

I suggest joining the music-dsp mailing list for this sort of question.
the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp/
http://ceait.calarts.edu/mailman/listinfo/music-dsp


--
--- james mccartney
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >High Pass Filter example? (From: email@hidden)

  • Prev by Date: Re: High Pass Filter example?
  • Next by Date: Re: Convert to float and more
  • Previous by thread: Re: High Pass Filter example?
  • Next by thread: Soft play-thru question
  • Index(es):
    • Date
    • Thread