Closed kakyoism closed 3 years ago
Hi,
univector
size is not fixed at runtime if you omit size parameter in the template.
univector<float> u1(1024); // dynamic size, like std::vector and inherited from it
univector<float, 1024> u2; // compile-time size, like std::array and inherited from it
univector<float, 0> u3(ptr_to_float, your_size); // creates array that references your data (not owns)
All kfr functions take all three options, so you are free to create dynamic, compile-time arrays or pass your pointer to avoid any data copying.
It seems to me that kfr's
univector
size is fixed at the compile time. For instance, this is how to initialize a univector if I'm not mistaken.then later when you compute the spectrum,
So it seems that the sizes must be fixed at the compile time. After all
univector
is anstd::array
.Then it's unclear to me how to achieve on-the-fly FFT size update. Should I hack it with creating a large enough univector and only down-size it by taking a portion of it when necessary?
Am I missing anything obvious?