Changeset 1963 in Sophya


Ignore:
Timestamp:
Apr 11, 2002, 6:12:17 PM (23 years ago)
Author:
aubourg
Message:

new output for wiener, unconnected outs ok in processor

Location:
trunk/ArchTOIPipe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1787 r1963  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toiprocessor.cc,v 1.21 2001-11-26 15:13:48 aubourg Exp $
     5// $Id: toiprocessor.cc,v 1.22 2002-04-11 16:12:17 aubourg Exp $
    66
    77#include "toiprocessor.h"
     
    167167    throw RangeCheckError("TOIProcessor::getOutputTOI() out of bound toiIndex");
    168168  TOI* toi = outTOIs[toiIndex];
    169   if (toi == NULL)
    170     throw NullPtrError("TOIProcessor::getOutputTOI() - Not assigned TOI !");
     169  //  if (toi == NULL)
     170  //    throw NullPtrError("TOIProcessor::getOutputTOI() - Not assigned TOI !");
    171171  return(toi);
    172172}
     
    392392void TOIProcessor::putData(int toiIndex, int i, double value, uint_8 flg) {
    393393  TOI* toi = getOutputTOI(toiIndex);
     394  if (toi == NULL) return;
    394395  toi->putData(i, value, flg);
    395396  // autoWontNeed(i);  // now done on getData
     
    400401                           uint_8 const* flg) {
    401402  TOI* toi = getOutputTOI(toiIndex);
     403  if (toi == NULL) return;
    402404  toi->putData(i, n, val, flg);
    403405  if (toi->needSyncOldWay())  notify(); // seulement pour non segmented
  • trunk/ArchTOIPipe/Processors/wienerdecor.cc

    r1945 r1963  
    1616  declareInput("probe");
    1717  declareOutput("signal");
     18  declareOutput("noiseestim");
    1819  name="WienerDecorrelator";
    1920  setNeededHistory(nsamples+lcorr+1);
     
    3334  double* y = new double[lcorr+1];  // corr vector
    3435  double* window = new double[lcorr];
    35   double* filter = w+1;
     36  double* filter = new double[lcorr];
     37  for (int i=0; i<lcorr; i++) filter[i]=0;
    3638 
    3739  int sn = snb;
     
    5759      }
    5860      dtoeplz(r,w,y,lcorr);
    59       cout << "Wiener filter : \n ";
     61      if (!isnan(w[1])) {
     62        for (int i=0; i<lcorr; i++) {
     63          filter[i] = w[i+1];
     64        }
     65      } else {
     66        cout << "Bad inversion, keeping previous filter\n";
     67      }
     68      cout << "Wiener filter : " << sn << "\n ";
    6069      for (int i=0; i<lcorr; i++) {
    6170        cout << filter[i] << " ";
     
    7180      }
    7281      putData(0, sn, getData(0, sn) - outSig);
     82      putData(1, sn, outSig);
    7383    }
    7484    sn++;
     
    7888  delete[] w;
    7989  delete[] r;
     90  delete[] filter;
    8091}
Note: See TracChangeset for help on using the changeset viewer.