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 (EffectBase &plugin, wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
 
bool Init () override
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 After Init(), tell whether Process() should be skipped. More...
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 
void End () override
 
- Public Member Functions inherited from StatefulEffect
 ~StatefulEffect () override
 
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 ()
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (MessagePackage &package)
 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
 
virtual unsigned GetAudioInCount () const
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const
 How many output buffers to allocate at once. More...
 
virtual sampleCount GetLatency () const
 
virtual bool NeedsDither () const
 
virtual bool ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)
 
virtual bool ProcessFinalize () noexcept
 
- 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
 
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...
 
OptionalMessage LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 
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...
 
OptionalMessage LoadFactoryPreset (int id, EffectSettings &settings) const override
 
OptionalMessage LoadFactoryDefaults (EffectSettings &settings) const override
 
virtual const EffectParameterMethodsParameters () const
 
bool CanExportPresets () const override
 Whether the effect supports export of presets to files, and importing too. More...
 
bool HasOptions () const override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatID GetSelectionFormat ()
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings, InstanceFinder finder={})
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
bool IsLinearEffect () const
 
bool PreviewsFullSelection () const
 
void SetTracks (TrackList *pTracks)
 
virtual std::any BeginPreview (const EffectSettings &settings)
 Called when Preview() starts, to allow temporary effect state changes. More...
 
bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess) override
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void CountWaveTracks ()
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual bool HasOptions () const =0
 
virtual bool CanExportPresets () const =0
 Whether the effect supports export of presets to files, and importing too. More...
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual OptionalMessage 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, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 
- 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...
 
- 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...
 
virtual std::unique_ptr< EffectOutputsMakeOutputs () const
 Produce an object to hold values to send to effect output meters. 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
 
- Public Member Functions inherited from StatefulEffectUIServices
 ~StatefulEffectUIServices () override
 
std::unique_ptr< EffectEditorPopulateUI (const EffectPlugin &plugin, ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
 Allows PopulateOrExchange to return null. More...
 
virtual std::unique_ptr< EffectEditorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs)
 Add controls to effect panel; always succeeds. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)
 
virtual bool TransferDataFromWindow (EffectSettings &settings)
 
- Public Member Functions inherited from BasicEffectUIServices
int ShowClientInterface (const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal) const override
 
void ExportPresets (const EffectPlugin &plugin, const EffectSettings &settings) const override
 
OptionalMessage ImportPresets (const EffectPlugin &plugin, EffectSettings &settings) const override
 
void ShowOptions (const EffectPlugin &plugin) const override
 
bool ValidateUI (const EffectPlugin &context, EffectSettings &) const override
 
bool CloseUI () const override
 
- Public Member Functions inherited from EffectUIServices
virtual ~EffectUIServices ()
 
virtual int ShowHostInterface (EffectBase &plugin, wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)
 
virtual int ShowClientInterface (const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal=false) const =0
 
virtual std::unique_ptr< EffectEditorPopulateUI (const EffectPlugin &plugin, ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const =0
 Adds controls to a panel that is given as the parent window of S More...
 
virtual void ExportPresets (const EffectPlugin &plugin, const EffectSettings &settings) const =0
 
virtual OptionalMessage ImportPresets (const EffectPlugin &plugin, EffectSettings &settings) const =0
 
virtual void ShowOptions (const EffectPlugin &plugin) const =0
 
virtual bool ValidateUI (const EffectPlugin &context, EffectSettings &settings) const =0
 
virtual bool CloseUI () const =0
 

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 StatefulEffectBase
using MessagePackage = EffectInstance::MessagePackage
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
using InstancePointer = std::shared_ptr< EffectInstanceEx >
 
using InstanceFinder = std::function< std::optional< InstancePointer >(EffectSettings &settings) >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , After_3_1 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Public Types inherited from EffectUIServices
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
- Static Public Member Functions inherited from EffectBase
static std::optional< InstancePointerFindInstance (EffectPlugin &plugin)
 
static InstanceFinder DefaultInstanceFinder (EffectPlugin &plugin)
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Static Public Member Functions inherited from EffectUIServices
static int DoMessageBox (const EffectPlugin &plugin, const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
- Public Attributes inherited from EffectBase
std::shared_ptr< TrackListmTracks {}
 
int mNumTracks {}
 
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
double mT0 {}
 
double mT1 {}
 
bool mIsPreview { false }
 
- Protected Member Functions inherited from Effect
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...
 
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, sampleCount *start, sampleCount *len)
 
- Protected Member Functions inherited from EffectBase
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
- Protected Attributes inherited from EffectBase
wxArrayString mPresetNames
 
unsigned mUIFlags { 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 81 of file NoiseRemoval.cpp.

82{
83 mWindowSize = 2048;
84 mSpectrumSize = 1 + mWindowSize / 2;
85
86 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseSensitivity"),
87 &mSensitivity, 0.0);
88 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseGain"),
89 &mNoiseGain, -24.0);
90 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseFreqSmoothing"),
91 &mFreqSmoothingHz, 150.0);
92 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseAttackDecayTime"),
93 &mAttackDecayTime, 0.15);
94 gPrefs->Read(wxT("/Effects/NoiseRemoval/NoiseLeaveNoise"),
95 &mbLeaveNoise, false);
96// mbLeaveNoise = false;
97
98
99 mMinSignalTime = 0.05f;
100 mHasProfile = false;
101 mDoProfile = true;
102
104
105 Init();
106}
wxT("CloseDown"))
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
void reinit(Integral count, bool initialize=false)
Definition: MemoryX.h:56
bool Init() override
virtual bool Read(const wxString &key, bool *value) const =0

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

