31template <
typename FloatType>
32static FloatType
ncos (
size_t order,
size_t i,
size_t size)
noexcept
34 return std::cos (
static_cast<FloatType
> (order *
i)
38template <
typename FloatType>
44template <
typename FloatType>
46 bool normalise, FloatType beta)
noexcept
52template <
typename FloatType>
55 FloatType beta)
noexcept
61 for (
size_t i = 0;
i <
size; ++
i)
62 samples[
i] =
static_cast<FloatType
> (1);
68 auto halfSlots =
static_cast<FloatType
> (0.5) *
static_cast<FloatType
> (
size - 1);
70 for (
size_t i = 0;
i <
size; ++
i)
71 samples[
i] =
static_cast<FloatType
> (1.0) - std::abs ((
static_cast<FloatType
> (
i) - halfSlots) / halfSlots);
77 for (
size_t i = 0;
i <
size; ++
i)
80 samples[
i] =
static_cast<FloatType
> (0.5 - 0.5 * cos2);
87 for (
size_t i = 0;
i <
size; ++
i)
90 samples[
i] =
static_cast<FloatType
> (0.54 - 0.46 * cos2);
97 constexpr FloatType alpha = 0.16f;
99 for (
size_t i = 0;
i <
size; ++
i)
104 samples[
i] =
static_cast<FloatType
> (0.5 * (1 - alpha) - 0.5 * cos2 + 0.5 * alpha * cos4);
111 for (
size_t i = 0;
i <
size; ++
i)
117 samples[
i] =
static_cast<FloatType
> (0.35875 - 0.48829 * cos2 + 0.14128 * cos4 - 0.01168 * cos6);
124 for (
size_t i = 0;
i <
size; ++
i)
131 samples[
i] =
static_cast<FloatType
> (1.0 - 1.93 * cos2 + 1.29 * cos4 - 0.388 * cos6 + 0.028 * cos8);
139 const auto doubleSize = (double)
size;
141 for (
size_t i = 0;
i <
size; ++
i)
142 samples[
i] =
static_cast<FloatType
> (
SpecialFunctions::besselI0 (beta * std::sqrt (1.0 - std::pow (((
double)
i - 0.5 * (doubleSize - 1.0))
143 / ( 0.5 * (doubleSize - 1.0)), 2.0)))
159 for (
size_t i = 0;
i <
size; ++
i)
162 auto factor =
static_cast<FloatType
> (
size) / sum;
164 FloatVectorOperations::multiply (samples, factor,
static_cast<int> (
size));
168template <
typename FloatType>
174template <
typename FloatType>
181 case hann:
return "Hann";
182 case hamming:
return "Hamming";
185 case flatTop:
return "Flat Top";
186 case kaiser:
return "Kaiser";
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
Definition juce_Windowing.h:43
WindowingMethod
Definition juce_Windowing.h:48
@ blackman
Definition juce_Windowing.h:53
@ hamming
Definition juce_Windowing.h:52
@ kaiser
Definition juce_Windowing.h:56
@ blackmanHarris
Definition juce_Windowing.h:54
@ triangular
Definition juce_Windowing.h:50
@ flatTop
Definition juce_Windowing.h:55
@ rectangular
Definition juce_Windowing.h:49
@ numWindowingMethods
Definition juce_Windowing.h:57
@ hann
Definition juce_Windowing.h:51
void multiplyWithWindowingTable(FloatType *samples, size_t size) noexcept
Definition juce_Windowing.cpp:169
WindowingFunction(size_t size, WindowingMethod, bool normalise=true, FloatType beta=0)
Definition juce_Windowing.cpp:39
Array< FloatType > windowTable
Definition juce_Windowing.h:105
static const char * getWindowingMethodName(WindowingMethod) noexcept
Definition juce_Windowing.cpp:175
void fillWindowingTables(size_t size, WindowingMethod type, bool normalise=true, FloatType beta=0) noexcept
Definition juce_Windowing.cpp:45
register unsigned i
Definition inflate.c:1575
Definition juce_AudioBlock.h:29
static FloatType ncos(size_t order, size_t i, size_t size) noexcept
Definition juce_Windowing.cpp:32
Definition carla_juce.cpp:31
constexpr Type jmin(Type a, Type b)
Definition juce_MathsFunctions.h:106
static constexpr FloatType pi
Definition juce_MathsFunctions.h:382
static double besselI0(double x) noexcept
Definition juce_SpecialFunctions.cpp:31