Skip to content

File soap.h

File List > DaisySP > Source > Filters > soap.h

Go to the documentation of this file

Source Code

/*
Copyright (c) 2020 Electrosmith, Corp, Brian Tice, Tom Erbe

Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/

#pragma once

namespace daisysp
{
class Soap
{
  public:
    Soap() {}
    ~Soap() {}

    void Init(float sample_rate);

    void Process(float in);

    void SetCenterFreq(float f);

    void SetFilterBandwidth(float b);

    inline float Bandpass() { return out_bandpass_; }

    inline float Bandreject() { return out_bandreject_; }

  private:
    float soap_center_freq_;
    float soap_bandwidth_;
    float in_0_;
    float din_1_;
    float din_2_;
    float dout_1_;
    float dout_2_;
    float all_output_;
    float out_bandpass_;
    float out_bandreject_;
    float sr_;
};

} // namespace daisysp