dft

GSL Fast-Fourier Transform - Double-Valued Gaussian?

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:28:51
问题 All I want to do is evaluate the Fourier transform of a Gaussian (as a test of course), but I'm getting what looks like a double-valued function, as can be seen in the plot below. When you look closely at the tails of the Gaussian, you can see that the FFT returned values are actually oscillating between positive and negative, making the DFT look "double-valued". Why is this happening? Is there a way to fix this (without just plotting the complex modulus of course)? #include <gsl/gsl_fft

Reading out the direction and frequency of a point in the Matlab 2D DFT fft2() function

和自甴很熟 提交于 2019-12-12 03:39:55
问题 I am getting familiarized with Matlab and the function fft2() . In this toy example, I am aiming at producing the 2D DFT of the following 256 x 256 png image: To be able to understand the output easily, I try to convert this image into a 256 x 256 image, eliminating color information: Im = imread('circ.png'); pkg load image Im = rgb2gray(Im); figure, imshow(Im) After this bookkeeping preliminaries I run: A = fft2(double(Im)); A is a 256 x 256 matrix from which amplitude and phase can be

How to plot a 3d graph of 2d fft transformations with a changing parameter

社会主义新天地 提交于 2019-12-12 01:51:42
问题 I want to make a 3d plot of 2d plots of function y where y is the dft of function z with having as axis k(x) w0(y) and amplitude(y)(z), where k is the dft variable in frequency domain and w0 is a changing parameter between 0 and 4*pi/45. n=(0:255); x1 = exp(n.*(w1*1j)); x2 = 0.8.*exp(n*((w2-w0)).*1j); z =hamming(256)*(x1+x2); y = fft(abs(z)) 回答1: If I'm interpreting your question properly, you wish to have something like this: The x axis is the DFT number, the y axis is a parameter that

Load Image in Mat and Display after DFT process

老子叫甜甜 提交于 2019-12-11 19:59:13
问题 I got a problem loading image (in list/on click) in Mat on Android, and processing with OpenCV DFT function then return result. This is my src MainActivity.java public class MainActivity extends Activity { static final String CAMERA_PIC_DIR = "/DCIM/Camera/"; ImageView iv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); iv = (ImageView) findViewById(R.id.my_image); String ImageDir = Environment

OpenCV gpu::dft distorted image after inverse transform

只愿长相守 提交于 2019-12-11 13:11:46
问题 I'm working on GPU implementation of frequency filtering of an image. My code works great on CPU (I used something like this) but I have spent whole day trying to make the same work on GPU - without success. I want to apply a filter in the frequency domain hence I need the full (complex) result of the forward transform. I have read that I need to pass two complex matrices (src and dst) to forward dft to obtain full spectrum (32FC2). However, I fail to obtain the same image after inverse

有限长离散变换(DFT)理解

百般思念 提交于 2019-12-11 09:56:28
有限长离散变换(DFT)理解 DTFT与DFT的关系 DTFT与DFT的关系 之前在Signals And Systems里学傅里叶变换时讲到了几种傅里叶变换,留下了DFT放在DSP里深入学习。本质上来说DFT就是DTFT的频域采样过程,也是DSP的关键步骤。可是在学习中还是对DFT很多性质不明白 我们知道计算机能处理的都是离散的值,DTFT中得到的频谱仍然是连续的,因此需要对频谱进行一个采样的过程使之能够被计算机处理。 首先对模拟信号进行采样,对一个以2π为周期的COS函数用适当的冲激串采样后如左图所示,这里采用N=64,采样了两个周期。然后采样了一个指数函数,右图所示。 在查看DFT结果之前,先看看DTFT的结果是什么样的:由DTFT计算公式很容易推出上图,这就是理想情况下使用DFT在频域上采样后应该得到的图形。这里的横坐标应该是一个周期内的w。进行DFT的目的其实就是为了在计算机内能够得到这样一幅曲线,但是实际上DTFT的频谱是连续的,计算机只能逼近DTFT的结果,这就需要DFT对频域进行采样,将连续的频域离散化。 对频域进行采样就有了另外一个问题:频域相乘对应时域卷积,也就是说采样这个过程实际上相当于时域上卷积了一个东西,它可能改变了原有的输入信号,分别以上面两个函数为例。首先是COS函数: 左图N=64,右图N=80。 // DFT MATLAB实现 r = 2 ; N

Matlab, DFT, FFT, frequency range;

巧了我就是萌 提交于 2019-12-11 06:16:35
问题 I am really having a hard time to understand how the fft-function in MATLAB works. According to: http://www.mathworks.de/help/matlab/math/fast-fourier-transform-fft.html fs/n is the distance between the sampled points in the Spectrum, where fs is the sampling frequency and n is the length of the signal. The code that they present, does extract the frequencies (although I do not know why), but according to the implementation of fft, that they present: http://www.mathworks.de/help/matlab/ref

FFT (Bluestein and Cooley-Tukey )… unexpected peak at the begining

非 Y 不嫁゛ 提交于 2019-12-11 05:25:28
问题 some days ago I posted my FFT-Test tool with some problems, so this here is my "remake" poste with almost the same problems, but different code. Problem: I´m trying to make a tool to read some sensor values and do the fft of these. I implemented a normal DFT, a FFT(Bluestein) and a FFT(Cooley-Tukey). It all works fine and the inverse transformation shows the input like it should. The only thing is when i plot the Frequenz/Amplitude graph i have a huge peak at the begining (not only at 0 like

Implementation of the Discrete Fourier Transform - FFT

倖福魔咒の 提交于 2019-12-10 23:07:33
问题 I am trying to do a project in sound processing and need to put the frequencies into another domain. Now, I have tried to implement an FFT, that didn't go well. I tried to understand the z -transform, that didn't go to well either. I read up and found DFT's a lot more simple to understand, especially the algorithm. So I coded the algorithm using examples but I do not know or think the output is right. (I don't have Matlab on here, and cannot find any resources to test it) and wondered if you

Point-product with fft

余生颓废 提交于 2019-12-10 22:03:10
问题 According to the convolution theorem, a convolution in the time domain is a product in the fft domain. With correct zero-padding, it works: % convolution in time domain a = [1 2 3]; b = [4 5 6]; c = conv(a,b); a_padded=[a 0 0]; b_padded=[b 0 0]; c_bis=ifft(fft(a_padded).*fft(b_padded)); % we do find c_bis=c However, this theorem is suposed to work the other way around as well, a product in the time domain is a convolution in the fft domain. I dont get this part: d = a.*b; D=conv(fft(a_padded)