fourier

How to get features of separate disconnected closed curves(contour) using fourier transform?

FT can only be used to select feature for a single closed curve, how can I use it for several separate disconnected closed curves as a whole? A solution in MATLAB will be the best though not mandatory. ...

Simple in-place discrete fourier transform ( DFT )

I'm writing a very simple in-place DFT. I am using the formula shown here: http://en.wikipedia.org/wiki/Discrete_Fourier_transform#Definition along with Euler's formula to avoid having to use a complex number class just for this. So far I have this: private void fft(double[] data) { double[] real = new double[256];...

Phase correlation

How can rotation angle be determined by phase correlation(using fft) of 2 images? The algorithm given in http://en.wikipedia.org/wiki/Phase_correlation returns linear shift, not angular. It also mentions images have to be converted to log-polar coordinates to compute rotation. How is this conversion achieved in python? And post conversio...

DSP - Filtering in the frequency domain via FFT

I've been playing around a little with the Exocortex implementation of the FFT, but I'm having some problems. Whenever I modify the amplitudes of the frequency bins before calling the iFFT the resulting signal contains some clicks and pops, especially when low frequencies are present in the signal (like drums or basses). However, this d...

Displaying Fourier transforms in OpenCV

Hi, I'm just learning to use OpenCV and am having a problem with using DFT. I've done a signal processing class which used MatLab, so I'm trying to go through some of the exercises we did in that class. I'm trying to get and display the FT of an image, so I can mask some of the frequencies. I'd like to be able to see the FT, so I know ho...

Why does negative number show up when I do FFT on a Gaussian?

I'm using this fftw library. Currently I'm trying to plot a 2D Gaussian in the form e^(-(x^2+y^2)/a^2). Here is the code: using namespace std; int main(int argc, char** argv ){ fftw_complex *in, *out, *data; fftw_plan p; int i,j; int w=16; int h=16; double a = 2; in = (fftw_complex*) fftw_malloc(sizeof(fftw...

F#/"Accelerator v2" DFT algorithm implementation probably incorrect

I'm trying to experiment with software defined radio concepts. From this article I've tried to implement a GPU-parallelism Discrete Fourier Transform. I'm pretty sure I could pre-calculate 90 degrees of the sin(i) cos(i) and then just flip and repeat rather than what I'm doing in this code and that that would speed it up. But so far, ...

Masking frequencies in a Fourier Transform

I'm messing around with OpenCV, and am trying to do some of the same stuff signal processing stuff I've done in MatLab. I'm looking to mask out some frequencies, so I have constructed a matrix which will do this. The problem is that there seem to be a few more steps in OpenCV than in Matlab to accomplish this. In Matlab, it's simple enou...

Public Domain or No Binary Attribution FFT Lib?

I'm looking for an FFT library to translate into the D programming language for inclusion either in a library that I'm working on or (better yet) in the standard library. I need a fairly simple FFT with decent performance, not an uber-optimized one with blazing fast performance and zero simplicity/readability. However, it must meet the...

Calculating audio pitch in MATLAB?

Yesterday I finalised the code for detecting the audio energy of a track displayed over time, which I will eventually use as part of my audio thumbnailing project. However I would also like a method that can detect the pitch of a track displayed over time, so I have 2 options from which to base my research upon. [y, fs, nb] = wavread('...

On the fly calculation of Fourier transformation in Java

I want to write a program in Java that uses fast Fourier transformation. The program reads data every 5 milliseconds seconds from sensors and is supposed to do something with the data every 200 milliseconds based on the data from the last five seconds. Is there a good library in Java that provides a way to do Fourier transformation with...

Why isn't this inverse Fourier transform giving the correct results?

I want to invert the Fourier transform of an image in MATLAB, but the result is not the original image (as it should be). There is obviously some implementation detail that I don't know about that's causing the issue. Here's the code: img = imread('img.jpg'); fft = fft2(img); inv = ifft2(fft); imshow(inv); ...

fundamental question for DSP experts (regarding FFT, IFFT)

Hello, I'm not a DSP expert, but I understand that there are two ways that I can apply a discrete time-domain filter to a discrete time-domain waveform. The first is to convolve them in the time domain, and the second is to take the FFT of both, multiply both complex spectrums, and take IFFT of the result. One key difference in these met...

Link between time and complex amplitude argument, DFT.

It's more math question than programming, but.. I have some discrete points, with time t_n and value u(t_n). i perform discrete fourier transormation using values u(t_n). now i have some complex values, as i understood absolute value is amplitude and argument is frequency, right? well my teacher said i need to compute SOMETHING using t_n...

How to use the given FFT function in C?

Sorry this is the first time for me to ask question here, I've given a FFT function void fft_1d(int n, float xr[256], float xi[256], int ntype) { /* compute the FFT of a complex signal xr and xi are the real and imaginary parts respectively xr and xi contain the signal as input and the FT as output n is the number of po...