50 for (
int i = 0;i < n;i++)
51 t[i] = (0.54 - 0.46 *
std::cos(2.0 *
pi * i / (n - 1)));
60 for (
int i = 0;i < n;i++)
61 t(i) = 0.5 * (1.0 -
std::cos(2.0 *
pi * (i + 1) / (n + 1)));
71 for (
int i = 0;i < n;i++)
72 t(i) = 0.5 * (1.0 -
std::cos(2.0 *
pi * i / (n - 1)));
81 for (
int i = 0;i < n;i++)
92 for (
int i = 0; i < n / 2; i++)
93 t(i) = t(n - i - 1) = 2.0 * (i + 1) / (n + 1);
97 for (
int i = 0; i < n / 2; i++)
98 t(i) = t(n - i - 1) = (2.0 * i + 1) / n;
108 for (
int i = 0; i < n / 2; i++)
109 t(i) = t(n - i - 1) =
std::sqrt(2.0 * (i + 1) / (n + 1));
113 for (
int i = 0; i < n / 2; i++)
114 t(i) = t(n - i - 1) =
std::sqrt((2.0 * i + 1) / n);
121 it_assert((n > 0),
"chebwin(): need a positive order n!");
127 at = at < 0 ? -at : at;
133 vec p =
cheb(n - 1, beta * cos_k);
139 int half_length = n / 2 + 1;
140 w = w.left(half_length) / w(1);
145 int half_length = (n + 1) / 2;
146 w = w.left(half_length) / w(0);
vec cosh(const vec &x)
Cosine hyperbolic function.
vec hamming(int n)
Hamming window.
Definitions of window functions.
Vec< T > reverse(const Vec< T > &in)
Reverse the input vector.
bool is_even(int x)
Return true if x is an even integer.
vec chebwin(int n, double at)
Dolph-Chebyshev window.
Mat< Num_T > elem_mult(const Mat< Num_T > &m1, const Mat< Num_T > &m2)
Element wise multiplication of two matrices.
vec triang(int n)
Triangular window.
Vec< Num_T > right(int nr) const
Get the right nr elements from the vector.
ITPP_EXPORT void ifft_real(const cvec &in, vec &out)
Inverse Real Fast Fourier Transform.
#define it_assert(t, s)
Abort if t is not true.
vec hann(int n)
Hanning window compatible with matlab.
double cheb(int n, double x)
Chebyshev polynomial of the first kindChebyshev polynomials of the first kind can be defined as follo...
vec sin(const vec &x)
Sine function.
Definitions of converters between different vector and matrix types.
const double pi
Constant Pi.
vec blackman(int n)
Blackman window.
Trigonometric and hyperbolic functions - header file.
vec acosh(const vec &x)
Inverse cosine hyperbolic function.
Definitions of operators for vectors and matricies of different types.
vec sqrt_win(int n)
Square root window.
double pow10(double x)
Calculate ten to the power of x (10^x)
IT++ compatibility types and functions.
Definitions of special vectors and matrices.
vec linspace(double from, double to, int points)
linspace (works in the same way as the MATLAB version)
vec hanning(int n)
Hanning window.
vec sqrt(const vec &x)
Square root of the elements.
cvec to_cvec(const Vec< T > &v)
Converts a Vec<T> to cvec.
vec cos(const vec &x)
Cosine function.
const Array< T > concat(const Array< T > &a, const T &e)
Append element e to the end of the Array a.