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< Num_T > right(int nr) const
Get the right nr elements from the vector.
Definitions of converters between different vector and matrix types.
#define it_assert(t, s)
Abort if t is not true.
ITPP_EXPORT void ifft_real(const cvec &in, vec &out)
Inverse Real Fast Fourier Transform.
vec cosh(const vec &x)
Cosine hyperbolic function.
vec acosh(const vec &x)
Inverse cosine hyperbolic function.
double pow10(double x)
Calculate ten to the power of x (10^x)
bool is_even(int x)
Return true if x is an even integer.
vec sqrt(const vec &x)
Square root of the elements.
double cheb(int n, double x)
Chebyshev polynomial of the first kind.
Vec< T > reverse(const Vec< T > &in)
Reverse the input vector.
vec linspace(double from, double to, int points)
linspace (works in the same way as the MATLAB version)
vec sin(const vec &x)
Sine function.
vec cos(const vec &x)
Cosine function.
vec sqrt_win(int n)
Square root window.
vec hamming(int n)
Hamming window.
vec triang(int n)
Triangular window.
vec hanning(int n)
Hanning window.
vec blackman(int n)
Blackman window.
vec hann(int n)
Hanning window compatible with matlab.
vec chebwin(int n, double at)
Dolph-Chebyshev window.
IT++ compatibility types and functions.
cvec to_cvec(const Vec< T > &v)
Converts a Vec<T> to cvec.
const Array< T > concat(const Array< T > &a, const T &e)
Append element e to the end of the Array a.
const double pi
Constant Pi.
Mat< Num_T > elem_mult(const Mat< Num_T > &m1, const Mat< Num_T > &m2)
Element wise multiplication of two matrices.
Definitions of operators for vectors and matricies of different types.
Definitions of special vectors and matrices.
Trigonometric and hyperbolic functions - header file.
Definitions of window functions.