cufft

How to perform a Real to Complex Transformation with cuFFT

。_饼干妹妹 提交于 2021-02-19 06:41:25
问题 The following code has been adapted from here to apply to a single 1D transformation using cufftPlan1d. Ultimately I want to perform a batched in place R2C transformation, but code below perfroms a single transformation using a separate input and output array. How can adapt this code to perform a the transformation inplace, therefore reducing the amount of memory allocated on the device? Thanks Cuda 6.5 - Note: I'm running the code from a mexFunction in MATLAB 2015a Code: #include <stdlib.h>

Wrong results cufft 3D in-place

时间秒杀一切 提交于 2020-01-05 11:30:00
问题 I write because I'm facing problems with the cufft 3D transform in-place, while I have no problems for the out-of-place version. I tried to follow Robert Crovella's answer here but I'm not obtaining the correct results when I make a FFT+IFT. This is my code: #include <stdio.h> #include <stdlib.h> #include <cuda_runtime.h> #include <complex.h> #include <cuComplex.h> #include <cufft.h> // Main function int main(int argc, char **argv){ int N = 4; double *in = NULL, *d_in = NULL; cuDoubleComplex

Wrong results cufft 3D in-place

烈酒焚心 提交于 2020-01-05 11:29:52
问题 I write because I'm facing problems with the cufft 3D transform in-place, while I have no problems for the out-of-place version. I tried to follow Robert Crovella's answer here but I'm not obtaining the correct results when I make a FFT+IFT. This is my code: #include <stdio.h> #include <stdlib.h> #include <cuda_runtime.h> #include <complex.h> #include <cuComplex.h> #include <cufft.h> // Main function int main(int argc, char **argv){ int N = 4; double *in = NULL, *d_in = NULL; cuDoubleComplex

In place real to complex FFT with cufft

风格不统一 提交于 2019-12-25 17:39:18
问题 I am trying to perform an inplace real to complex FFT with cufft. I am aware of the similar question How to perform a Real to Complex Transformation with cuFFT. However I have issues trying to reproduce the same method. If I do an out of place transformation, there is no problem, but as soon as I do it in place, I do not have the correct values in the FFT (Checked with python, using binary files in between). I do not have errors, but just non correct values. Here is my code: void fftCuda2d

In place real to complex FFT with cufft

倾然丶 夕夏残阳落幕 提交于 2019-12-25 17:39:08
问题 I am trying to perform an inplace real to complex FFT with cufft. I am aware of the similar question How to perform a Real to Complex Transformation with cuFFT. However I have issues trying to reproduce the same method. If I do an out of place transformation, there is no problem, but as soon as I do it in place, I do not have the correct values in the FFT (Checked with python, using binary files in between). I do not have errors, but just non correct values. Here is my code: void fftCuda2d

Scaling in inverse FFT by cuFFT

こ雲淡風輕ζ 提交于 2019-12-23 10:25:57
问题 Whenever I'm plotting the values obtained by a programme using the cuFFT and comparing the results with that of Matlab, I'm getting the same shape of graphs and the values of maxima and minima are getting at the same points. However, the values resulting by the cuFFT are much greater than those resulting from Matlab. The Matlab code is fs = 1000; % sample freq D = [0:1:4]'; % pulse delay times t = 0 : 1/fs : 4000/fs; % signal evaluation time w = 0.5; % width of each pulse yp = pulstran(t,D,

Scaling in inverse FFT by cuFFT

元气小坏坏 提交于 2019-12-23 10:25:07
问题 Whenever I'm plotting the values obtained by a programme using the cuFFT and comparing the results with that of Matlab, I'm getting the same shape of graphs and the values of maxima and minima are getting at the same points. However, the values resulting by the cuFFT are much greater than those resulting from Matlab. The Matlab code is fs = 1000; % sample freq D = [0:1:4]'; % pulse delay times t = 0 : 1/fs : 4000/fs; % signal evaluation time w = 0.5; % width of each pulse yp = pulstran(t,D,

Is it possible to call cufft library calls in device function?

こ雲淡風輕ζ 提交于 2019-12-23 07:47:32
问题 I use the cuFFT library calls in a host code they work fine, but I want to call the cuFFT library from a kernel. Earlier versions of the CUDA didn't have this kind of support but with the dynamic parallelism is this possible ? It will be great if there are any examples on how to achieve this. 回答1: Despite the introduction of dynamic parallelism on Kepler (cc 3.5) cards, cuFFT remains a host API and there is currently no way of creating or executing FFT operations in device code using cuFFT.

CUFFT with double precision

a 夏天 提交于 2019-12-13 16:34:05
问题 I am experiencing some problems with CUDAs FFT library. I declared the inputs as cuDoubleComplex, but the compiler returns the error that this type is incompatible with parameters of type cufftComplex. After some search through the Internet, I found the file cufft.h, in which there is the line typedef cuComplex cufftComplex; . My problem is that in the library cuComplex.h it is clear that cuComplex has a single floating point precision ( typedef cuFloatComplex cuComplex; ), but I would like a

Getting a phase image from CUDA FFT

限于喜欢 提交于 2019-12-13 03:23:53
问题 I'm trying to apply a cuFFT, forward then inverse, to a 2D image. I need the real and complex parts as separate outputs so I can compute a phase and magnitude image. I haven't been able to recreate the input image, and also a non-zero phase is returned. In particular I am unsure if I'm correctly creating a full-size image from the reduced-size cuFFT complex output, which apparently stores only the left side of the spectrum. Here's my current code: // Load image cv::Mat_<float> img; img = cv: