00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_PECONVERT2_H
00020 #define MARSYAS_PECONVERT2_H
00021
00022 #include "MarSystem.h"
00023
00024 namespace Marsyas
00025 {
00036 class Peaker;
00037 class MaxArgMax;
00038 class SimulMaskingFft;
00039
00040 class PeakConvert2: public MarSystem
00041 {
00042 private:
00043 realvec lastphase_;
00044 realvec phase_;
00045 realvec mag_;
00046 realvec peaks_;
00047 realvec tmp_;
00048 realvec magCorr_;
00049 realvec frequency_;
00050 realvec lastmag_;
00051 realvec lastfrequency_;
00052 realvec deltamag_;
00053 realvec deltafrequency_;
00054 realvec masked_,
00055 lpPeakerRes_,
00056 tmpBuff_,
00057 peakProb_,
00058 peakProbWeight_;
00059
00060 mrs_real lpCoeff_;
00061 mrs_natural N_;
00062 mrs_real fundamental_;
00063 mrs_real factor_;
00064 mrs_natural hopSize_,
00065 instFreqHopSize_;
00066 mrs_natural downFrequency_;
00067 mrs_natural upFrequency_;
00068 mrs_natural nbParameters_;
00069 mrs_natural nbPeaks_;
00070 mrs_natural frameMaxNumPeaks_;
00071 mrs_natural size_;
00072 mrs_natural psize_;
00073 mrs_natural skip_;
00074 bool pick_;
00075 bool prec_;
00076
00077 mrs_natural frame_;
00078
00079 bool useStereoSpectrum_;
00080
00081 Peaker* peaker_;
00082 MaxArgMax* max_;
00083 SimulMaskingFft *masking_;
00084
00085 MarControlPtr ctrl_totalNumPeaks_;
00086 MarControlPtr ctrl_frameMaxNumPeaks_;
00087
00088 void addControls();
00089 void myUpdate(MarControlPtr sender);
00090
00091 mrs_real lobe_value_compute(mrs_real f, mrs_natural type, mrs_natural size);
00092
00093 void getShortBinInterval(realvec& interval, realvec& index, realvec& mag);
00094 void getLargeBinInterval(realvec& interval, realvec& index, realvec& mag);
00095
00096 void ComputeMasking (realvec& in);
00097 void ComputeMagnitudeAndPhase (realvec in);
00098 void ComputePeaker (realvec in, realvec& out);
00099
00100
00101 static mrs_real GaussianPdf (mrs_real x, mrs_real std = 1);
00102
00103 public:
00104 PeakConvert2(std::string name);
00105 PeakConvert2(const PeakConvert2& a);
00106 ~PeakConvert2();
00107 MarSystem* clone() const;
00108
00109 void myProcess(realvec& in, realvec& out);
00110 };
00111
00112 }
00113
00114 #endif
00115
00116
00117
00118
00119
00120