LCOV - code coverage report
Current view: top level - Dynamic - GainLimiterFilter.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-02-18 20:07:22 Functions: 1 2 50.0 %

          Line data    Source code
       1             : /**
       2             :  * \file GainLimiterFilter.h
       3             :  */
       4             : 
       5             : #ifndef ATK_DYNAMIC_GAINLIMITERFILTER_H
       6             : #define ATK_DYNAMIC_GAINLIMITERFILTER_H
       7             : 
       8             : #include <ATK/Dynamic/GainFilter.h>
       9             : #include <ATK/Dynamic/config.h>
      10             : 
      11             : namespace ATK
      12             : {
      13             :   /// Gain "limiter". Computes a new amplitude/volume gain based on threshold, slope and the power of the input signal
      14             :   template<typename DataType_>
      15             :   class ATK_DYNAMIC_EXPORT GainLimiterFilter : public ParentGainFilter<DataType_>
      16             :   {
      17             :   public:
      18             :     /// Simplify parent calls
      19             :     using Parent = ParentGainFilter<DataType_>;
      20             :     using Parent::ratio;
      21             :     using Parent::start_recomputeLUT;
      22             :     using typename Parent::DataType;
      23             :     /*!
      24             :     * @brief Constructor
      25             :     * @param nb_channels is the number of input and output channels
      26             :     * @param LUTsize is the total LUT size used by the filter
      27             :     * @param LUTprecision is the number of elements used to compute values < 1
      28             :     */
      29             :     GainLimiterFilter(gsl::index nb_channels = 1, size_t LUTsize = 128*1024, size_t LUTprecision = 64);
      30             :     /// Destructor
      31           5 :     ~GainLimiterFilter() override = default;
      32             : 
      33             :     /// Sets the softness of the knee of the filter (positive value)
      34             :     void set_softness(DataType_ softness);
      35             :     /// Retrieves the softness factor
      36             :     DataType_ get_softness() const;
      37             : 
      38             :   protected:
      39             :     DataType_ computeGain(DataType_ value) const;
      40             :   private:
      41             :     DataType_ softness{0.0001};
      42             :   };
      43             : }
      44             : 
      45             : #endif

Generated by: LCOV version TK-3.3.0-4-gdba42eea