File: kernelBlackmanLowPass.h

package info (click to toggle)
groops 0%2Bgit20250907%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 11,140 kB
  • sloc: cpp: 135,607; fortran: 1,603; makefile: 20
file content (68 lines) | stat: -rw-r--r-- 1,817 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/***********************************************/
/**
* @file kernelBlackmanLowPass.h
*
* @brief Kernel smoothed by Blackman low-pass filter
* @see Kernel
*
* @author Andreas Kvas
* @date 2019-03-01
*
*/
/***********************************************/

#ifndef __GROOPS_KERNELBLACKMANLOWPASS__
#define __GROOPS_KERNELBLACKMANLOWPASS__

// Latex documentation
#ifdef DOCSTRING_Kernel
static const char *docstringKernelBlackmanLowPass = R"(
\subsection{BlackmanLowpass}
Another \configClass{kernel}{kernelType} is smoothed by a Blackman low-pass filter. The filter is
defined through the beginning and end of the transition from pass-band to stop-band. This
transition band is specified by \config{startDegreeTransition} ($n_1$) and \config{stopDegreeTransition} ($n_2$).

The coefficients of this kernel are defined as
\begin{equation}
\begin{cases}
1 & \text{for } n < n_1 \\
A_n^2 & \text{for } n_1\leq n \leq n_2 \\
0 & \text{for } n > n_2 \\
\end{cases}
\end{equation}
with
\begin{equation}
A_n = 0.42 + 0.5\cos(\pi \frac{n-n_1}{n_2-n_1}) + 0.08 \cos(2\pi\frac{n-n_1}{n_2-n_1}).
\end{equation}
)";
#endif

/***********************************************/

#include "classes/kernel/kernel.h"

/***** CLASS ***********************************/

/** @brief Kernel smoothed by an Gaussian filter.
* @ingroup kernelGroup
* @see Kernel */
class KernelBlackmanLowPass : public Kernel
{
  KernelPtr kernel;
  UInt n1, n2;
  mutable Vector filterCoeff;

  Vector computeFilterCoefficients(UInt degree) const;

public:
  KernelBlackmanLowPass(Config &config);

  Vector   coefficients       (const Vector3d &p, UInt degree) const;
  Vector   inverseCoefficients(const Vector3d &p, UInt degree, Bool interior) const;

  UInt maxDegree() const { return n2+1; }
};

/***********************************************/

#endif