Audacity 3.2.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
EffectNoiseRemoval Class Referencefinal

A two-pass effect to remove background noise. More...

#include <NoiseRemoval.h>

Inheritance diagram for EffectNoiseRemoval:
[legend]
Collaboration diagram for EffectNoiseRemoval:
[legend]

Public Member Functions

 EffectNoiseRemoval ()
 
virtual ~EffectNoiseRemoval ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
 
bool Init () override
 Call once to set up state for whole list of tracks to be processed. More...
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 Actually do the effect here. More...
 
void End () override
 
- Public Member Functions inherited from StatefulEffect
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 Call once to set up state for whole list of tracks to be processed. More...
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 Actually do the effect here. More...
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (EffectSettings &settings)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
RealtimeSince RealtimeSupport () const override
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
bool LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id, EffectSettings &settings) const override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults (EffectSettings &settings) const override
 Change settings back to "factory default". More...
 
unsigned GetAudioInCount () const override
 How many input buffers to allocate at once. More...
 
unsigned GetAudioOutCount () const override
 How many output buffers to allocate at once. More...
 
virtual const EffectParameterMethodsParameters () const
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI (EffectSettings &) override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets (const EffectSettings &settings) const override
 
void ImportPresets (EffectSettings &settings) override
 
bool HasOptions () override
 
void ShowOptions () override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
 Usually applies factory to self and given access. More...
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
bool TransferDataToWindow (const EffectSettings &settings) override
 Update controls for the settings. More...
 
bool TransferDataFromWindow (EffectSettings &settings) override
 Update the given settings from controls. More...
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings)
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={}) const
 
bool EnableApply (bool enable=true)
 
wxWindow * GetUIParent ()
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
virtual int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false)=0
 
virtual bool IsGraphicalUI ()=0
 
virtual std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)=0
 Adds controls to a panel that is given as the parent window of S More...
 
virtual bool CanExportPresets ()=0
 
virtual void ExportPresets (const EffectSettings &settings) const =0
 
virtual void ImportPresets (EffectSettings &settings)=0
 
virtual bool HasOptions ()=0
 
virtual void ShowOptions ()=0
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)=0
 Usually applies factory to self and given access. More...
 
virtual void Preview (EffectSettingsAccess &access, bool dryOnly)=0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={}, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 Unfortunately complicated dual-use function. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)=0
 Update controls for the settings. More...
 
virtual bool TransferDataFromWindow (EffectSettings &settings)=0
 Update the given settings from controls. More...
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
virtual unsigned GetAudioInCount () const =0
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const =0
 How many output buffers to allocate at once. More...
 
virtual int GetMidiInCount () const
 Function that has not yet found a use. More...
 
virtual int GetMidiOutCount () const
 Function that has not yet found a use. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual RealtimeSince RealtimeSupport () const =0
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsRealtime () const
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Noise Removal") }
 
- Static Public Attributes inherited from EffectPlugin
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Private Member Functions

bool ProcessOne (int count, WaveTrack *track, sampleCount start, sampleCount len)
 
void Initialize ()
 
void StartNewTrack ()
 
void ProcessSamples (size_t len, float *buffer)
 
void FillFirstHistoryWindow ()
 
void ApplyFreqSmoothing (float *spec)
 
void GetProfile ()
 
void RemoveNoise ()
 
void RotateHistoryWindows ()
 
void FinishTrack ()
 

Private Attributes

bool mDoProfile
 
bool mHasProfile
 
int mLevel
 
double mSampleRate
 
size_t mWindowSize
 
size_t mSpectrumSize
 
float mMinSignalTime
 
Floats mNoiseThreshold
 
double mSensitivity
 
double mFreqSmoothingHz
 
double mNoiseGain
 
double mAttackDecayTime
 
bool mbLeaveNoise
 
std::shared_ptr< WaveTrackmOutputTrack
 
sampleCount mInSampleCount
 
sampleCount mOutSampleCount
 
int mInputPos
 
HFFT hFFT
 
Floats mFFTBuffer
 
Floats mWindow
 
int mFreqSmoothingBins
 
int mAttackDecayBlocks
 
float mOneBlockAttackDecay
 
float mNoiseAttenFactor
 
float mSensitivityFactor
 
size_t mMinSignalBlocks
 
size_t mHistoryLen
 
Floats mInWaveBuffer
 
Floats mOutOverlapBuffer
 
ArraysOf< float > mSpectrums
 
ArraysOf< float > mGains
 
ArraysOf< float > mRealFFTs
 
ArraysOf< float > mImagFFTs
 

Friends

class NoiseRemovalDialog
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , Since_3_2 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Protected Member Functions inherited from Effect
bool EnablePreview (bool enable=true)
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
virtual std::unique_ptr< EffectUIValidatorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)
 Add controls to effect panel; always succeeds. More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
- Protected Member Functions inherited from EffectBase
void Preview (EffectSettingsAccess &access, bool dryOnly) override
 
bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent, const EffectDialogFactory &dialogFactory, const EffectSettingsAccessPtr &pAccess) override
 Unfortunately complicated dual-use function. More...
 
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
virtual bool ValidateUI (EffectSettings &settings)=0
 
virtual bool CloseUI ()=0
 
- Protected Attributes inherited from Effect
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWindow * mUIParent {}
 
- Protected Attributes inherited from EffectBase
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0 {}
 
double mT1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 
- Protected Attributes inherited from EffectUIClientInterface
friend EffectUIValidator
 
friend DefaultEffectUIValidator
 
- Static Protected Attributes inherited from EffectBase
static int nEffectsDone = 0
 

Detailed Description

A two-pass effect to remove background noise.

The first pass is done over just noise. For each windowed sample of the sound, we take a FFT and then statistics are tabulated for each frequency band - specifically the maximum level achieved by at least (n) sampling windows in a row, for various values of (n).

During the noise removal phase, we start by setting a gain control for each frequency band such that if the sound has exceeded the previously-determined threshold, the gain is set to 0, otherwise the gain is set lower (e.g. -18 dB), to suppress the noise. Then frequency-smoothing is applied so that a single frequency is never suppressed or boosted in isolation, and then time-smoothing is applied so that the gain for each frequency band moves slowly. Lookahead is employed; this effect is not designed for real-time but if it were, there would be a significant delay.

The gain controls are applied to the complex FFT of the signal, and then the inverse FFT is applied, followed by a Hann window; the output signal is then pieced together using overlap/add of half the window size.

Definition at line 36 of file NoiseRemoval.h.

Constructor & Destructor Documentation

◆ EffectNoiseRemoval()

EffectNoiseRemoval::EffectNoiseRemoval ( )

Definition at line 83 of file NoiseRemoval.cpp.

84{
85 mWindowSize = 2048;
86 mSpectrumSize = 1 + mWindowSize / 2;
87
88 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseSensitivity"),
89 &mSensitivity, 0.0);
90 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseGain"),
91 &mNoiseGain, -24.0);
92 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseFreqSmoothing"),
93 &mFreqSmoothingHz, 150.0);
94 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseAttackDecayTime"),
95 &mAttackDecayTime, 0.15);
96 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseLeaveNoise"),
97 &mbLeaveNoise, false);
98// mbLeaveNoise = false;
99
100
101 mMinSignalTime = 0.05f;
102 mHasProfile = false;
103 mDoProfile = true;
104
106
107 Init();
108}
FileConfig * gPrefs
Definition: Prefs.cpp:71
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:57
bool Init() override
Call once to set up state for whole list of tracks to be processed.

References gPrefs, Init(), mAttackDecayTime, mbLeaveNoise, mDoProfile, mFreqSmoothingHz, mHasProfile, mMinSignalTime, mNoiseGain, mNoiseThreshold, mSensitivity, mSpectrumSize, mWindowSize, and ArrayOf< X >::reinit().

Here is the call graph for this function:

◆ ~EffectNoiseRemoval()

EffectNoiseRemoval::~EffectNoiseRemoval ( )
virtual

Definition at line 110 of file NoiseRemoval.cpp.

111{
112}

Member Function Documentation

◆ ApplyFreqSmoothing()

void EffectNoiseRemoval::ApplyFreqSmoothing ( float *  spec)
private

Definition at line 259 of file NoiseRemoval.cpp.

260{
261 Floats tmp{ mSpectrumSize };
262 int j, j0, j1;
263
264 for(int i = 0; i < mSpectrumSize; i++) {
265 j0 = wxMax(0, i - mFreqSmoothingBins);
266 j1 = wxMin(mSpectrumSize-1, i + mFreqSmoothingBins);
267 tmp[i] = 0.0;
268 for(j = j0; j <= j1; j++) {
269 tmp[i] += spec[j];
270 }
271 tmp[i] /= (j1 - j0 + 1);
272 }
273
274 for(size_t i = 0; i < mSpectrumSize; i++)
275 spec[i] = tmp[i];
276}

References mFreqSmoothingBins, and mSpectrumSize.

Referenced by End(), and RemoveNoise().

Here is the caller graph for this function:

◆ CheckWhetherSkipEffect()

bool EffectNoiseRemoval::CheckWhetherSkipEffect ( const EffectSettings settings) const
overridevirtual

Default implementation returns false.

Reimplemented from Effect.

Definition at line 151 of file NoiseRemoval.cpp.

152{
153 return (mLevel == 0);
154}

References mLevel.

◆ End()

void EffectNoiseRemoval::End ( )
override

Definition at line 320 of file NoiseRemoval.cpp.

321{
322 hFFT.reset();
323
324 if (mDoProfile) {
326 }
327
328 mSpectrums.reset();
329 mGains.reset();
330 mRealFFTs.reset();
331 mImagFFTs.reset();
332
333 mFFTBuffer.reset();
334 mInWaveBuffer.reset();
335 mWindow.reset();
336 mOutOverlapBuffer.reset();
337
338 mOutputTrack.reset();
339}
ArraysOf< float > mImagFFTs
Definition: NoiseRemoval.h:124
std::shared_ptr< WaveTrack > mOutputTrack
Definition: NoiseRemoval.h:103
ArraysOf< float > mRealFFTs
Definition: NoiseRemoval.h:123
void ApplyFreqSmoothing(float *spec)
ArraysOf< float > mSpectrums
Definition: NoiseRemoval.h:121
ArraysOf< float > mGains
Definition: NoiseRemoval.h:122

