35 float window_param = 0.0f,
44 uint32_t
fft_size()
const {
return fft_size_; }
45 const std::vector<float>&
window()
const {
return window_; }
55 bool analyze(
const float* frame_in,
float* spectrum_out);
59 bool synthesize(
const float* spectrum_in,
float* frame_out);
62 uint32_t fft_size_ = 0;
63 std::vector<float> window_;
65 std::unique_ptr<render::GpuCompute> owned_;
66 std::vector<float> scratch_;
67 std::uint64_t device_generation_ = 0;
GPU short-time Fourier transform primitive (spectral toolkit).
Definition gpu_stft.hpp:21
bool device_usable() const
True while the prepared device can still run this STFT's work: present, not lost, and on the generati...
uint32_t fft_size() const
Definition gpu_stft.hpp:44
render::GpuCompute * compute()
The underlying GPU compute device (or null if none initialized).
Definition gpu_stft.hpp:51
bool prepare(uint32_t fft_size, signal::WindowFunction::Type window=signal::WindowFunction::Type::hann, float window_param=0.0f, render::GpuCompute *shared_device=nullptr)
shared_device (optional) reuses an existing GpuCompute so this STFT and a sibling primitive don't eac...
bool synthesize(const float *spectrum_in, float *frame_out)
spectrum_in: 2*fft_size interleaved complex.
bool analyze(const float *frame_in, float *spectrum_out)
frame_in: fft_size real samples.
bool gpu_available() const
Definition gpu_stft.hpp:38
const std::vector< float > & window() const
Definition gpu_stft.hpp:45
GPU compute pipeline for non-rendering workloads (e.g.
Definition gpu_compute.hpp:48
Type
Definition windowing.hpp:43
@ hann
Definition windowing.hpp:45
Definition flow_pans.hpp:19