Implementing a post-processed low-pass filter using core audio

可紊 提交于 2019-12-04 16:56:37

I strongly recommend numerical recipes in c. Outside of that, I'm not sure I can help you.

When you design a filter, you need to calculate the coefficients of that filter based on the frequency so you almost need a class to handle it, not just a function.

This is in C++ but it should get you started. Sorry I can't provide a concrete answer.

What you have is an IIR filter, and for more control I'd suggest using a FIR filter, which is easier to calculate the coefficients for. I create a window function that is:

y = sin (x * bandwidth) / (sin (x) * windowWidth)

where windowWidth is how many samples wide your window is, x ranges from -2 * PI to 2 * PI, and bandwidth:

bandwidth = 2 * frequency * n / sampleRate;

This creates an array of numbers which you apply to a range of samples centered around the one you want to output. You iterate this over every sample.

I've summarized my own code for doing this, since the original code is rather crufty.

I implemented a filter using the interactive filter designer.

Here's some sample code, with it integrated: https://github.com/davidcairns/MediaPlayerDemo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!