References ApplyFreqSmoothing(), hFFT, mDoProfile, mFFTBuffer, mGains, mImagFFTs, mInWaveBuffer, mNoiseThreshold, mOutOverlapBuffer, mOutputTrack, mRealFFTs, mSpectrums, and mWindow.

Here is the call graph for this function:

◆ FillFirstHistoryWindow()

void EffectNoiseRemoval::FillFirstHistoryWindow ( )
private

Definition at line 387 of file NoiseRemoval.cpp.

388{
389 for(size_t i = 0; i < mWindowSize; i++)
391 RealFFTf(mFFTBuffer.get(), hFFT.get());
392 for(size_t i = 1; i + 1 < mSpectrumSize; i++) {
393 mRealFFTs[0][i] = mFFTBuffer[hFFT->BitReversed[i] ];
394 mImagFFTs[0][i] = mFFTBuffer[hFFT->BitReversed[i]+1];
395 mSpectrums[0][i] = mRealFFTs[0][i]*mRealFFTs[0][i] + mImagFFTs[0][i]*mImagFFTs[0][i];
397 }
398 // DC and Fs/2 bins need to be handled specially
399 mSpectrums[0][0] = mFFTBuffer[0]*mFFTBuffer[0];
403}
void RealFFTf(fft_type *buffer, const FFTParam *h)
Definition: RealFFTf.cpp:162

References hFFT, mFFTBuffer, mGains, mImagFFTs, mInWaveBuffer, mNoiseAttenFactor, mRealFFTs, mSpectrums, mSpectrumSize, mWindowSize, and RealFFTf().

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinishTrack()

void EffectNoiseRemoval::FinishTrack ( )
private

Definition at line 425 of file NoiseRemoval.cpp.

426{
427 // Keep flushing empty input buffers through the history
428 // windows until we've output exactly as many samples as
429 // were input.
430 // Well, not exactly, but not more than mWindowSize/2 extra samples at the end.
431 // We'll DELETE them later in ProcessOne.
432
433 Floats empty{ mWindowSize / 2 };
434 for(size_t i = 0; i < mWindowSize / 2; i++)
435 empty[i] = 0.0;
436
438 ProcessSamples(mWindowSize / 2, empty.get());
439 }
440}
void ProcessSamples(size_t len, float *buffer)
sampleCount mOutSampleCount
Definition: NoiseRemoval.h:105
sampleCount mInSampleCount
Definition: NoiseRemoval.h:104

References mInSampleCount, mOutSampleCount, mWindowSize, and ProcessSamples().

Referenced by ProcessOne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescription()

TranslatableString EffectNoiseRemoval::GetDescription ( )
override

Definition at line 121 of file NoiseRemoval.cpp.

122{
123 return XO("Removes constant background noise such as fans, tape noise, or hums");
124}
#define XO(s)
Definition: Internat.h:31

References XO.

◆ GetProfile()

void EffectNoiseRemoval::GetProfile ( )
private

Definition at line 442 of file NoiseRemoval.cpp.

443{
444 // The noise threshold for each frequency is the maximum
445 // level achieved at that frequency for a minimum of
446 // mMinSignalBlocks blocks in a row - the max of a min.
447
448 int start = mHistoryLen - mMinSignalBlocks;
449 int finish = mHistoryLen;
450 int i;
451
452 for (size_t j = 0; j < mSpectrumSize; j++) {
453 float min = mSpectrums[start][j];
454 for (i = start+1; i < finish; i++) {
455 if (mSpectrums[i][j] < min)
456 min = mSpectrums[i][j];
457 }
458 if (min > mNoiseThreshold[j])
459 mNoiseThreshold[j] = min;
460 }
461
462 mOutSampleCount += mWindowSize / 2; // what is this for? Not used when we are getting the profile?
463}
int min(int a, int b)

References mHistoryLen, min(), mMinSignalBlocks, mNoiseThreshold, mOutSampleCount, mSpectrums, mSpectrumSize, and mWindowSize.

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol EffectNoiseRemoval::GetSymbol ( )
override

Definition at line 116 of file NoiseRemoval.cpp.

117{
118 return Symbol;
119}
static const ComponentInterfaceSymbol Symbol
Definition: NoiseRemoval.h:39

References Symbol.

◆ GetType()

EffectType EffectNoiseRemoval::GetType ( ) const
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 128 of file NoiseRemoval.cpp.

129{
130 return EffectTypeProcess;
131}
@ EffectTypeProcess

References EffectTypeProcess.

◆ Init()

bool EffectNoiseRemoval::Init ( )
overridevirtual

Call once to set up state for whole list of tracks to be processed.

Returns
success Default implementation does nothing, returns true Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 141 of file NoiseRemoval.cpp.

