fft

GPU library that implements Image Convolution using cuFFT?

孤人 提交于 2019-12-24 15:25:45
问题 I've been using the image convolution function from Nvidia Performance Primitives (NPP). However, my kernel is fairly large with respect to the image size, and I've heard rumors that NPP's convolution is a direct convolution instead of an FFT-based convolution. (I don't think the NPP source code is available, so I'm not sure how it's implemented.) I'd like to see how fast a cuFFT-based convolution function could run in the image processing application that I'm working on. You might say "hey,

Numerical differentiation via numpy FFT

我与影子孤独终老i 提交于 2019-12-24 14:27:52
问题 I am learning how to use numpy for Fast Fourier transform differentiation. In the code below, I create a simple sine function and try to get the cosine. The result is shown in the image, there seems to be a normalization factor which I do not understand despite reading the documentation and which prevents me from getting the correct results. Can you tell me how to get rid of the normalization factor or if I am failing in a different way? Also please explain why the Nyquist frequency is not

Boolean convolution using integer multiplication

两盒软妹~` 提交于 2019-12-24 14:16:44
问题 In algorithms presented in Bringmann16 article a Boolean convolution is suggested to use to get sumset for two sets of positive integers. In above work both sets are represented as bitmasks - indicator vectors. If represent them as polynomials in form 1 + bit(0) * x + bit(1) * x^2 + ... + bit(i) * x^(i + 1) + ... + bit(n - 1) * x^n , then indeed their product contains only those monomials, whose power is number either in first set, or in second set or in sumset. The coefficients of product

Matlab: fourier coefficients of sign() function are oscillating

隐身守侯 提交于 2019-12-24 11:08:11
问题 I'm writing a function that takes in a time-varying signal and returns the FFT. It follows the Matlab documentation: https://www.mathworks.com/help/matlab/math/fourier-transforms.html https://www.mathworks.com/help/matlab/ref/fftshift.html It works well for really simple sums of sinusoids. For other simulated signals, like step functions, I end up with something fubar, that oscillates in a sawtooth-like fashion. Here is a minimal example using a heaviside step function, that plots the

Using Fourier Analysis to fit function to data

送分小仙女□ 提交于 2019-12-24 10:48:34
问题 I have 24 values for Y and corresponding 24 values for the Y values are measured experimentally, while t has values : t=[1,2,3........24] I want to find the relationship between Y and t as an equation using Fourier analysis, what I have tried and done is: I wrote the following MATLAB code: Y=[10.6534 9.6646 8.7137 8.2863 8.2863 8.7137 9.0000 9.5726 11.0000 12.7137 13.4274 13.2863 13.0000 12.7137 12.5726 13.5726 15.7137 17.4274 18.0000 18.0000 17.4274 15.7137 14.0297 12.4345]; ts=1; % step t=1

Tutorial, tricks and banana skins for discrete Fourier transformation (FT) in python

て烟熏妆下的殇ゞ 提交于 2019-12-24 08:18:56
问题 I am interested in usefull tricks and and banana skins when doing Fourier transformation in python. Please give introductive code examples to get into the topic, as well as more advise in advanced topics like: frequency filters, continuous FT, high dimensional FT . 回答1: Getting started with 2 dimensional discrete Fourier transformation in python (numpy): 1. Frequency ordering One should be carefull with the ordering of frequencies by the numpy.fft library. The fft routine orders first zero,

Sympy Simplify eliminate imaginary numbers

帅比萌擦擦* 提交于 2019-12-24 05:31:36
问题 I'm trying to get the cosine similarity between convolved vectors. Because I'm using fast fourier transform, I am using complex numbers. In the calculation of the cosine similarity, the final value returned should be a real number. However, my output is including imaginary parts: 1.0*(-1.53283653303955 + 6.08703605256546e-17*I)/(sqrt(5.69974497311137 + 5.55111512312578e-17*I)*sqrt(14.2393958011541 - 3.46944695195361e-18*I)) The imaginary portions should be zero (which they effectively are),

shift the elements of a vector by non-integer shift in matlab

你。 提交于 2019-12-24 04:44:09
问题 I want to shift a vector by non-integer shift, linear interpolation seems to be not very accurate so I'm trying to use sinc interpolation by the following code which uses Fourier transform. function y = fshift(x,s) % FSHIFT Fractional circular shift % Syntax: % % >> y = fshift(x,s) % % FSHIFT circularly shifts the elements of vector x by a (possibly % non-integer) number of elements s. FSHIFT works by applying a linear % phase in the spectrum domain and is equivalent to CIRCSHIFT for integer

Matlab FFT vs OpenCv DFT

痞子三分冷 提交于 2019-12-24 04:39:07
问题 I'm trying to convert some Matlab code to OpenCv and have problems with FFT. I've read topics with similar problem, but I still don't get what's wrong with my code (or my FFT-thinking). When I do it in MATLAB: A = [1 2 3; 4 5 6;7 8 9]; %the simplest matrix i can think of dft(A,[],1) %this should be 1-dim forward fft I get: ans = 12.0000 + 0.0000i 15.0000 + 0.0000i 18.0000 + 0.0000i -4.5000 + 2.5981i -4.5000 + 2.5981i -4.5000 + 2.5981i -4.5000 - 2.5981i -4.5000 - 2.5981i -4.5000 - 2.5981i But

Hilbert Transform (Analytical Signal) using Apple's Accelerate Framework?

纵饮孤独 提交于 2019-12-24 04:11:37
问题 I am having issues with getting a Matlab equivalent Hilbert transform in C++ with using Apple's Accelerate Framework . I have been able to get vDSP's FFT algorithm working and, with the help of Paul R's post, have managed to get the same outcome as Matlab. I have read both: this stackoverflow question by Jordan and have read the Matlab algorithm (under the 'Algorithms' sub-heading). To sum the algorithm up in 3 stages: Take forward FFT of input. Zero reflection frequencies and double