1

In the documentation for the XAudio2 filter parameters it mentions

Filter radian frequency calculated as (2 * sin(pi * (desired filter cutoff frequency) / sampleRate))

Can someone explain to me where that formula comes from? Because the only source of frequency conversion that would make sense to me would come from sin(f * t) and cosine(f * t) vs sin(2*pi*f * t) and cosine(2*pi*f * t) where f is a "frequency" and t is time.

user782220
  • 10,677
  • 21
  • 72
  • 135

2 Answers2

0

It's been a while since I've done filter math. It's kind of gnarly, but here's a basic interpretation: The part that's a little confusing is the Sin no? I'm a little confused by it too, but I bet it's to keep the output of the conversion in the desired range. Looks like Microsoft's filter can only take up 8000hz. Forgive me if this way off base, I can't visualize what a sine function would do to the results at the moment.

2 * sin(pi * (desired filter cutoff frequency) / WHOLE THING

PARTS

2 * sin //// The 2*pi*f part you're used to.

(pi *
(

desired filter cutoff frequency) //// This in hertz will become radian freqs

/ sampleRate //// Sets up the whole equation for 1 sample

MrSynAckSter
  • 1,681
  • 1
  • 18
  • 34
0
(2 * sin(pi * (desired filter cutoff frequency) / sampleRate))

This value will go monotonically from 0 to 2.0 as the filter cut-off frequency goes from DC to half the sample rate.

Digital filters scale relative to the sample rate, and your other offered options don't.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • 2
    Ok but I'm still puzzled about why "filter radian frequency" is DEFINED by that formula. It feels like the formula is just randomly chosen. Why that formula and not another? – user782220 Jul 25 '12 at 10:59