142{
143 mLevel = gPrefs->Read(wxT("/Effects/NoiseRemoval/Noise_Level"), 3L);
144 if ((mLevel < 0) || (mLevel > MAX_NOISE_LEVEL)) { // corrupted Prefs?
145 mLevel = 0; //Off-skip
146 gPrefs->Write(wxT("/Effects/NoiseRemoval/Noise_Level"), mLevel);
147 }
148 return gPrefs->Flush();
149}
#define MAX_NOISE_LEVEL
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143

References FileConfig::Flush(), gPrefs, MAX_NOISE_LEVEL, and mLevel.

Referenced by EffectNoiseRemoval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void EffectNoiseRemoval::Initialize ( )
private

Definition at line 278 of file NoiseRemoval.cpp.

279{
286 // Applies to power, divide by 10:
287 mSensitivityFactor = pow(10.0, mSensitivity/10.0);
289 (int)(mMinSignalTime * mSampleRate / (mWindowSize / 2));
290 if( mMinSignalBlocks < 1 )
293
296
301
302 // Initialize the FFT
304
309
310 // Create a Hann window function
311 for(size_t i=0; i<mWindowSize; i++)
312 mWindow[i] = 0.5 - 0.5 * cos((2.0*M_PI*i) / mWindowSize);
313
314 if (mDoProfile) {
315 for (size_t i = 0; i < mSpectrumSize; i++)
316 mNoiseThreshold[i] = float(0);
317 }
318}
#define M_PI
Definition: Distortion.cpp:29
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:535
HFFT GetFFT(size_t fftlen)
Definition: RealFFTf.cpp:105
void reinit(Integral count)
Definition: MemoryX.h:109
double mProjectRate
Definition: EffectBase.h:99

References DB_TO_LINEAR, GetFFT(), hFFT, M_PI, mAttackDecayBlocks, mAttackDecayTime, mDoProfile, mFFTBuffer, mFreqSmoothingBins, mFreqSmoothingHz, mGains, mHistoryLen, mImagFFTs, mInWaveBuffer, mMinSignalBlocks, mMinSignalTime, mNoiseAttenFactor, mNoiseGain, mNoiseThreshold, mOneBlockAttackDecay, mOutOverlapBuffer, EffectBase::mProjectRate, mRealFFTs, mSampleRate, mSensitivity, mSensitivityFactor, mSpectrums, mSpectrumSize, mWindow, mWindowSize, ArraysOf< X >::reinit(), and ArrayOf< X >::reinit().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Process()

bool EffectNoiseRemoval::Process ( EffectInstance instance,
EffectSettings settings 
)
overridevirtual

Actually do the effect here.

Returns
success

Implements StatefulEffectBase.

Definition at line 221 of file NoiseRemoval.cpp.

222{
223 Initialize();
224
225 // This same code will both remove noise and profile it,
226 // depending on 'mDoProfile'
227 this->CopyInputTracks(); // Set up mOutputTracks.
228 bool bGoodResult = true;
229
230 int count = 0;
231 for( auto track : mOutputTracks->Selected< WaveTrack >() ) {
232 double trackStart = track->GetStartTime();
233 double trackEnd = track->GetEndTime();
234 double t0 = mT0 < trackStart? trackStart: mT0;
235 double t1 = mT1 > trackEnd? trackEnd: mT1;
236
237 if (t1 > t0) {
238 auto start = track->TimeToLongSamples(t0);
239 auto end = track->TimeToLongSamples(t1);
240 auto len = end - start;
241
242 if (!ProcessOne(count, track, start, len)) {
243 bGoodResult = false;
244 break;
245 }
246 }
247 count++;
248 }
249
250 if (bGoodResult && mDoProfile) {
251 mHasProfile = true;
252 mDoProfile = false;
253 }
254
255 this->ReplaceProcessedTracks(bGoodResult);
256 return bGoodResult;
257}
double mT1
Definition: EffectBase.h:107
std::shared_ptr< TrackList > mOutputTracks
Definition: EffectBase.h:105
double mT0
Definition: EffectBase.h:106
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: EffectBase.cpp:236
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:741
bool ProcessOne(int count, WaveTrack *track, sampleCount start, sampleCount len)
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References Effect::CopyInputTracks(), PackedArray::end(), Initialize(), mDoProfile, mHasProfile, EffectBase::mOutputTracks, EffectBase::mT0, EffectBase::mT1, ProcessOne(), and EffectBase::ReplaceProcessedTracks().

Here is the call graph for this function:

◆ ProcessOne()

bool EffectNoiseRemoval::ProcessOne ( int  count,
WaveTrack track,
sampleCount  start,
sampleCount  len 
)
private

Definition at line 540 of file NoiseRemoval.cpp.

