Audacity 3.2.0
EqualizationFilter.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 EqualizationFilter.h
6
7 Mitch Golden
8 Vaughan Johnson (Preview)
9
10 Paul Licameli split from Equalization.h
11
12***********************************************************************/
13
14#ifndef __AUDACITY_EQUALIZATION_FILTER__
15#define __AUDACITY_EQUALIZATION_FILTER__
16
17#include "EqualizationParameters.h" // base class
18#include "Envelope.h" // member
19#include "RealFFTf.h" // member
21
24struct BUILTIN_EFFECTS_API EqualizationFilter : EqualizationParameters
25{
26 // Low frequency of the FFT. 20Hz is the
27 // low range of human hearing
28 static constexpr int loFreqI = 20;
29
30 // Number of samples in an FFT window
31 // MJS - work out the optimum for this at run time?
32 // Have a dialog box for it?
33 static constexpr size_t windowSize = 16384u;
34
36
39 bool CalcFilter();
40
43 void Filter(size_t len, float *buffer) const;
44
45 const Envelope &ChooseEnvelope() const
46 { return mLin ? mLinEnvelope : mLogEnvelope; }
48 { return mLin ? mLinEnvelope : mLogEnvelope; }
49
50 // If sliders show, always use the log envelope
52 { return IsLinear() ? mLinEnvelope : mLogEnvelope; }
53
54 Envelope mLinEnvelope, mLogEnvelope;
55 HFFT hFFT{ GetFFT(windowSize) };
56 Floats mFFTBuffer{ windowSize };
57 Floats mFilterFuncR{ windowSize }, mFilterFuncI{ windowSize };
58 double mLoFreq{ loFreqI };
59 double mHiFreq{ mLoFreq };
60 size_t mWindowSize{ windowSize };
61};
62#endif
HFFT GetFFT(size_t fftlen)
Definition: RealFFTf.cpp:104
std::unique_ptr< FFTParam, FFTDeleter > HFFT
Definition: RealFFTf.h:22
static const AttachedProjectObjects::RegisteredFactory manager
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
const Envelope & ChooseEnvelope() const
Envelope & ChooseEnvelope()
const Envelope & ChooseEnvelopeToPaint() const
Parameters of the Equalization effects that persist in configuration files.