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)
 
template<class T>
void generateLPF (T *op, const double DCGain)
 

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 )

Constructor 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<class T>
void avir::CDSPPeakedCosineLPF::generateLPF ( T * op,
const double DCGain )

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

Parameters
[out]opOutput buffer, length = 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.