Inverse Fast Fourier Transform

快速傅里叶逆变换(Inverse Fast Fourier Transform,以下简称IFFT)是离散傅里叶逆变换(Inverse Discrete Fourier Transform,以下简称IDFT)的快速算法, 是时域一频域变换分析中最基本的方法之一。该算法可以实现数据从频域到时域之间的转换。

算子效果

时域输入数据参数频域输出数据
imagep_size = HB_HPL_FFT16
normalize = 0
dataType = HB_HPL_DATA_TYPE_I16
imFormat = HB_IM_FORMAT_SEPARATE
numDimensionSize = 1
image

原理

请参考FFT章节原理

API接口

int32_t hbIFFT1D(hbUCPTaskHandle_t *taskHandle, hbHPLImaginaryData *dst, hbHPLImaginaryData const *src, hbIFFTParam const *param);

详细接口信息请查看 hbIFFT1D

使用方法

// Include the header #include "hobot/hb_ucp.h" #include "hobot/hpl/hb_hpl.h" #include "hobot/hpl/hb_ifft.h" // init, allocate memory for data src_length = 1024 * 1024 * 5; hbUCPMallocCached(&src_re_mem, src_length, 0); hbUCPMallocCached(&src_im_mem, src_length, 0); hbHPLImaginaryData src; src.realDataVirAddr = src_re_mem.virAddr; src.realDataPhyAddr = src_re_mem.phyAddr; src.imDataVirAddr = src_im_mem.virAddr; src.imDataPhyAddr = src_im_mem.phyAddr; src.numDimensionSize = 1; src.dataType = HB_HPL_DATA_TYPE_I16; src.imFormat = HB_IM_FORMAT_SEPARATE; src.dimensionSize[0] = 16 * 11; hbUCPMallocCached(&dst_re_mem, src_length, 0); hbUCPMallocCached(&dst_im_mem, src_length, 0); hbHPLImaginaryData dst; dst.realDataVirAddr = dst_re_mem.virAddr; dst.realDataPhyAddr = dst_re_mem.phyAddr; dst.imDataVirAddr = dst_im_mem.virAddr; dst.imDataPhyAddr = dst_im_mem.phyAddr; dst.numDimensionSize = 1; dst.dataType = HB_HPL_DATA_TYPE_I16; dst.imFormat = HB_IM_FORMAT_SEPARATE; dst.dimensionSize[0] = 16 * 11; // init param hbIFFTParam param; param.pSize = HB_FFT_POINT_SIZE_16; param.normalize = 0; // init task handle and schedule param hbUCPTaskHandle_t task_handle{nullptr}; hbUCPSchedParam sched_param; HB_UCP_INITIALIZE_SCHED_PARAM(&sched_param); sched_param.backend = HB_UCP_DSP_CORE_0; // create task hbIFFT1D(&task_handle, &dst, &src, &param); // submit task hbUCPSubmitTask(task_handle, &sched_param); // wait for task done hbUCPWaitTaskDone(task_handle, 0); // release task handle hbUCPReleaseTask(task_handle); // release memory hbUCPFree(&src_re_mem); hbUCPFree(&src_im_mem); hbUCPFree(&dst_re_mem); hbUCPFree(&dst_im_mem);