542{
543 if (track == NULL)
544 return false;
545
547
548 if (!mDoProfile)
549 mOutputTrack = track->EmptyCopy();
550
551 auto bufferSize = track->GetMaxBlockSize();
552 Floats buffer{ bufferSize };
553
554 bool bLoopSuccess = true;
555 auto samplePos = start;
556 while (samplePos < start + len) {
557 //Get a blockSize of samples (smaller than the size of the buffer)
558 //Adjust the block size if it is the final block in the track
559 const auto blockSize = limitSampleBufferSize(
560 track->GetBestBlockSize(samplePos),
561 start + len - samplePos
562 );
563
564 //Get the samples from the track and put them in the buffer
565 track->Get((samplePtr)buffer.get(), floatSample, samplePos, blockSize);
566
567 mInSampleCount += blockSize;
568 ProcessSamples(blockSize, buffer.get());
569
570 samplePos += blockSize;
571
572 // Update the Progress meter
573 if (TrackProgress(count, (samplePos - start).as_double() / len.as_double())) {
574 bLoopSuccess = false;
575 break;
576 }
577 }
578
579 FinishTrack();
580
581 if (!mDoProfile) {
582 // Flush the output WaveTrack (since it's buffered)
583 mOutputTrack->Flush();
584
585 // Take the output track and insert it in place of the original
586 // sample data (as operated on -- this may not match mT0/mT1)
587 if (bLoopSuccess) {
588 double t0 = mOutputTrack->LongSamplesToTime(start);
589 double tLen = mOutputTrack->LongSamplesToTime(len);
590 // Filtering effects always end up with more data than they started with. Delete this 'tail'.
591 mOutputTrack->HandleClear(tLen, mOutputTrack->GetEndTime(), false, false);
592 track->ClearAndPaste(t0, t0 + tLen, mOutputTrack.get(), true, false);
593 }
594 }
595
596 return bLoopSuccess;
597}
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:23
@ floatSample
Definition: SampleFormat.h:34
char * samplePtr
Definition: SampleFormat.h:49
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={}) const
Definition: Effect.cpp:693
bool Get(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override
Definition: WaveTrack.cpp:2112
size_t GetMaxBlockSize() const override
This returns a nonnegative number of samples meant to size a memory buffer.
Definition: WaveTrack.cpp:1806
size_t GetBestBlockSize(sampleCount t) const override
This returns a nonnegative number of samples meant to size a memory buffer.
Definition: WaveTrack.cpp:1788
void ClearAndPaste(double t0, double t1, const Track *src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=NULL)
Definition: WaveTrack.cpp:915
Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory={}, bool keepLink=true) const
Definition: WaveTrack.cpp:705
double as_double() const
Definition: SampleCount.h:45

References sampleCount::as_double(), WaveTrack::ClearAndPaste(), WaveTrack::EmptyCopy(), FinishTrack(), floatSample, WaveTrack::Get(), WaveTrack::GetBestBlockSize(), WaveTrack::GetMaxBlockSize(), limitSampleBufferSize(), mDoProfile, mInSampleCount, mOutputTrack, ProcessSamples(), StartNewTrack(), and Effect::TrackProgress().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessSamples()

void EffectNoiseRemoval::ProcessSamples ( size_t  len,
float *  buffer 
)
private

Definition at line 360 of file NoiseRemoval.cpp.

361{
362 while(len && mOutSampleCount < mInSampleCount) {
363 size_t avail = wxMin(len, mWindowSize - mInputPos);
364 for(size_t i = 0; i < avail; i++)
365 mInWaveBuffer[mInputPos + i] = buffer[i];
366 buffer += avail;
367 len -= avail;
368 mInputPos += avail;
369
370 if (mInputPos == int(mWindowSize)) {
372 if (mDoProfile)
373 GetProfile();
374 else
375 RemoveNoise();
377
378 // Rotate halfway for overlap-add
379 for(size_t i = 0; i < mWindowSize / 2; i++) {
381 }
383 }
384 }
385}

References FillFirstHistoryWindow(), GetProfile(), mDoProfile, mInputPos, mInSampleCount, mInWaveBuffer, mOutSampleCount, mWindowSize, RemoveNoise(), and RotateHistoryWindows().

Referenced by FinishTrack(), and ProcessOne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveNoise()

void EffectNoiseRemoval::RemoveNoise ( )
private

Definition at line 465 of file NoiseRemoval.cpp.

