Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::FFT< Real >::ISTFTProcessor Class Reference

Stateful ISTFT processor for chunked frame-by-frame synthesis. More...

#include <fft.H>

Collaboration diagram for Aleph::FFT< Real >::ISTFTProcessor:
[legend]

Public Member Functions

 ISTFTProcessor ()=default
 Default constructor for an unconfigured inverse processor.
 
 ISTFTProcessor (const size_t fft_size, const Array< Real > &analysis_window, const Array< Real > &synthesis_window, const ISTFTOptions &options)
 Construct an inverse STFT processor with custom windows.
 
 ISTFTProcessor (const size_t fft_size, const Array< Real > &window, const ISTFTOptions &options)
 Construct an inverse STFT processor with a single window.
 
 ISTFTProcessor (const size_t fft_size, const size_t frame_size, const ISTFTOptions &options)
 Construct an inverse STFT processor with a Hann window.
 
template<typename AnalysisContainer , typename SynthesisContainer >
requires Is_Real_Container<AnalysisContainer>
and Is_Real_Container< SynthesisContainerISTFTProcessor (const size_t fft_size, const AnalysisContainer &analysis_window, const SynthesisContainer &synthesis_window, const ISTFTOptions &options)
 Construct an inverse STFT processor from any real containers.
 
size_t frame_size () const noexcept
 
bool configured () const noexcept
 
size_t fft_size () const noexcept
 
size_t hop_size () const noexcept
 
bool centered () const noexcept
 
bool finalized () const noexcept
 
void reset ()
 
Array< Realprocess_frame (const Array< Complex > &spectrum)
 
Array< Realpprocess_frame (ThreadPool &pool, const Array< Complex > &spectrum, const size_t chunk_size=0)
 
Array< Realprocess_block (const Array< Array< Complex > > &spectrogram_block)
 
Array< Realpprocess_block (ThreadPool &pool, const Array< Array< Complex > > &spectrogram_block, const size_t chunk_size=0)
 
Array< Realflush ()
 
Array< Realpflush (ThreadPool &, const size_t=0)
 
template<typename Container >
requires Is_Complex_Container<Container>
Array< Realprocess_frame (const Container &spectrum)
 
template<typename Container >
requires Is_Complex_Container<Container>
Array< Realpprocess_frame (ThreadPool &pool, const Container &spectrum, const size_t chunk_size=0)
 

Private Member Functions

void require_configured (const char *ctx) const
 
void initialize_state ()
 
void ensure_pending_size (const size_t size)
 
void accumulate_frame (const Array< Real > &frame)
 
Array< Realnormalize_prefix (const size_t count)
 
Array< Realemit_samples (const Array< Real > &normalized, const bool final_flush)
 
Array< Realdrain_ready_samples (const bool final_flush)
 
Array< Realprocess_frame_impl (const Array< Complex > &spectrum, ThreadPool *pool, const size_t chunk_size)
 

Private Attributes

Array< Realanalysis_window_
 
Array< Realsynthesis_window_
 
ISTFTOptions options_
 
size_t fft_size_ = 0
 
size_t center_pad_ = 0
 
Plan plan_
 
Array< Realpending_output_
 
Array< Realpending_norm_
 
size_t frames_processed_ = 0
 
size_t emitted_raw_samples_ = 0
 
size_t left_trim_remaining_ = 0
 
size_t emitted_signal_samples_ = 0
 
bool configured_ = false
 
bool has_seen_frame_ = false
 
bool finalized_ = false
 

Detailed Description

template<std::floating_point Real = double>
class Aleph::FFT< Real >::ISTFTProcessor

Stateful ISTFT processor for chunked frame-by-frame synthesis.

Definition at line 10499 of file fft.H.

Constructor & Destructor Documentation

◆ ISTFTProcessor() [1/5]

template<std::floating_point Real = double>
Aleph::FFT< Real >::ISTFTProcessor::ISTFTProcessor ( )
default

Default constructor for an unconfigured inverse processor.

◆ ISTFTProcessor() [2/5]

template<std::floating_point Real = double>
Aleph::FFT< Real >::ISTFTProcessor::ISTFTProcessor ( const size_t  fft_size,
const Array< Real > &  analysis_window,
const Array< Real > &  synthesis_window,
const ISTFTOptions options 
)
inlineexplicit

Construct an inverse STFT processor with custom windows.

Parameters
fft_sizeFixed FFT transform size.
analysis_windowAnalysis window used during STFT.
synthesis_windowSynthesis window for reconstruction.
optionsOverlap-add parameters.

Definition at line 10695 of file fft.H.

References Aleph::FFT< Real >::ISTFTProcessor::analysis_window_, Aleph::FFT< Real >::ISTFTProcessor::fft_size_, Aleph::FFT< Real >::ISTFTProcessor::initialize_state(), Aleph::FFT< Real >::ISTFTProcessor::options_, Aleph::FFT< Real >::ISTFTProcessor::synthesis_window_, and Aleph::FFT< Real >::validate_istft_configuration().

◆ ISTFTProcessor() [3/5]

template<std::floating_point Real = double>
Aleph::FFT< Real >::ISTFTProcessor::ISTFTProcessor ( const size_t  fft_size,
const Array< Real > &  window,
const ISTFTOptions options 
)
inlineexplicit

Construct an inverse STFT processor with a single window.

