FIR filter cache class.
More...
#include <CDSPFIRFilter.h>
FIR filter cache class.
Class that implements cache for calculated FIR filters. The required FIR filter should be obtained via the getLPFilter() static function.
◆ getLPFilter()
static CDSPFIRFilter & r8b::CDSPFIRFilterCache::getLPFilter |
( |
const double |
ReqNormFreq, |
|
|
const double |
ReqTransBand, |
|
|
const double |
ReqAtten, |
|
|
const EDSPFilterPhaseResponse |
ReqPhase, |
|
|
const double |
ReqGain, |
|
|
const double *const |
AttenCorrs = NULL |
|
) |
| |
|
static |
Function calculates or returns reference to a previously calculated (cached) low-pass FIR filter. Note that the real transition band and attenuation achieved by the filter varies with the magnitude of the required attenuation, and are never 100% exact.
- Parameters
-
ReqNormFreq | Required normalized frequency, in the range 0 to 1, inclusive. This is the point after which the stop-band spans. |
ReqTransBand | Required transition band, in percent of the 0 to ReqNormFreq spectral bandwidth, in the range CDSPFIRFilter::getLPMinTransBand() to CDSPFIRFilter::getLPMaxTransBand(), inclusive. The transition band specifies the part of the spectrum between the -3 dB and ReqNormFreq points. The real resulting -3 dB point varies in the range from -3.00 to -3.05 dB, but is generally very close to -3 dB. |
ReqAtten | Required stop-band attenuation in decibel, in the range CDSPFIRFilter::getLPMinAtten() to CDSPFIRFilter::getLPMaxAtten(), inclusive. Note that the actual stop-band attenuation of the resulting filter may be 0.40-4.46 dB higher. |
ReqPhase | Required filter's phase response. |
ReqGain | Required overall filter's gain (1.0 for unity gain). |
AttenCorrs | Attentuation correction table, to pass to the filter generation function. For internal use. |
- See also
- EDSPFilterPhaseResponse
- Returns
- A reference to a new or a previously calculated low-pass FIR filter object with the required characteristics. A reference count is incremented in the returned filter object which should be released after use via the CDSPFIRFilter::unref() function.
◆ getObjCount()
static int r8b::CDSPFIRFilterCache::getObjCount |
( |
| ) |
|
|
static |
- Returns
- The number of filters present in the cache now. This value can be monitored for debugging "forgotten" filters.