daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2.  * License, v. 2.0. If a copy of the MPL was not distributed with this
  3.  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef OKAPI_AVERAGEFILTER_HPP_
  5. #define OKAPI_AVERAGEFILTER_HPP_
  6.  
  7. #include "okapi/filter/filter.hpp"
  8. #include <array>
  9. #include <cstddef>
  10.  
  11. namespace okapi {
  12. /**
  13.  * @tparam number of taps in the filter
  14.  */
  15. template <std::size_t n> class AverageFilter : public Filter {
  16.   public:
  17.   /**
  18.    * Averaging filter.
  19.    */
  20.   AverageFilter();
  21.  
  22.   virtual ~AverageFilter();
  23.  
  24.   double filter(const double ireading) override;
  25.  
  26.   double getOutput() const override;
  27.  
  28.   private:
  29.   std::array<double, n> data;
  30.   double index, output;
  31. };
  32. } // namespace okapi
  33.  
  34. #include "../src/averageFilter.cpp"
  35.  
  36. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top