Here is the call graph for this function:

◆ ~EffectNoiseRemoval()

EffectNoiseRemoval::~EffectNoiseRemoval ( )
virtual

Definition at line 108 of file NoiseRemoval.cpp.

109{
110}

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

After Init(), tell whether Process() should be skipped.

Implements EffectBase.

Definition at line 149 of file NoiseRemoval.cpp.

150{
151 return (mLevel == 0);
152}

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:161

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 119 of file NoiseRemoval.cpp.

120{
121 return XO("Removes constant background noise such as fans, tape noise, or hums");
122}
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ 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 114 of file NoiseRemoval.cpp.

115{
116 return Symbol;
117}
static const ComponentInterfaceSymbol Symbol
Definition: NoiseRemoval.h:39

References Symbol.

◆ GetType()

EffectType EffectNoiseRemoval::GetType ( ) const
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 126 of file NoiseRemoval.cpp.

127{
128 return EffectTypeProcess;
129}
@ EffectTypeProcess

References EffectTypeProcess.

◆ Init()

bool EffectNoiseRemoval::Init ( )
overridevirtual

Default implementation does nothing, returns true

Reimplemented from StatefulEffectBase.

Definition at line 139 of file NoiseRemoval.cpp.

140{
141 mLevel = gPrefs->Read(wxT("/Effects/NoiseRemoval/Noise_Level"), 3L);
142 if ((mLevel < 0) || (mLevel > MAX_NOISE_LEVEL)) { // corrupted Prefs?
143 mLevel = 0; //Off-skip
144 gPrefs->Write(wxT("/Effects/NoiseRemoval/Noise_Level"), mLevel);
145 }
146 return gPrefs->Flush();
147}
#define MAX_NOISE_LEVEL
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0

References audacity::BasicSettings::Flush(), gPrefs, MAX_NOISE_LEVEL, mLevel, audacity::BasicSettings::Read(), audacity::BasicSettings::Write(), and wxT().

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:30
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:335
HFFT GetFFT(size_t fftlen)
Definition: RealFFTf.cpp:104
void reinit(Integral count)
Definition: MemoryX.h:108
double mProjectRate
Definition: EffectBase.h:112

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

Implements StatefulEffectBase.

Definition at line 219 of file NoiseRemoval.cpp.

220{
221 Initialize();
222
223 // This same code will both remove noise and profile it,
224 // depending on 'mDoProfile'
225 EffectOutputTracks outputs { *mTracks, {{ mT0, mT1 }} };
226 bool bGoodResult = true;
227
228 int count = 0;
229 for (auto track : outputs.Get().Selected<WaveTrack>()) {
230 double trackStart = track->GetStartTime();
231 double trackEnd = track->GetEndTime();
232 double t0 = mT0 < trackStart? trackStart: mT0;
233 double t1 = mT1 > trackEnd? trackEnd: mT1;
234
235 if (t1 > t0) {
236 auto start = track->TimeToLongSamples(t0);
237 auto end = track->TimeToLongSamples(t1);
238 auto len = end - start;
239
240 if (!ProcessOne(count, track, start, len)) {
241 bGoodResult = false;
242 break;
243 }
244 }
245 count++;
246 }
247
248 if (bGoodResult && mDoProfile) {
249 mHasProfile = true;
250 mDoProfile = false;
251 }
252
253 if (bGoodResult)
254 outputs.Commit();
255
256 return bGoodResult;
257}
double mT1
Definition: EffectBase.h:116
std::shared_ptr< TrackList > mTracks
Definition: EffectBase.h:109
double mT0
Definition: EffectBase.h:115
bool ProcessOne(int count, WaveTrack *track, sampleCount start, sampleCount len)
Use this object to copy the input tracks to tentative outputTracks.
A Track that contains audio waveform data.
Definition: WaveTrack.h:227
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References PackedArray::end(), Initialize(), mDoProfile, mHasProfile, EffectBase::mT0, EffectBase::mT1, EffectBase::mTracks, and ProcessOne().

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:22
char * samplePtr
Definition: SampleFormat.h:57
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:317
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={}) const
Definition: Effect.cpp:343
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:2741
size_t GetBestBlockSize(sampleCount t) const
Definition: WaveTrack.cpp:2721
void ClearAndPaste(double t0, double t1, const WaveTrack &src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=nullptr, bool clearByTrimming=false)
Definition: WaveTrack.cpp:1541
Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory={}, bool keepLink=true) const
Definition: WaveTrack.cpp:1366
double as_double() const
Definition: SampleCount.h:46

References sampleCount::as_double(), WaveTrack::ClearAndPaste(), WaveTrack::EmptyCopy(), FinishTrack(), floatSample, ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::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:263

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 ( EffectBase plugin,
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 EffectUIServices.

Definition at line 160 of file NoiseRemoval.cpp.

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

References audacity::BasicSettings::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, NoiseRemovalDialog::TransferDataToWindow(), audacity::BasicSettings::Write(), and wxT().

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.

Implements EffectDefinitionInterface.

Definition at line 131 of file NoiseRemoval.cpp.

132{
133 return false;
134}

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: