基于HLS的FFT核使用
HLS的FFT库结构体定义
结构体定义及头文件包含
#include <stdio.h>
#include <complex>
#include "hls_fft.h"
const char FFT_INPUT_WIDTH = 32;
const char FFT_OUTPUT_WIDTH = FFT_INPUT_WIDTH;
const char FFT_CONFIG_WIDTH = 24;
const char FFT_NFFT_MAX = 10;
const int FFT_LENGTH = 1 << FFT_NFFT_MAX;
struct config1 : hls::ip_fft::params_t
{
static const unsigned input_width = FFT_INPUT_WIDTH;
static const unsigned output_width = FFT_OUTPUT_WIDTH;
static const unsigned ordering_opt = hls::ip_fft::natural_order;
static const unsigned config_width = FFT_CONFIG_WIDTH;
static const bool has_nfft = true;
static const unsigned max_nfft = FFT_NFFT_MAX;
};
const int max = 1 << FFT_INPUT_WIDTH; // might not work for > 32 bits!
const int max_half_minus_one = (max/2)-1