[10] | 1 | // %flair:license{
|
---|
| 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
| 4 | // %flair:license}
|
---|
[7] | 5 | // created: 2013/12/10
|
---|
| 6 | // filename: ButterworthLowPass.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class defining a Butterworth low pass filter
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #include "ButterworthLowPass.h"
|
---|
| 19 | #include "ButterworthLowPass_impl.h"
|
---|
| 20 | #include <cvmatrix.h>
|
---|
| 21 | #include <Layout.h>
|
---|
| 22 | #include <LayoutPosition.h>
|
---|
| 23 |
|
---|
| 24 | using std::string;
|
---|
| 25 | using namespace flair::core;
|
---|
| 26 | using namespace flair::gui;
|
---|
| 27 |
|
---|
| 28 | namespace flair
|
---|
| 29 | {
|
---|
| 30 | namespace filter
|
---|
| 31 | {
|
---|
| 32 |
|
---|
| 33 | ButterworthLowPass::ButterworthLowPass(const IODevice* parent,const LayoutPosition* position,string name,int order): IODevice(parent,name)
|
---|
| 34 | {
|
---|
| 35 | pimpl_=new ButterworthLowPass_impl(this,position,name,order);
|
---|
| 36 | AddDataToLog(pimpl_->output);
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | ButterworthLowPass::ButterworthLowPass(const gui::LayoutPosition* position,string name,int order): IODevice(position->getLayout(),name)
|
---|
| 40 | {
|
---|
| 41 | pimpl_=new ButterworthLowPass_impl(this,position,name,order);
|
---|
| 42 | AddDataToLog(pimpl_->output);
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 |
|
---|
| 46 | ButterworthLowPass::~ButterworthLowPass()
|
---|
| 47 | {
|
---|
| 48 | delete pimpl_;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | cvmatrix *ButterworthLowPass::Matrix(void) const
|
---|
| 52 | {
|
---|
| 53 | return pimpl_->output;
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | float ButterworthLowPass::Output(void) const
|
---|
| 57 | {
|
---|
| 58 | return pimpl_->output->Value(0,0);
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | void ButterworthLowPass::UpdateFrom(const io_data *data)
|
---|
| 62 | {
|
---|
| 63 | pimpl_->UpdateFrom(data);
|
---|
| 64 | ProcessUpdate(pimpl_->output);
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | } // end namespace filter
|
---|
| 68 | } // end namespace flair
|
---|