3 #ifndef VISR_LIBRBBL_CORE_CONVOLVER_UNIFORM_HPP_INCLUDED 4 #define VISR_LIBRBBL_CORE_CONVOLVER_UNIFORM_HPP_INCLUDED 16 #include <initializer_list> 32 template<
typename SampleType >
59 std::size_t numberOfOutputs,
60 std::size_t blockLength,
61 std::size_t maxFilterLength,
62 std::size_t maxFilterEntries,
64 std::size_t alignment = 0,
65 char const * fftImplementation =
"default" );
105 void clearFilters( );
118 void setImpulseResponse(
SampleType const * ir, std::size_t filterLength, std::size_t filterIdx, std::size_t alignment = 0 );
120 void processInputs(
SampleType const *
const input, std::size_t channelStride, std::size_t alignment );
125 void processFilter( std::size_t inputIndex, std::size_t filterIndex,
SampleType gain,
126 FrequencyDomainType * result,
bool add );
128 void transformOutput( FrequencyDomainType
const * fdBlock,
SampleType * tdResult );
137 static std::size_t calculateNumberOfPartitions( std::size_t filterLength, std::size_t blockLength );
142 static std::size_t calculateDftSize( std::size_t blockLength );
149 static std::size_t calculateDftRepresentationSizePadded( std::size_t blockLength, std::size_t alignment );
157 SampleType calculateFilterScalingFactor()
const;
160 inline FrequencyDomainType * getFdlBlock( std::size_t inputIdx, std::size_t blockIdx );
162 inline FrequencyDomainType
const * getFdlBlock( std::size_t inputIdx, std::size_t blockIdx )
const;
164 inline FrequencyDomainType * getFdFilterPartition( std::size_t filterIdx, std::size_t blockIdx );
166 inline FrequencyDomainType
const * getFdFilterPartition( std::size_t filterIdx, std::size_t blockIdx )
const;
184 void setFilter( FrequencyDomainType
const * transformedFilter, std::size_t filterIdx, std::size_t alignment = 0 );
194 void transformImpulseResponse(
SampleType const * ir, std::size_t irLength, FrequencyDomainType * result, std::size_t alignment = 0 )
const;
201 static std::size_t calculateDftRepresentationSize( std::size_t blockLength );
208 std::size_t
const mAlignment;
210 std::size_t
const mComplexAlignment;
212 std::size_t
const mNumberOfInputs;
214 std::size_t
const mNumberOfOutputs;
216 std::size_t
const mBlockLength;
218 std::size_t
const mMaxFilterLength;
220 std::size_t
const mNumberOfFilterPartitions;
225 std::size_t
const mDftSize;
229 std::size_t
const mDftRepresentationSizePadded;
239 std::size_t mFdlCycleOffset;
255 std::unique_ptr<rbbl::FftWrapperBase<SampleType> > mFftRepresentation;
264 template<
typename SampleType>
268 assert( inputIdx < mNumberOfInputs );
269 assert( blockIdx < mNumberOfFilterPartitions );
270 std::size_t
const columnIdx = ((mFdlCycleOffset + blockIdx) % mNumberOfFilterPartitions) * mDftRepresentationSizePadded;
271 return mInputFDL.row( inputIdx ) + columnIdx;
274 template<
typename SampleType>
278 assert( inputIdx < mNumberOfInputs );
279 assert( blockIdx < mNumberOfFilterPartitions );
280 std::size_t
const columnIdx = ((mFdlCycleOffset + blockIdx) % mNumberOfFilterPartitions) * mDftRepresentationSizePadded;
281 return mInputFDL.row( inputIdx) + columnIdx;
284 template<
typename SampleType>
289 assert( filterIdx < maxNumberOfFilterEntries() );
290 assert( blockIdx < mNumberOfFilterPartitions );
291 std::size_t
const columnIdx = blockIdx * mDftRepresentationSizePadded;
292 return mFilterPartitionsFrequencyDomain.row( filterIdx ) + columnIdx;
295 template<
typename SampleType>
299 assert( filterIdx < maxNumberOfFilterEntries( ) );
300 assert( blockIdx < mNumberOfFilterPartitions );
301 std::size_t
const columnIdx = blockIdx * mDftRepresentationSizePadded;
302 return mFilterPartitionsFrequencyDomain.row( filterIdx ) + columnIdx;
308 #endif // #ifndef VISR_LIBRBBL_CORE_CONVOLVER_UNIFORM_HPP_INCLUDED
Definition: options.cpp:10
std::complex< DataType > FrequencyDomainType
Definition: fft_wrapper_base.hpp:22
float SampleType
Definition: constants.hpp:14