466{
467 size_t center = mHistoryLen / 2;
468 size_t start = center - mMinSignalBlocks/2;
469 size_t finish = start + mMinSignalBlocks;
470
471 // Raise the gain for elements in the center of the sliding history
472 for (size_t j = 0; j < mSpectrumSize; j++) {
473 float min = mSpectrums[start][j];
474 for (size_t i = start+1; i < finish; i++) {
475 if (mSpectrums[i][j] < min)
476 min = mSpectrums[i][j];
477 }
478 if (min > mSensitivityFactor * mNoiseThreshold[j] && mGains[center][j] < 1.0) {
479 if (mbLeaveNoise) mGains[center][j] = 0.0;
480 else mGains[center][j] = 1.0;
481 } else {
482 if (mbLeaveNoise) mGains[center][j] = 1.0;
483 }
484 }
485
486 // Decay the gain in both directions;
487 // note that mOneBlockAttackDecay is less than 1.0
488 // of linear attenuation per block
489 for (size_t j = 0; j < mSpectrumSize; j++) {
490 for (size_t i = center + 1; i < mHistoryLen; i++) {
491 if (mGains[i][j] < mGains[i - 1][j] * mOneBlockAttackDecay)
492 mGains[i][j] = mGains[i - 1][j] * mOneBlockAttackDecay;
493 if (mGains[i][j] < mNoiseAttenFactor)
495 }
496 for (size_t i = center; i--;) {
497 if (mGains[i][j] < mGains[i + 1][j] * mOneBlockAttackDecay)
498 mGains[i][j] = mGains[i + 1][j] * mOneBlockAttackDecay;
499 if (mGains[i][j] < mNoiseAttenFactor)
501 }
502 }
503
504
505 // Apply frequency smoothing to output gain
506 int out = mHistoryLen - 1; // end of the queue
507
508 ApplyFreqSmoothing(mGains[out].get());
509
510 // Apply gain to FFT
511 for (size_t j = 0; j < (mSpectrumSize-1); j++) {
512 mFFTBuffer[j*2 ] = mRealFFTs[out][j] * mGains[out][j];
513 mFFTBuffer[j*2+1] = mImagFFTs[out][j] * mGains[out][j];
514 }
515 // The Fs/2 component is stored as the imaginary part of the DC component
517
518 // Invert the FFT into the output buffer
519 InverseRealFFTf(mFFTBuffer.get(), hFFT.get());
520
521 // Overlap-add
522 for(size_t j = 0; j < (mSpectrumSize-1); j++) {
523 mOutOverlapBuffer[j*2 ] += mFFTBuffer[hFFT->BitReversed[j] ] * mWindow[j*2 ];
524 mOutOverlapBuffer[j*2+1] += mFFTBuffer[hFFT->BitReversed[j]+1] * mWindow[j*2+1];
525 }
526
527 // Output the first half of the overlap buffer, they're done -
528 // and then shift the next half over.
529 if (mOutSampleCount >= 0) { // ...but not if it's the first half-window
531 mWindowSize / 2);
532 }
534 for(size_t j = 0; j < mWindowSize / 2; j++) {
536 mOutOverlapBuffer[j + (mWindowSize / 2)] = 0.0;
537 }
538}
void InverseRealFFTf(fft_type *buffer, const FFTParam *h)
Definition: RealFFTf.cpp:264

References ApplyFreqSmoothing(), floatSample, hFFT, InverseRealFFTf(), mbLeaveNoise, mFFTBuffer, mGains, mHistoryLen, mImagFFTs, min(), mMinSignalBlocks, mNoiseAttenFactor, mNoiseThreshold, mOneBlockAttackDecay, mOutOverlapBuffer, mOutputTrack, mOutSampleCount, mRealFFTs, mSensitivityFactor, mSpectrums, mSpectrumSize, mWindow, and mWindowSize.

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RotateHistoryWindows()

void EffectNoiseRemoval::RotateHistoryWindows ( )
private

Definition at line 416 of file NoiseRemoval.cpp.

417{
418 // Remember the last window so we can reuse it
423}
void Rotate(ArraysOf< float > &arrays, size_t historyLen)

References mGains, mHistoryLen, mImagFFTs, mRealFFTs, mSpectrums, and anonymous_namespace{NoiseRemoval.cpp}::Rotate().

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowHostInterface()

int EffectNoiseRemoval::ShowHostInterface ( wxWindow &  parent,
const EffectDialogFactory factory,
std::shared_ptr< EffectInstance > &  pInstance,
EffectSettingsAccess access,
bool  forceModal = false 
)
overridevirtual

An override still here for historical reasons, ignoring the factory and the access

We would like to make this effect behave more like others, but it does have its unusual two-pass nature. First choose and analyze an example of noise, then apply noise reduction to another selection. That is difficult to fit into the framework for managing settings of other effects.

Reimplemented from Effect.

Definition at line 162 of file NoiseRemoval.cpp.

