File filter_core.h¶
FileList > doppler > filter > filter_core.h
Go to the source code of this file
Filter module — public C API.
#include "doppler/clib_common.h"#include "doppler/resample/resample_core.h"
Public Functions¶
| Type | Name |
|---|---|
| void | dp_design_lowpass (double fpass, double fstop, double atten_db, float * out) Design a Kaiser-windowed-sinc lowpass FIR (float32 taps). |
Public Functions Documentation¶
function dp_design_lowpass¶
Design a Kaiser-windowed-sinc lowpass FIR (float32 taps).
The tap count is chosen automatically from the band edges and the attenuation with the Kaiser FIR-length formula, n = dp_kaiser_num_taps(1, atten_db, fpass / 2, fstop / 2) | 1 (always odd, so the filter is type-I linear phase with an integer group delay of (n - 1) / 2 samples). The window shape comes from dp_kaiser_beta(), the FIR-design beta formula, not the window-sidelobe one. The ideal cutoff sits at the midpoint of the transition band, (fpass + fstop) / 2. Taps are 2 fc sinc(2 fc m) w[m] with fc in cycles/sample, then divided by their sum, so the DC gain is 1 to float precision (the windowed sinc alone misses it by up to a few percent on a short design).
Parameters:
fpassPassband edge, Nyquist-normalized (1.0 == fs/2),0 < fpass < fstop.fstopStopband edge, Nyquist-normalized (1.0 == fs/2).atten_dbTarget stopband attenuation in dB (positive).outOutput buffer for the taps. The caller must size it todp_kaiser_num_taps(1, atten_db, fpass / 2.0, fstop / 2.0) | 1floats; that many are written.
The documentation for this class was generated from the following file native/inc/doppler/filter/filter_core.h