0

I'm trying to emit white noise around specific center frequency inside bandwidth using AudioKit for iOS. Core of what I did so far looks like this:

class Manager {

    private let noise = AKWhiteNoise(amplitude: Default.amplitude)

    private lazy var filter: AKEqualizerFilter = {
        let max = AKEqualizerFilter.gainRange.upperBound
        return AKEqualizerFilter(noise, centerFrequency: Default.centerFrequency, bandwidth: Default.bandwidth, gain: max)
    }()

    var bandwidth: Double {
        get {
            return filter.bandwidth
        }
        set {
            filter.bandwidth = newValue
        }
    }

    var centerFrequency: Double {
        get {
            return filter.centerFrequency
        }
        set {
            filter.centerFrequency = newValue
        }
    }
}

Noise is emitted, but that's how looks sound before playing noise and that's how after adding noise.

Does anyone knows what I'm doing wrong and how to fix sound to fit given center frequency and bandwidth?

unablys
  • 1
  • 1
  • It's not clear exactly what the problem is here. What were the input parameters for the two screenshots you provide? What were you expecting to happen? – alexkent May 28 '20 at 14:49
  • I'm trying to achieve something in shape like [this](https://upload.wikimedia.org/wikipedia/commons/6/6b/Bandwidth_2.svg). Modifying bandwidth would change width of graph and updating center frequency would move everything to left or right but I need that noise to be always around center frequency. – unablys May 29 '20 at 06:15

0 Answers0