166{
167 // Assign the out parameter
168 pInstance = MakeInstance();
169 if (pInstance && !pInstance->Init())
170 pInstance.reset();
171
172 // to do: use forceModal correctly
173 NoiseRemovalDialog dlog(this, access, &parent);
174 dlog.mSensitivity = mSensitivity;
175 dlog.mGain = -mNoiseGain;
176 dlog.mFreq = mFreqSmoothingHz;
177 dlog.mTime = mAttackDecayTime;
178 dlog.mbLeaveNoise = mbLeaveNoise;
179 dlog.mKeepSignal->SetValue(!mbLeaveNoise);
180 dlog.mKeepNoise->SetValue(mbLeaveNoise);
181
182 // We may want to twiddle the levels if we are setting
183 // from a macro editing dialog
184 bool bAllowTwiddleSettings = forceModal;
185
186 if (mHasProfile || bAllowTwiddleSettings) {
187 dlog.m_pButton_Preview->Enable(GetNumWaveTracks() != 0);
188 dlog.m_pButton_RemoveNoise->SetDefault();
189 } else {
190 dlog.m_pButton_Preview->Enable(false);
191 dlog.m_pButton_RemoveNoise->Enable(false);
192 }
193
194 dlog.TransferDataToWindow();
195 dlog.mKeepNoise->SetValue(dlog.mbLeaveNoise);
196 dlog.CentreOnParent();
197 dlog.ShowModal();
198
199 const auto returnCode = dlog.GetReturnCode();
200 if (!returnCode)
201 return 0;
202
203 mSensitivity = dlog.mSensitivity;
204 mNoiseGain = -dlog.mGain;
205 mFreqSmoothingHz = dlog.mFreq;
206 mAttackDecayTime = dlog.mTime;
207 mbLeaveNoise = dlog.mbLeaveNoise;
208
209 gPrefs->Write(wxT("/Effects/NoiseRemoval/NoiseSensitivity"), mSensitivity);
210 gPrefs->Write(wxT("/Effects/NoiseRemoval/NoiseGain"), mNoiseGain);
211 gPrefs->Write(wxT("/Effects/NoiseRemoval/NoiseFreqSmoothing"), mFreqSmoothingHz);
212 gPrefs->Write(wxT("/Effects/NoiseRemoval/NoiseAttackDecayTime"), mAttackDecayTime);
213 gPrefs->Write(wxT("/Effects/NoiseRemoval/NoiseLeaveNoise"), mbLeaveNoise);
214
215 mDoProfile = (dlog.GetReturnCode() == 1);
216 if (!gPrefs->Flush())
217 return 0;
218 return returnCode;
219}
int GetNumWaveTracks() const
Definition: Effect.h:187
Dialog used with EffectNoiseRemoval.
Definition: NoiseRemoval.h:138
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Definition: Effect.cpp:128

References FileConfig::Flush(), Effect::GetNumWaveTracks(), gPrefs, NoiseRemovalDialog::m_pButton_Preview, NoiseRemovalDialog::m_pButton_RemoveNoise, StatefulEffect::MakeInstance(), mAttackDecayTime, mbLeaveNoise, NoiseRemovalDialog::mbLeaveNoise, mDoProfile, NoiseRemovalDialog::mFreq, mFreqSmoothingHz, NoiseRemovalDialog::mGain, mHasProfile, NoiseRemovalDialog::mKeepNoise, NoiseRemovalDialog::mKeepSignal, mNoiseGain, mSensitivity, NoiseRemovalDialog::mSensitivity, NoiseRemovalDialog::mTime, and NoiseRemovalDialog::TransferDataToWindow().

Here is the call graph for this function:

◆ StartNewTrack()

void EffectNoiseRemoval::StartNewTrack ( )
private

Definition at line 341 of file NoiseRemoval.cpp.

342{
343 for(size_t i = 0; i < mHistoryLen; i++) {
344 for(size_t j = 0; j < mSpectrumSize; j++) {
345 mSpectrums[i][j] = 0;
347 mRealFFTs[i][j] = 0.0;
348 mImagFFTs[i][j] = 0.0;
349 }
350 }
351
352 for(size_t j = 0; j < mWindowSize; j++)
353 mOutOverlapBuffer[j] = 0.0;
354
355 mInputPos = 0;
356 mInSampleCount = 0;
357 mOutSampleCount = -(int)((mWindowSize / 2) * (mHistoryLen - 1));
358}

References mGains, mHistoryLen, mImagFFTs, mInputPos, mInSampleCount, mNoiseAttenFactor, mOutOverlapBuffer, mOutSampleCount, mRealFFTs, mSpectrums, mSpectrumSize, and mWindowSize.

Referenced by ProcessOne().

Here is the caller graph for this function:

◆ SupportsAutomation()

bool EffectNoiseRemoval::SupportsAutomation ( ) const
overridevirtual

Whether the effect has any automatable controls.

Reimplemented from Effect.

Definition at line 133 of file NoiseRemoval.cpp.

134{
135 return false;
136}

Friends And Related Function Documentation

◆ NoiseRemovalDialog

friend class NoiseRemovalDialog
friend

Definition at line 126 of file NoiseRemoval.h.

Member Data Documentation

◆ hFFT

HFFT EffectNoiseRemoval::hFFT
private

Definition at line 108 of file NoiseRemoval.h.

Referenced by End(), FillFirstHistoryWindow(), Initialize(), and RemoveNoise().

◆ mAttackDecayBlocks

int EffectNoiseRemoval::mAttackDecayBlocks
private

Definition at line 113 of file NoiseRemoval.h.

Referenced by Initialize().

◆ mAttackDecayTime

double EffectNoiseRemoval::mAttackDecayTime
private

◆ mbLeaveNoise

bool EffectNoiseRemoval::mbLeaveNoise
private

◆ mDoProfile

bool EffectNoiseRemoval::mDoProfile
private

◆ mFFTBuffer

Floats EffectNoiseRemoval::mFFTBuffer
private

Definition at line 109 of file NoiseRemoval.h.

Referenced by End(), FillFirstHistoryWindow(), Initialize(), and RemoveNoise().

