Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement