Skip to content

Commit c97b8f7

Browse files
committed
More tweaks
1 parent c2609cb commit c97b8f7

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

examples/graphics/source/examples/SpectrumAnalyzer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ class SpectrumAnalyzerDemo
392392
// FFT size selector
393393
fftSizeCombo = std::make_unique<yup::ComboBox> ("FFTSize");
394394
int fftSizeId = 1;
395-
for (int size = 32; size <= 16384; size *= 2)
395+
for (int size = 64; size <= 16384; size *= 2)
396396
fftSizeCombo->addItem (yup::String (size), fftSizeId++);
397-
fftSizeCombo->setSelectedId (8);
397+
fftSizeCombo->setSelectedId (7);
398398
fftSizeCombo->onSelectedItemChanged = [this]
399399
{
400400
updateFFTSize();
@@ -596,7 +596,7 @@ class SpectrumAnalyzerDemo
596596
void updateFFTSize()
597597
{
598598
int selectedId = fftSizeCombo->getSelectedId();
599-
currentFFTSize = 32 << (selectedId - 1); // 32, 64, 128, 256, ..., 16384
599+
currentFFTSize = 64 << (selectedId - 1); // 64, 128, 256, ..., 16384
600600

601601
// Update the analyzer component (which will update the state)
602602
analyzerComponent.setFFTSize (currentFFTSize);

modules/yup_audio_gui/displays/yup_SpectrumAnalyzerComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ float SpectrumAnalyzerComponent::getOverlapFactor() const noexcept
600600

601601
void SpectrumAnalyzerComponent::setFFTSize (int size)
602602
{
603-
jassert (isPowerOfTwo (size) && size >= 64 && size <= 16384);
603+
jassert (isPowerOfTwo (size) && size >= 64 && size <= 65536);
604604

605605
if (fftSize != size)
606606
{

modules/yup_dsp/frequency/yup_FFTProcessor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,7 @@ FFTProcessor& FFTProcessor::operator= (FFTProcessor&& other) noexcept
703703
// Public interface
704704
void FFTProcessor::setSize (int newSize)
705705
{
706-
jassert (isPowerOfTwo (newSize));
707-
jassert (newSize >= 32 && newSize <= 65536);
706+
jassert (isPowerOfTwo (newSize) && newSize >= 64 && newSize <= 65536);
708707

709708
if (newSize != fftSize)
710709
{

modules/yup_dsp/frequency/yup_SpectrumAnalyzerState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void SpectrumAnalyzerState::reset() noexcept
155155

156156
void SpectrumAnalyzerState::setFftSize (int newSize)
157157
{
158-
jassert (isPowerOfTwo (newSize) && newSize >= 64 && newSize <= 16384);
158+
jassert (isPowerOfTwo (newSize) && newSize >= 64 && newSize <= 65536);
159159

160160
if (fftSize != newSize)
161161
{

tests/yup_dsp/yup_FFTProcessor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class FFTProcessorValidation : public ::testing::Test
209209
TEST_F (FFTProcessorValidation, FormatDiagnostic)
210210
{
211211
// Debug test to understand the actual FFT output format
212-
const int size = 32; // Minimum supported size
212+
const int size = 64;
213213
FFTProcessor processor (size);
214214

215215
// Test with impulse signal
@@ -255,7 +255,7 @@ TEST_F (FFTProcessorValidation, FormatDiagnostic)
255255

256256
TEST_F (FFTProcessorValidation, StandardFormatValidation)
257257
{
258-
const int size = 32;
258+
const int size = 64;
259259
FFTProcessor processor (size);
260260

261261
// Test 1: Impulse should produce flat spectrum
@@ -325,7 +325,7 @@ TEST_F (FFTProcessorValidation, StandardFormatValidation)
325325

326326
TEST_F (FFTProcessorValidation, RealForwardTransformAccuracy)
327327
{
328-
for (int order = 5; order <= 8; ++order) // Reduced range for debugging
328+
for (int order = 6; order <= 8; ++order) // Reduced range for debugging
329329
{
330330
const int size = 1 << order;
331331
FFTProcessor processor (size);
@@ -348,7 +348,7 @@ TEST_F (FFTProcessorValidation, RealForwardTransformAccuracy)
348348

349349
TEST_F (FFTProcessorValidation, RealInverseTransformAccuracy)
350350
{
351-
for (int order = 5; order <= 8; ++order) // Reduced range for debugging
351+
for (int order = 6; order <= 8; ++order) // Reduced range for debugging
352352
{
353353
const int size = 1 << order;
354354
FFTProcessor processor (size);
@@ -427,7 +427,7 @@ TEST_F (FFTProcessorValidation, ComplexInverseTransformAccuracy)
427427

428428
TEST_F (FFTProcessorValidation, RealRoundtripConsistency)
429429
{
430-
for (int order = 5; order <= 8; ++order)
430+
for (int order = 6; order <= 8; ++order)
431431
{
432432
const int size = 1 << order;
433433
FFTProcessor processor (size);
@@ -450,7 +450,7 @@ TEST_F (FFTProcessorValidation, RealRoundtripConsistency)
450450

451451
TEST_F (FFTProcessorValidation, ComplexRoundtripConsistency)
452452
{
453-
for (int order = 5; order <= 8; ++order)
453+
for (int order = 6; order <= 8; ++order)
454454
{
455455
const int size = 1 << order;
456456
FFTProcessor processor (size);
@@ -608,8 +608,8 @@ TEST_F (FFTProcessorValidation, BackendIdentification)
608608

609609
TEST_F (FFTProcessorValidation, EdgeCaseSizes)
610610
{
611-
// Test minimum size (32) and some larger sizes
612-
for (int size : { 32, 64, 128, 1024, 2048, 4096 })
611+
// Test minimum size (64) and some larger sizes
612+
for (int size : { 64, 128, 1024, 2048, 4096 })
613613
{
614614
EXPECT_NO_THROW ({
615615
FFTProcessor processor (size);

0 commit comments

Comments
 (0)