◆ mFreqSmoothingBins

int EffectNoiseRemoval::mFreqSmoothingBins
private

Definition at line 112 of file NoiseRemoval.h.

Referenced by ApplyFreqSmoothing(), and Initialize().

◆ mFreqSmoothingHz

double EffectNoiseRemoval::mFreqSmoothingHz
private

◆ mGains

ArraysOf<float> EffectNoiseRemoval::mGains
private

◆ mHasProfile

bool EffectNoiseRemoval::mHasProfile
private

Definition at line 68 of file NoiseRemoval.h.

Referenced by EffectNoiseRemoval(), Process(), and ShowHostInterface().

◆ mHistoryLen

size_t EffectNoiseRemoval::mHistoryLen
private

◆ mImagFFTs

ArraysOf<float> EffectNoiseRemoval::mImagFFTs
private

◆ mInputPos

int EffectNoiseRemoval::mInputPos
private

Definition at line 106 of file NoiseRemoval.h.

Referenced by ProcessSamples(), and StartNewTrack().

◆ mInSampleCount

sampleCount EffectNoiseRemoval::mInSampleCount
private

Definition at line 104 of file NoiseRemoval.h.

Referenced by FinishTrack(), ProcessOne(), ProcessSamples(), and StartNewTrack().

◆ mInWaveBuffer

Floats EffectNoiseRemoval::mInWaveBuffer
private

Definition at line 119 of file NoiseRemoval.h.

Referenced by End(), FillFirstHistoryWindow(), Initialize(), and ProcessSamples().

◆ mLevel

int EffectNoiseRemoval::mLevel
private

Definition at line 69 of file NoiseRemoval.h.

Referenced by CheckWhetherSkipEffect(), and Init().

◆ mMinSignalBlocks

size_t EffectNoiseRemoval::mMinSignalBlocks
private

Definition at line 117 of file NoiseRemoval.h.

Referenced by GetProfile(), Initialize(), and RemoveNoise().

◆ mMinSignalTime

float EffectNoiseRemoval::mMinSignalTime
private

Definition at line 75 of file NoiseRemoval.h.

Referenced by EffectNoiseRemoval(), and Initialize().

◆ mNoiseAttenFactor

float EffectNoiseRemoval::mNoiseAttenFactor
private

Definition at line 115 of file NoiseRemoval.h.

Referenced by FillFirstHistoryWindow(), Initialize(), RemoveNoise(), and StartNewTrack().

◆ mNoiseGain

double EffectNoiseRemoval::mNoiseGain
private

◆ mNoiseThreshold

Floats EffectNoiseRemoval::mNoiseThreshold
private

Definition at line 79 of file NoiseRemoval.h.

Referenced by EffectNoiseRemoval(), End(), GetProfile(), Initialize(), and RemoveNoise().

◆ mOneBlockAttackDecay

float EffectNoiseRemoval::mOneBlockAttackDecay
private

Definition at line 114 of file NoiseRemoval.h.

Referenced by Initialize(), and RemoveNoise().

◆ mOutOverlapBuffer

Floats EffectNoiseRemoval::mOutOverlapBuffer
private

Definition at line 120 of file NoiseRemoval.h.

Referenced by End(), Initialize(), RemoveNoise(), and StartNewTrack().

◆ mOutputTrack

std::shared_ptr<WaveTrack> EffectNoiseRemoval::mOutputTrack
private

Definition at line 103 of file NoiseRemoval.h.

Referenced by End(), ProcessOne(), and RemoveNoise().

◆ mOutSampleCount

sampleCount EffectNoiseRemoval::mOutSampleCount
private

Definition at line 105 of file NoiseRemoval.h.

Referenced by FinishTrack(), GetProfile(), ProcessSamples(), RemoveNoise(), and StartNewTrack().

◆ mRealFFTs

ArraysOf<float> EffectNoiseRemoval::mRealFFTs
private

◆ mSampleRate

double EffectNoiseRemoval::mSampleRate
private

Definition at line 72 of file NoiseRemoval.h.

Referenced by Initialize().

◆ mSensitivity

double EffectNoiseRemoval::mSensitivity
private

◆ mSensitivityFactor

float EffectNoiseRemoval::mSensitivityFactor
private

Definition at line 116 of file NoiseRemoval.h.

Referenced by Initialize(), and RemoveNoise().

◆ mSpectrums

ArraysOf<float> EffectNoiseRemoval::mSpectrums
private

◆ mSpectrumSize

size_t EffectNoiseRemoval::mSpectrumSize
private

◆ mWindow

Floats EffectNoiseRemoval::mWindow
private

Definition at line 110 of file NoiseRemoval.h.

Referenced by End(), Initialize(), and RemoveNoise().

◆ mWindowSize

size_t EffectNoiseRemoval::mWindowSize
private

◆ Symbol

const ComponentInterfaceSymbol EffectNoiseRemoval::Symbol { XO("Noise Removal") }
static

Definition at line 39 of file NoiseRemoval.h.

Referenced by GetSymbol().


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