SoDaRadio-5.0.3-master:8901fb5
|
Rational Resampler. More...
#include <ReSampler.hxx>
Public Member Functions | |
ReSampler (unsigned int interp_ratio, unsigned int decim_ratio, unsigned int _inlen, unsigned int filter_len) | |
Constructor. More... | |
unsigned int | apply (std::complex< float > *in, std::complex< float > *out, float gain=1.0) |
apply the resampler to a buffer of IQ samples. More... | |
unsigned int | apply (float *in, float *out, float gain=1.0) |
apply the resampler to a buffer of scalar samples. More... | |
Private Member Functions | |
void | CreateFilter (unsigned int filter_len) |
create a filter bank for a polyphase resampler. More... | |
Private Attributes | |
int | filter_len |
the length of the polyphase filter that we're using. More... | |
unsigned int | iM |
unsigned int | dN |
unsigned int | Q |
unsigned int | tail_index |
unsigned int | inlen |
unsigned int | M |
unsigned int | N |
std::complex< float > ** | c_filt |
filter bank for interp/deci filter More... | |
std::complex< float > * | filt_fft |
the filtered image of the input stream More... | |
std::complex< float > * | interp_res |
the interpolation result More... | |
std::complex< float > * | in_fft |
the result of the first fft stage More... | |
std::complex< float > * | inbuf |
the fft input buffer More... | |
float | transform_gain |
float | gain_correction |
fftwf_plan | in_fft_plan |
fftwf_plan | mid_ifft_plan |
Rational Resampler.
Create a resampler that upsamples by an interpolation rate and downsamples by a decimation rate.
Definition at line 41 of file ReSampler.hxx.
SoDa::ReSampler::ReSampler | ( | unsigned int | interp_ratio, |
unsigned int | decim_ratio, | ||
unsigned int | _inlen, | ||
unsigned int | filter_len | ||
) |
Constructor.
interp_ratio | upsample rate |
decim_ratio | downsample rate |
_inlen | the input buffer length (output buffer will be _inlin * interp_ratio / decimation_ratio) |
filter_len | the minimum length of the antialiasing filter |
Definition at line 82 of file ReSampler.cxx.
References c_filt, CreateFilter(), dN, filt_fft, filter_len, iM, in_fft, in_fft_plan, inbuf, inlen, interp_res, ipow(), M, mid_ifft_plan, N, Q, tail_index, and transform_gain.
unsigned int SoDa::ReSampler::apply | ( | std::complex< float > * | in, |
std::complex< float > * | out, | ||
float | gain = 1.0 |
||
) |
apply the resampler to a buffer of IQ samples.
in | input buffer |
out | output buffer |
gain | – multiply output by gain |
Definition at line 272 of file ReSampler.cxx.
References c_filt, dN, filt_fft, iM, in_fft, in_fft_plan, inbuf, interp_res, M, mid_ifft_plan, N, Q, tail_index, and transform_gain.
Referenced by SoDa::ReSample48to625::apply(), SoDa::ReSample625to48::apply(), and main().
unsigned int SoDa::ReSampler::apply | ( | float * | in, |
float * | out, | ||
float | gain = 1.0 |
||
) |
apply the resampler to a buffer of scalar samples.
in | input buffer |
out | output buffer |
gain | – multiply output by gain |
Definition at line 322 of file ReSampler.cxx.
References c_filt, dN, filt_fft, iM, in_fft, in_fft_plan, inbuf, interp_res, M, mid_ifft_plan, N, Q, tail_index, and transform_gain.
|
private |
create a filter bank for a polyphase resampler.
(Though we do it in the frequency domain.)
filter_len | the minimum length of the anti-alias filter |
Definition at line 171 of file ReSampler.cxx.
References c_filt, dN, filter_len, iM, and N.
Referenced by ReSampler().
|
private |
filter bank for interp/deci filter
Definition at line 87 of file ReSampler.hxx.
Referenced by apply(), CreateFilter(), and ReSampler().
|
private |
Definition at line 85 of file ReSampler.hxx.
Referenced by apply(), CreateFilter(), and ReSampler().
|
private |
the filtered image of the input stream
Definition at line 88 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
the length of the polyphase filter that we're using.
Definition at line 83 of file ReSampler.hxx.
Referenced by CreateFilter(), and ReSampler().
|
private |
Definition at line 95 of file ReSampler.hxx.
|
private |
Definition at line 85 of file ReSampler.hxx.
Referenced by apply(), CreateFilter(), and ReSampler().
|
private |
the result of the first fft stage
Definition at line 90 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 98 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
the fft input buffer
Definition at line 91 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 86 of file ReSampler.hxx.
Referenced by ReSampler().
|
private |
the interpolation result
Definition at line 89 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 86 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 99 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 86 of file ReSampler.hxx.
Referenced by apply(), CreateFilter(), and ReSampler().
|
private |
Definition at line 85 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 85 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().
|
private |
Definition at line 94 of file ReSampler.hxx.
Referenced by apply(), and ReSampler().