00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SPECTRALNOISESUPPRESSION_H
00020 #define SPECTRALNOISESUPPRESSION_H
00021
00022 #include <Eigen/StdVector>
00023
00024 #include "Typedefs.h"
00025 #include "Debug.h"
00026
00027 #include "Bands.h"
00028
00053 class SpectralNoiseSuppression {
00054 protected:
00055 int _fftSize;
00056 Real _samplerate;
00057
00058 Real _lowFrequency;
00059 Real _highFrequency;
00060
00061 int _k0;
00062 int _k1;
00063
00064 MatrixXR _g;
00065
00066 Bands _bands;
00067
00068 public:
00084 SpectralNoiseSuppression( int fftSize = 1024, Real lowFrequency = 50.0, Real highFrequency = 6000.0, Real samplerate = 44100.0 );
00085
00089 ~SpectralNoiseSuppression();
00090
00091 void setup();
00092 void reset();
00093
00111 void process( const MatrixXR& spectrums, MatrixXR* noises, MatrixXR* suppressed );
00112
00119 Real lowFrequency() const;
00120
00127 void setLowFrequency( Real frequency, bool callSetup = true );
00128
00135 Real highFrequency() const;
00136
00143 void setHighFrequency( Real frequency, bool callSetup = true );
00144
00151 Real samplerate() const;
00152
00158 void setSamplerate( Real frequency, bool callSetup = true );
00159
00166 int fftSize() const;
00167
00174 void setFftSize( int size, bool callSetup = true );
00175 };
00176
00177 #endif