MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / updateFftSize

Method updateFftSize

src/audio_effects/STFT.cpp:62–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62void STFT::updateFftSize(const int new_fft_size)
63{
64 if (new_fft_size != fft_size)
65 {
66 fft_size = new_fft_size;
67 fft = std::make_unique<juce::dsp::FFT>(log2(fft_size));
68
69 input_buffer_length = fft_size;
70 input_buffer.clear();
71 input_buffer.setSize(num_channels, input_buffer_length);
72
73 output_buffer_length = fft_size;
74 output_buffer.clear();
75 output_buffer.setSize(num_channels, output_buffer_length);
76
77 fft_window.realloc(fft_size);
78 fft_window.clear(fft_size);
79
80 time_domain_buffer.realloc(fft_size);
81 time_domain_buffer.clear(fft_size);
82
83 frequency_domain_buffer.realloc(fft_size);
84 frequency_domain_buffer.clear(fft_size);
85
86 input_buffer_write_position = 0;
87 output_buffer_write_position = 0;
88 output_buffer_read_position = 0;
89 samples_since_last_FFT = 0;
90 }
91}
92
93void STFT::updateHopSize(const int new_overlap)
94{

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected