32template <
typename FloatType>
33static inline FloatType ncos (
size_t order,
size_t i,
size_t size)
noexcept
35 return std::cos (
static_cast<FloatType
> (order * i)
39template <
typename FloatType>
42 fillWindowingTables (size, type, normalise,
beta);
45template <
typename FloatType>
47 bool normalise, FloatType
beta)
noexcept
49 windowTable.
resize (
static_cast<int> (size));
50 fillWindowingTables (windowTable.getRawDataPointer(), size, type, normalise,
beta);
53template <
typename FloatType>
56 FloatType
beta)
noexcept
62 for (
size_t i = 0; i < size; ++i)
63 samples[i] =
static_cast<FloatType
> (1);
69 auto halfSlots =
static_cast<FloatType
> (0.5) *
static_cast<FloatType
> (size - 1);
71 for (
size_t i = 0; i < size; ++i)
78 for (
size_t i = 0; i < size; ++i)
81 samples[i] =
static_cast<FloatType
> (0.5 - 0.5 *
cos2);
88 for (
size_t i = 0; i < size; ++i)
91 samples[i] =
static_cast<FloatType
> (0.54 - 0.46 *
cos2);
98 constexpr FloatType alpha = 0.16f;
100 for (
size_t i = 0; i < size; ++i)
105 samples[i] =
static_cast<FloatType
> (0.5 * (1 - alpha) - 0.5 *
cos2 + 0.5 * alpha *
cos4);
112 for (
size_t i = 0; i < size; ++i)
118 samples[i] =
static_cast<FloatType
> (0.35875 - 0.48829 *
cos2 + 0.14128 *
cos4 - 0.01168 *
cos6);
125 for (
size_t i = 0; i < size; ++i)
141 for (
size_t i = 0; i < size; ++i)
143 / ( 0.5 * (size - 1.0)), 2.0)))
158 for (
size_t i = 0; i < size; ++i)
161 auto factor =
static_cast<FloatType
> (size) / sum;
167template <
typename FloatType>
173template <
typename FloatType>
178 case rectangular:
return "Rectangular";
179 case triangular:
return "Triangular";
180 case hann:
return "Hann";
181 case hamming:
return "Hamming";
182 case blackman:
return "Blackman";
183 case blackmanHarris:
return "Blackman-Harris";
184 case flatTop:
return "Flat Top";
185 case kaiser:
return "Kaiser";
186 default: jassertfalse;
return "";
ElementType * getRawDataPointer() noexcept
void resize(int targetNumItems)
static void JUCE_CALLTYPE multiply(float *dest, const float *src, int numValues) noexcept
void multiplyWithWindowingTable(FloatType *samples, size_t size) noexcept
WindowingFunction(size_t size, WindowingMethod, bool normalise=true, FloatType beta=0)
static const char * getWindowingMethodName(WindowingMethod) noexcept
void fillWindowingTables(size_t size, WindowingMethod type, bool normalise=true, FloatType beta=0) noexcept
static const FloatType pi
static double besselI0(double x) noexcept