Commit c2c2c13f authored by Pavel Vainerman's avatar Pavel Vainerman

Исправлена ошибка в DigitalFilter

parent 0415df99
......@@ -58,6 +58,8 @@ void DigitalFilter::setSettings( unsigned int bufsize, double T, double lsq,
if( w.size() != maxsize || lsq != lsparam )
w.assign(maxsize, 1.0/maxsize);
lsparam = lsq;
mvec.resize(maxsize);
}
//--------------------------------------------------------------------------
void DigitalFilter::init( int val )
......@@ -192,12 +194,10 @@ int DigitalFilter::median( int newval )
add(newval);
// ???????? ? ??????
FIFOBuffer::iterator it = buf.begin();
for( unsigned int i=0; i<maxsize && it!=buf.end(); i++,it++ )
mvec[i] = (*it);
// ????????? ??????
sort(mvec.begin(),mvec.end());
return mvec[maxsize/2];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment