Converts a raw sample (type T) to/from a filter's arithmetic type (FT) for ConverterNChannels. The default just casts the raw sample straight through – this matches the traditional convention used here, where FT=float and filter coefficients are calibrated against the sample's raw magnitude (e.g. up to +-32767 for 16-bit audio), so no rescaling is wanted. Specialized below for FT=q1_14_t, whose bounded ~[-2,2) range means a plain (q1_14_t)sample cast would misinterpret the raw PCM magnitude as a literal Q1.14 value and saturate almost immediately; q1_14_t::fromIntNN()/toIntNN() do the correct bit-shift scaling instead.
More...
#include <BaseConverter.h>
template<typename T, typename FT>
struct audio_tools::FilterSampleConverter< T, FT >
Converts a raw sample (type T) to/from a filter's arithmetic type (FT) for ConverterNChannels. The default just casts the raw sample straight through – this matches the traditional convention used here, where FT=float and filter coefficients are calibrated against the sample's raw magnitude (e.g. up to +-32767 for 16-bit audio), so no rescaling is wanted. Specialized below for FT=q1_14_t, whose bounded ~[-2,2) range means a plain (q1_14_t)sample cast would misinterpret the raw PCM magnitude as a literal Q1.14 value and saturate almost immediately; q1_14_t::fromIntNN()/toIntNN() do the correct bit-shift scaling instead.
◆ fromFilterType()
template<typename T , typename FT >
| static T fromFilterType |
( |
FT |
value | ) |
|
|
inlinestatic |
◆ toFilterType()
template<typename T , typename FT >
| static FT toFilterType |
( |
T |
sample | ) |
|
|
inlinestatic |
The documentation for this struct was generated from the following file: