00001 #include "LSSOFilter.h" 00002 #include <iostream> 00003 00004 namespace gplib 00005 { 00006 00007 const int maxoutputchannels = 1; 00008 00009 LSSOFilter::LSSOFilter(const int filterlength) : 00010 AdaptiveFilter(filterlength, maxoutputchannels), Weights(filterlength) 00011 { 00012 //set all weights to zero 00013 Weights.clear(); 00014 } 00015 00016 LSSOFilter::~LSSOFilter() 00017 { 00018 } 00019 00020 void LSSOFilter::PrintWeights(std::ostream &output) 00021 { 00022 std::copy(Weights.begin(), Weights.end(), 00023 std::ostream_iterator<double>(output, " ")); 00024 output << std::endl; 00025 } 00026 00027 void LSSOFilter::CalcOutput(const gplib::rvec &Input, gplib::rvec &Output) 00028 { 00029 Output(0) = ublas::prec_inner_prod(Input, Weights); 00030 SetOutput(Output); 00031 } 00032 }
1.5.8