Search code examples
androidandroid-studiofiltersuperpowered

Superpowered Android Highpass Filter


I would like to cut the signal at a specific frequency rate (so that humans can't hear it - ultrasonic). I am using the CrossExample to test it. I use the Filter as following:

filter = new SuperpoweredFilter(SuperpoweredFilter_Resonant_Lowpass, samplerate);

filter->setResonantParameters(floatToFrequency(1.0f - value), 0.2f);
filter->enable(true);

filter->process(stereoBuffer, stereoBuffer, numberOfSamples);

Unfortunately, regardless of the Frequency Parameter you can always hear the signal a little bit (Max. Volume + ear close to speakers) which means it doesn't cut properly.

Am I doing something wrong or is this a failure of the sdk?


Solution

  • The SuperpoweredFilter implements a classic IIR filter. Such filter always has some kind of frequency curve, it's never "super sharp". If you need complete silence for specific frequencies, then cut them in the frequency domain. Check the SuperpoweredFrequencyDomain example in the SDK on how to do this.