AdaptAver::AdaptAver(QWidget *parent) : QWidget(parent), ui(new Ui::AdaptAver) { ui->setupUi(this); connect(ui->spinBox_2, SIGNAL(valueChanged(int)), this, SLOT(checkVariance(int))); connect(ui->pushButton_5, SIGNAL(clicked()), this, SLOT(adArAvFilter())); connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(checkSpin(int))); ui->spinBox_2->setMinimum(50); ui->spinBox_2->setMaximum(30000); //ограничиваем значение шума ui->spinBox_2->setValue(50); ui->spinBox_2->setSingleStep(50); dispNoise = 50; //устанавливаем исходное значение дисперсии шума connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(adaptFilter())); connect(ui->spinBox_3, SIGNAL(valueChanged(int)), this, SLOT(checkLimit(int))); limit=1; strength = 1; }
/* * adaptive (noise reduction) filter a la * doug smith (Signal, Samples and stuff 3, qex * july 1998. * basic: h(k+ 1) = lambda h(k) + 2 * u * err * x (k) * it really works */ adaptiveFilter::adaptiveFilter (int fsize) { firsize = fsize; Kernel = new DSPFLOAT [fsize]; Buffer = new DSPCOMPLEX [fsize + fsize]; /* * we choose a small mu */ adaptFilter (0.10); }