#include
#include
#include
#define _USE_MATH_DEFINES
#include
#include
//#include
#define pi M_PI
using std::vector;
void create_hidea(int n, double fc, vector& output)
{
if (!(n & 1))
n = n + 1;
if (output.size() != n)
output.resize(n);
int fn = n >> 1;
double tfc = 2 * fc;
int index = 0;
int i = -1 * fn;
double tzfc = tfc * i;
for (; i <= fn; i++)
{
double temp = i == 0 ? tfc : tfc * sin(tzfc*pi)/(tzfc*pi);
//double temp = i==0 ? tfc:tfc * nc::sinc(tzfc);
tzfc += tfc;
output[index++] = temp;
}
}
void create_hanningw(int n, vector& output)
{
if (!(n & 1))
n = n + 1;
if (output.size() != n)
output.resize(n);
double ads = 2 * pi / (n - 1);
double tz = 0.0;
for (int i=0;i win;
vector hidea;
create_hidea(n, 0.25, hidea);
create_hanningw(n, win);
for (int i = 0; i < n; i++)
{
std::cout << " " << hidea[i] * win[i];
}
std::cout << std::endl;
return 0;
}