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