Questions tagged [dft]

Discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis.

Given a sequence of N samples f(n), indexed by n = 0..N-1, the discrete Fourier transform (DFT) is defined as F(k), where k=0..N-1:

Enter image description here

Source: engineeringproductivitytools

428 questions
2
votes
0 answers

Inaccurate result with opencv DFT (FW and backward)

I wanted to perform some denoising operations using opencv's DFT by doing forward fourier performing some operations and the doing the inverse fourier. But I started to notice that in some cases noise appears out of nowhere. So I tested just doing…
paghdv
  • 554
  • 1
  • 4
  • 14
2
votes
2 answers

Writing Own fft2() Function on MATLAB

I want to write my own 2 Dimensional DFT function with reduced loops. What I try to implement is Discrete Fourier Transform: Using the separability property of transform (actually exponential function), we can write this as multiplication of two…
mehmet
  • 1,631
  • 16
  • 21
2
votes
1 answer

MTIMES is not fully supported for integer classes. At least one input must be scalar

I'm trying to implement a 1 dimensional DFT without using Matlab built-in functions such as fft(). This is my code function [Xk] = dft1(xn) N=length(xn); n = 0:1:N-1; % row vector for n k = 0:1:N-1; % row vecor for k WN = exp(-1j*2*pi/N); % Twiddle…
Alladin
  • 1,010
  • 3
  • 27
  • 45
2
votes
1 answer

Why are negative frequencies of a discrete fourier transform appear where high frequencies are supposed to be?

i am very new to this topic, please help me understand why this happens... if i make the dft of a cos wave cos(w*x)=0.5*(exp(i*w*x)+exp(-i*w*x)) i expect to get one peak at the "w" frequency, and the negative one "-w" should not be visible, but it…
2
votes
1 answer

Convert OpenCv DFT example from C++ to Android

I want to implement follwoing OpenCV example in a Android app: http://docs.opencv.org/doc/tutorials/core/discrete_fourier_transform/discrete_fourier_transform.html My code is the foll0wing: //First convert Bitmap to Mat Mat ImageMat…
DanS
  • 183
  • 1
  • 2
  • 12
2
votes
2 answers

Chris Lomont's C# FFT - How does it work

Chris Lomont was kind enough to provide us with a neat FFT implementation using C#. The source can be found here. The RealFFT(double[] data, bool forward) function is half way down, just read the function summary (it's short :)). I am using the…
c0dehunter
  • 6,412
  • 16
  • 77
  • 139
2
votes
2 answers

convolution using DFT

im using the following code to calculate convolution of an image with a specified kernel(in my case gaussian). Everytime I get a different result and the result image is not even close to the one i obtained by convolution in the Spatial domain.…
Abhishek Thakur
  • 16,337
  • 15
  • 66
  • 97
2
votes
6 answers

Implementation of the Discrete Fourier Transform - FFT

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…
Phorce
  • 2,632
  • 13
  • 43
  • 76
2
votes
2 answers

Why do image compression algorithms process the image by sub-blocks?

For instance, consider the DFT or DCT. Precisely, what would be the differences between an image transformed by sub-blocks, and an image transformed whole? Is the resulting file size smaller? Is the algorithm more efficient? Does the transformed…
rmp251
  • 5,018
  • 4
  • 34
  • 46
2
votes
3 answers

DFT in Python taking significantly longer than C

I'm currently working on translating some C code To Python. This code is being used to help identify errors arising from the CLEAN algorithm used in Radio Astronomy. In order to do this analysis the value of the Fourier Transforms of Intensity Maps,…
1
vote
2 answers

How to Show Discrete Fourier Spectrum (DFT) of Image using OpenCV and FFTW3 library?

I am trying to Generate Fourier Spectrum of a simple image. But what I get is only noise. I have tried to follow many links which suggest to scale down the values between [0, 255] but I get only black image even after the scaling which I do that…
sinner
  • 803
  • 2
  • 11
  • 24
1
vote
1 answer

DFT with Frequency Range

We need to change/reimplement standard DFT implementation in GSL, which is int FUNCTION(gsl_dft_complex,transform) (const BASE data[], const size_t stride, const size_t n, …
baris.aydinoz
  • 1,902
  • 2
  • 18
  • 28
1
vote
4 answers

Generating a square wave for DFT

I'm working on an assignment to perform a 200 point DFT at a sampling frequency of 20kHz on a square wave of frequency 500Hz whose amplitude alternates between 0 and 20. I'm using C++ and I have figured how to code the DFT equation, my problem is…
Amanni
  • 1,924
  • 6
  • 31
  • 51
1
vote
0 answers

Is it possible to input a manual frequency axis as a function argument in np.fft and get the FFT evaluated at those frequency points?

I have an equation that can be expressed in a somewhat Fourier transform-like expression. (I can't find a way to write in latex format so I am trying to write in c code format). For a function f in a grid of M points, I evaluate a function on a kind…
1
vote
2 answers

Getting a doubled, mirrored image on the output of IDFT

I would appreciate some help understanding the output of a small educational program I put together. I am new to OpenCV and don't have much C++ experience. The goal of the script is to perform the following: Load an image Perform DFT on the…
avi
  • 170
  • 9