Parameters
fft_sizeFixed FFT transform size.
windowWindow used for both analysis and synthesis.
optionsOverlap-add parameters.

Definition at line 10721 of file fft.H.

◆ ISTFTProcessor() [4/5]

template<std::floating_point Real = double>
Aleph::FFT< Real >::ISTFTProcessor::ISTFTProcessor ( const size_t  fft_size,
const size_t  frame_size,
const ISTFTOptions options 
)
inlineexplicit

Construct an inverse STFT processor with a Hann window.

Parameters
fft_sizeFixed FFT transform size.
frame_sizeHann window size.
optionsOverlap-add parameters.

Definition at line 10733 of file fft.H.

◆ ISTFTProcessor() [5/5]

template<std::floating_point Real = double>
and Is_Real_Container< SynthesisContainer > Aleph::FFT< Real >::ISTFTProcessor::ISTFTProcessor ( const size_t  fft_size,
const AnalysisContainer analysis_window,
const SynthesisContainer synthesis_window,
const ISTFTOptions options 
)
inlineexplicit

Construct an inverse STFT processor from any real containers.

Template Parameters
AnalysisContainerType for analysis window.
SynthesisContainerType for synthesis window.
Parameters
fft_sizeFixed FFT transform size.
analysis_windowAnalysis window.
synthesis_windowSynthesis window.
optionsOverlap-add parameters.

Definition at line 10754 of file fft.H.

Member Function Documentation

◆ accumulate_frame()

◆ centered()

template<std::floating_point Real = double>
bool Aleph::FFT< Real >::ISTFTProcessor::centered ( ) const
inlinenoexcept

◆ configured()

template<std::floating_point Real = double>
bool Aleph::FFT< Real >::ISTFTProcessor::configured ( ) const
inlinenoexcept

Definition at line 10769 of file fft.H.

References Aleph::FFT< Real >::ISTFTProcessor::configured_.

◆ drain_ready_samples()

◆ emit_samples()

◆ ensure_pending_size()

◆ fft_size()

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::fft_size ( ) const
inlinenoexcept

Definition at line 10774 of file fft.H.

References Aleph::FFT< Real >::ISTFTProcessor::fft_size_.

◆ finalized()

template<std::floating_point Real = double>
bool Aleph::FFT< Real >::ISTFTProcessor::finalized ( ) const
inlinenoexcept

Definition at line 10789 of file fft.H.

References Aleph::FFT< Real >::ISTFTProcessor::finalized_.

◆ flush()

◆ frame_size()

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::frame_size ( ) const
inlinenoexcept

◆ hop_size()

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::hop_size ( ) const
inlinenoexcept

◆ initialize_state()

◆ normalize_prefix()

◆ pflush()

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::pflush ( ThreadPool ,
const size_t  = 0 
)
inline

◆ pprocess_block()

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::pprocess_block ( ThreadPool pool,
const Array< Array< Complex > > &  spectrogram_block,
const size_t  chunk_size = 0 
)
inline

◆ pprocess_frame() [1/2]

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::pprocess_frame ( ThreadPool pool,
const Array< Complex > &  spectrum,
const size_t  chunk_size = 0 
)
inline

◆ pprocess_frame() [2/2]

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::pprocess_frame ( ThreadPool pool,
const Container spectrum,
const size_t  chunk_size = 0 
)
inline

◆ process_block()

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::process_block ( const Array< Array< Complex > > &  spectrogram_block)
inline

◆ process_frame() [1/2]

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::process_frame ( const Array< Complex > &  spectrum)
inline

◆ process_frame() [2/2]

template<std::floating_point Real = double>
Array< Real > Aleph::FFT< Real >::ISTFTProcessor::process_frame ( const Container spectrum)
inline

◆ process_frame_impl()

◆ require_configured()

◆ reset()

template<std::floating_point Real = double>
void Aleph::FFT< Real >::ISTFTProcessor::reset ( )
inline

Member Data Documentation

◆ analysis_window_

template<std::floating_point Real = double>
Array<Real> Aleph::FFT< Real >::ISTFTProcessor::analysis_window_
private

◆ center_pad_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::center_pad_ = 0
private

◆ configured_

template<std::floating_point Real = double>
bool Aleph::FFT< Real >::ISTFTProcessor::configured_ = false
private

◆ emitted_raw_samples_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::emitted_raw_samples_ = 0
private

◆ emitted_signal_samples_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::emitted_signal_samples_ = 0
private

◆ fft_size_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::fft_size_ = 0
private

◆ finalized_

◆ frames_processed_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::frames_processed_ = 0
private

◆ has_seen_frame_

template<std::floating_point Real = double>
bool Aleph::FFT< Real >::ISTFTProcessor::has_seen_frame_ = false
private

◆ left_trim_remaining_

template<std::floating_point Real = double>
size_t Aleph::FFT< Real >::ISTFTProcessor::left_trim_remaining_ = 0
private

◆ options_

◆ pending_norm_

◆ pending_output_

◆ plan_

template<std::floating_point Real = double>
Plan Aleph::FFT< Real >::ISTFTProcessor::plan_
private

Definition at line 10506 of file fft.H.

Referenced by Aleph::FFT< Real >::ISTFTProcessor::process_frame_impl().

◆ synthesis_window_

template<std::floating_point Real = double>
Array<Real> Aleph::FFT< Real >::ISTFTProcessor::synthesis_window_
private

The documentation for this class was generated from the following file: