SpectralNoiseSuppression Class Reference

Algorithm to remove the non-harmonic part of the spectrums magnitudes represented as vectors of Real values. More...

#include <SpectralNoiseSuppression.h>

Collaboration diagram for SpectralNoiseSuppression:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SpectralNoiseSuppression (int fftSize=1024, Real lowFrequency=50.0, Real highFrequency=6000.0, Real samplerate=44100.0)
 ~SpectralNoiseSuppression ()
void process (const MatrixXR &spectrums, MatrixXR *noises, MatrixXR *suppressed)
Real lowFrequency () const
void setLowFrequency (Real frequency, bool callSetup=true)
Real highFrequency () const
void setHighFrequency (Real frequency, bool callSetup=true)
Real samplerate () const
void setSamplerate (Real frequency, bool callSetup=true)
int fftSize () const
void setFftSize (int size, bool callSetup=true)


Detailed Description

Algorithm to remove the non-harmonic part of the spectrums magnitudes represented as vectors of Real values.

This class represents an object to perform spectral noise suppresion on vectors of Real values. Which is a useful technique to keep only the peaks of a spectrum magnitude in harmonic sounds.

This implementation consists in estimating the spectral noise by performing a moving average on the power warped spectrum magnitude using varying bandwidths. The spectral noise is then removed from the original spectrum, clipping the result to zero to avoid negative values.

The samplerate and FFT size of the input spectrum are specified using setSamplerate() and setFftSize().

The frequency limits of the Mel scale mapping are specified using setLowFrequency() and setHighFrequency().

Author:
Ricard Marxer
See also:
MelBands, Bands, PeakDetection

Constructor & Destructor Documentation

SpectralNoiseSuppression ( int  fftSize = 1024,
Real  lowFrequency = 50.0,
Real  highFrequency = 6000.0,
Real  samplerate = 44100.0 
)

Constructs a spectral noise suppression object with the specified lowFrequency, highFrequency, samplerate and fftSize settings.

Parameters:
lowFrequency low frequency used for the magnitude warping function, must be greater than zero 0 and lower than half the samplerate.
highFrequency high frequency used for the magnitude warping function, must be greater than zero 0 and lower than half the samplerate.
samplerate samplerate frequency of the input signal.
fftSize size of the FFT.

References setFftSize(), setHighFrequency(), setLowFrequency(), and setSamplerate().

Destroys the algorithm and frees its resources.


Member Function Documentation

void process ( const MatrixXR &  spectrums,
MatrixXR *  noises,
MatrixXR *  suppressed 
)

Performs the estimation and suppression of the noise on each of the rows of spectrums. Puts the resulting noise spectrums and noise-suppressed spectrums in the rows of whitened.

Parameters:
spectrums matrix of Real values representing one spectrum magnitude per row. The number of columns of spectrum must be equal to the fftSize / 2 + 1 where fftSize is specified using setFftSize().
noises pointer to a matrix of Real values representing one noise spectrum per row. The matrix should have the same number of rows and columns as spectrums.
suppressed pointer to a matrix of Real values representing one noise-suppressed spectrum per row. The matrix should have the same number of rows and columns as spectrums.
Note that if the output matrices are not of the required sizes they will be resized, reallocating a new memory space if necessary.

References Bands::process().

Real lowFrequency (  )  const

Return the low frequency of the spectral whitening. The default is 50.0.

See also:
lowFrequency, highFrequency, setLowFrequency, setHighFrequency

void setLowFrequency ( Real  frequency,
bool  callSetup = true 
)

Specifies the low frequency of the spectral whitening. The given frequency must be in the range of 0 to the samplerate / 2.

See also:
lowFrequency, highFrequency, setHighFrequency

Referenced by SpectralNoiseSuppression().

Real highFrequency (  )  const

Return the high frequency of the spectral whitening. The default is 6000.0.

See also:
lowFrequency, setLowFrequency, setHighFrequency

void setHighFrequency ( Real  frequency,
bool  callSetup = true 
)

Specifies the high frequency of the spectral whitening. The given frequency must be in the range of 0 to the samplerate / 2.

See also:
lowFrequency, highFrequency, setLowFrequency

Referenced by SpectralNoiseSuppression().

Real samplerate (  )  const

Return the samplerate frequency of the input signal. The default is 44100.0.

See also:
setSamplerate

void setSamplerate ( Real  frequency,
bool  callSetup = true 
)

Specifies the samplerate frequency of the input signal.

See also:
samplerate

Referenced by SpectralNoiseSuppression().

int fftSize (  )  const

Returns the size of the FFT that has been performed for the input. The default is 1024.

See also:
setFftSize()

void setFftSize ( int  size,
bool  callSetup = true 
)

Specifies the size of the FFT that has been performed for the input. The given size must be higher than 0.

See also:
fftSize()

Referenced by SpectralNoiseSuppression().


The documentation for this class was generated from the following files:

Generated on Tue Mar 31 20:38:34 2009 for Loudia by  doxygen 1.5.6