SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <filtermbe.h>
Public Member Functions | |
MBEAudioInterpolatorFilter () | |
~MBEAudioInterpolatorFilter () | |
void | useHP (bool useHP) |
bool | usesHP () const |
float | run (const float &sample) |
float | runHP (const float &sample) |
float | runLP (const float &sample) |
Private Attributes | |
IIRFilter< float, 2 > | m_filterLP |
IIRFilter< float, 2 > | m_filterHP |
bool | m_useHP |
Static Private Attributes | |
static const float | m_lpa [3] = {1.0, 1.392667E+00, -5.474446E-01} |
static const float | m_lpb [3] = {3.869430E-02, 7.738860E-02, 3.869430E-02} |
static const float | m_hpa [3] = {1.000000e+00, 1.667871e+00, -7.156964e-01} |
static const float | m_hpb [3] = {8.459039e-01, -1.691760e+00, 8.459039e-01} |
Uses the generic IIR filter internally
Low pass / High pass:
This is a 2 pole Chebyshev (recursive) filter using coefficients found in table 20-1 (low pass) or table 20-2 (high pass) of http://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_Ch20.pdf
For low pass fc = 0.075 For high oass fc = 0.01
Convention taken here exchanges A and B coefficients as shown in this image: https://cdn.mikroe.com/ebooks/img/8/2016/02/digital-filter-design-chapter-03-image-2-9.gif So A applies to Y and B to X
At the interpolated sampling frequency of 48 kHz the -3 dB corner is at 48 * .075 = 3.6 kHz which is perfect for voice The high pass has a 3 dB corner of 48 * 0.01 = 0.48 kHz
Low pass:
b0 = 3.869430E-02 (a0 = 1.0) b1 = 7.738860E-02 a1 = 1.392667E+00 b2 = 3.869430E-02 a2 = -5.474446E-01
High pass:
b0 = 9.567529E-01 (a0 = 1.0) b1 = -1.913506E+00 a1 = 1.911437E+00 b2 = 9.567529E-01 a2 = -9.155749E-01
given x[n] is the new input sample and y[n] the returned output sample:
y[n] = b0*x[n] + b1*x[n] + b2*x[n] + a1*y[n-1] + a2*y[n-2]
This one works directly with floats
Definition at line 64 of file filtermbe.h.
MBEAudioInterpolatorFilter::MBEAudioInterpolatorFilter | ( | ) |
Definition at line 27 of file filtermbe.cpp.
MBEAudioInterpolatorFilter::~MBEAudioInterpolatorFilter | ( | ) |
Definition at line 34 of file filtermbe.cpp.
float MBEAudioInterpolatorFilter::run | ( | const float & | sample | ) |
Definition at line 37 of file filtermbe.cpp.
References m_filterHP, m_filterLP, m_useHP, and IIRFilter< Type, Order >::run().
float MBEAudioInterpolatorFilter::runHP | ( | const float & | sample | ) |
Definition at line 42 of file filtermbe.cpp.
References m_filterHP, and IIRFilter< Type, Order >::run().
Referenced by AMBEWorker::noUpsample(), and AMBEWorker::upsample().
float MBEAudioInterpolatorFilter::runLP | ( | const float & | sample | ) |
Definition at line 47 of file filtermbe.cpp.
References m_filterLP, and IIRFilter< Type, Order >::run().
Referenced by AMBEWorker::upsample().
|
inline |
Definition at line 70 of file filtermbe.h.
References useHP().
Referenced by AMBEWorker::handleInputMessages(), and useHP().
|
inline |
Definition at line 71 of file filtermbe.h.
Referenced by AMBEWorker::noUpsample(), and AMBEWorker::upsample().
|
private |
Definition at line 78 of file filtermbe.h.
|
private |
Definition at line 77 of file filtermbe.h.
|
staticprivate |
Definition at line 84 of file filtermbe.h.
|
staticprivate |
Definition at line 85 of file filtermbe.h.
|
staticprivate |
Definition at line 81 of file filtermbe.h.
|
staticprivate |
Definition at line 82 of file filtermbe.h.
|
private |
Definition at line 79 of file filtermbe.h.
Referenced by run().