AVIR
High-quality pro image resizing library
 
Loading...
Searching...
No Matches
avir::CDSPPeakedCosineLPF Class Reference

Low-pass filter windowed by Peaked Cosine window function. More...

#include <avir.h>

Public Member Functions

 CDSPPeakedCosineLPF (const double aLen2, const double aFreq2, const double aAlpha)
 Initalizes this object.
 
template<typename T>
void generateLPF (T *op, const double DCGain)
 Generates a linear-phase low-pass filter windowed by Peaked Cosine window function.
 

Public Attributes

int FilterLen
 Filter's length in samples (taps).
 
int fl2
 Half filter's length, excluding the peak value. This value can be also used as filter's latency in samples (taps).
 

Detailed Description

Low-pass filter windowed by Peaked Cosine window function.

This class implements calculation of linear-phase symmetric-odd FIR low-pass filter windowed by the Peaked Cosine window function, for image processing applications.

Constructor & Destructor Documentation

◆ CDSPPeakedCosineLPF()

avir::CDSPPeakedCosineLPF::CDSPPeakedCosineLPF ( const double aLen2,
const double aFreq2,
const double aAlpha )

Initalizes this object.

Parameters
aLen2Half-length (non-truncated) of low-pass filter, in samples (taps).
aFreq2Low-pass filter's corner frequency, [0; pi].
aAlphaPeaked Cosine window function Alpha parameter.

Member Function Documentation

◆ generateLPF()

template<typename T>
void avir::CDSPPeakedCosineLPF::generateLPF ( T * op,
const double DCGain )

Generates a linear-phase low-pass filter windowed by Peaked Cosine window function.

Parameters
[out]opOutput buffer, length equals FilterLen (fl2 * 2 + 1).
DCGainRequired gain at DC. The resulting filter will be normalized to achieve this DC gain. If non-positive, no automatic normalization will be performed.
Template Parameters
TFilter coefficients' type.