I'm using the AudioKit library with Swift for developing a simple iOS application that should be able to listen to frequencies of the range 3.000Hz - maybe 6000Hz
.
So I'd like to just track the input frequency of the microphone within this range and to achieve this I tried to apply a filter effect on the input microphone to avoid picking up the frequency of several unwanted noises.
var mic: AKMicrophone
var silence: AKBooster
var filter: AKHighPassFilter
var tracker: AKFrequencyTracker
public init() {
mic = AKMicrophone()
filter = AKHighPassFilter(mic)
filter.cutoffFrequency = 3000 // just get frequencyies above 3000Hz (highpass)
filter.resonance = 0
tracker = AKFrequencyTracker(filter)
silence = AKBooster(tracker, gain: 0)
}
func start() {
AKSettings.audioInputEnabled = true
AudioKit.output = silence
AudioKit.start()
}
func print() {
print(tracker.frequency)
}
To sum that up: I know that the filter is changing something - but I can not really apply a frequency-filter for the range 3.000Hz +
because I'm also getting values below 3.000Hz (like 2.0000 / 500 / etc) for the filtered frequency.
The AudiKit website has included some examples how to use the filters - But I can find no examples how to apply filters on the input-microphone to get a filtered frequency? http://audiokit.io/playgrounds/Filters/
Am I doing something the wrong way?
Is this really the functionality of the AudioKit-filters or didn't I get the right sense of filters?
Is there another way to filter for frequency-ranges?