MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ sinc_bandpass()

MAYAFLUX_API std::vector< double > MayaFlux::Kinesis::Discrete::sinc_bandpass ( double  low_hz,
double  high_hz,
double  sample_rate,
size_t  taps 
)

Windowed-sinc bandpass FIR coefficients.

Difference of two lowpass kernels. Requires low_hz < high_hz; the arguments are swapped internally if supplied in the other order.

Parameters
low_hzLower cutoff in Hz
high_hzUpper cutoff in Hz
sample_rateSampling rate in Hz
tapsKernel length, forced odd
Returns
Coefficient vector of length taps or taps + 1

Definition at line 199 of file Coefficients.cpp.

200{
201 double lo = low_hz;
202 double hi = high_hz;
203 if (lo > hi)
204 std::swap(lo, hi);
205
206 const size_t n = force_odd(taps);
207 std::vector<double> upper = lowpass_kernel(hi, sample_rate, n);
208 const std::vector<double> lower = lowpass_kernel(lo, sample_rate, n);
209
210 for (size_t i = 0; i < n; ++i)
211 upper[i] -= lower[i];
212
213 return upper;
214}
float lo
float hi

References hi, and lo.