## fftw: definition of the wave vector k in fourier space

Started by in comp.dsp15 years ago 4 replies

Hello everybody! I am having problems with the defintion of the k vector trying to solve a 2 and 3 dimensional differential equation in Fourier...

Hello everybody! I am having problems with the defintion of the k vector trying to solve a 2 and 3 dimensional differential equation in Fourier space, namely: div v_vector(x)=c*d(x). This can be written in Fourier space like: v_vector(k)=i**c*d(k)*k_vector/k^2. I am doing the complex to complex fftw transform of d(x) adding zero imaginary part to d(x). Now I would expect the following defint...

## FFTW multiplication, marr hildreth filter, and normalization

Started by in comp.dsp14 years ago 1 reply

Hello everybody, I am trying to filter a image and do some edge detection using the Marr Hildreth method. I have (hopefully!) two...

Hello everybody, I am trying to filter a image and do some edge detection using the Marr Hildreth method. I have (hopefully!) two problems: 1) I read the image and stores it in a array. Then, I create a laplacian of a gaussian using the same size of the imagem. I transform both using FFTW r2c_2d, do the pointwise complex multiplication, and then transform back using c2r_2d. On the returned a...

## FFTW pointwise multiplication

Started by in comp.dsp15 years ago 1 reply

I use FFTW to perform DFT and I have problem execute the pointwise multiplication, here is my code fftw_complex * fft::multiply(fftw_complex *...

I use FFTW to perform DFT and I have problem execute the pointwise multiplication, here is my code fftw_complex * fft::multiply(fftw_complex * A, fftw_complex * B) { fftw_complex * R; double scale = 1.0 / (nx * ny); R = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) *nx * ny); for(int i= 0; i < nx; i++) for(int j= 0; j < ny/2+1; j++){ int ij = i*(ny/2+1) + j; R[i][j].re = (A[ij].re *

## input to FFTW

Started by in comp.dsp17 years ago 7 replies

Hello I am trying to write a simple program to use FFTW to find FFT of both real and complex inputs. my test input array is...

Hello I am trying to write a simple program to use FFTW to find FFT of both real and complex inputs. my test input array is A={1,0,1,-1,0,1,0,-1} Now I used the example in documentation and wrote the following program but it is not giving the correct results. Also when i use this program for real inputs using fftw_plan_dft_r2c_1d() method, results are wrong. Can someone please help find...

## FFTW: Why is DC component at ends/corners

Started by in comp.dsp15 years ago 4 replies

When I get the Fourier transform of a 1D vector, with FFTW, the peak in the Fourier spectrum (or DC component) is at one end with the adjacent...

When I get the Fourier transform of a 1D vector, with FFTW, the peak in the Fourier spectrum (or DC component) is at one end with the adjacent frequency component at the other end. E.g. here is a typical Fourier spectrum. 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0, 0, 10, 20, 30, 40, 50, 60, 70 ,80, 90 It is not clear to me why it is not 0, 10, 20, 30, 40, 50, 60, 70 ,80, 90, 100, 90...

## Low-pass filtering via FFTW: artefacts and wrong scaling

Started by in comp.dsp15 years ago

Dear members, in order to convolve a greyscale image with a gaussian I used FFTW (release 3.1.1) to work in fourier domain. In detail my...

Dear members, in order to convolve a greyscale image with a gaussian I used FFTW (release 3.1.1) to work in fourier domain. In detail my initial data is lying on a 1000x10000 point grid, correspondingly I've put the gaussian bell on a 1000x1000 grid too. The gaussian distribution is normalized (i.e. integration over complete 2D equals 1) and centered on the grid around (500.5, 500.5). After tra...

## DCT for computing the 2nd derivative of a function with Neumann Boundary Condition

Started by in comp.dsp14 years ago

Hello, I am having a lot of trouble computing the Laplacian of a function with neumann boundary conditions using fftw's DCT function. I do this...

Hello, I am having a lot of trouble computing the Laplacian of a function with neumann boundary conditions using fftw's DCT function. I do this by taking the cosine transform using fftw, multiplying it by -k^2 (negative wave vectors squared), back transforming, and normalizing. Here is my fortran code. Sorry that its a bit messy. It seems to work when the periodic extention of the function l...

## FFTW: a problem with in-place 2D r2c transform

Started by in comp.dsp16 years ago 8 replies

Dear FFTW experts, I get very strange results when I try to use in-place 2D r2c transforms. Somehow, results are different for in-place and...

Dear FFTW experts, I get very strange results when I try to use in-place 2D r2c transforms. Somehow, results are different for in-place and out-of-place transforms of the same array, although an inverse transform always takes me back to my original array (after scaling). For 1D there is no difference. Please, tell me, what I'm doing wrong?! My script is as follows (I know I allocate more space...

## undersampling and FFTW

Started by in comp.dsp15 years ago 3 replies

Hello, I have a problem with my fftw complex transform (1d) when I want to undersample my signal. I start with initial signal (Dimension...

Hello, I have a problem with my fftw complex transform (1d) when I want to undersample my signal. I start with initial signal (Dimension 16384points), and get the FFT of this signal in complex with fftw_plan_dft_1d (result is a 16384points dimension too). This signal has 128 first non-zero values and last 128 points non zero values. Between, all is close to 0 (10e-15). I want to undersa...

## Vowel recognizer using FFTW

Started by in comp.dsp15 years ago 13 replies

Hi! I must build a vowel recognizer using the library FFTW: analyzing a .wav file, I must retrieve the fundamental and the armonics, then...

Hi! I must build a vowel recognizer using the library FFTW: analyzing a .wav file, I must retrieve the fundamental and the armonics, then compare these with fundamental and armonics of other .wav files previously archived to choose the vowel "most" closeness. i followed these steps: - first, I load the samples from the .wav file into an array of fftw_complex, using 0.0 as imaginary parts; ...

## FFTW question about larger output array than input

Started by in comp.dsp15 years ago 4 replies

Hi, I am using FFTW to obtain freq values from an audio signal.The input and output arrays are the same size. However, I need more precision...

Hi, I am using FFTW to obtain freq values from an audio signal.The input and output arrays are the same size. However, I need more precision (i need to detect frequencies which aren't whole numbers) therefore as i understand it i need a larger output array than my input one. i am using the real-to-real fftw_plan_r2r_1d function as follows: fftw_plan_r2r_1d (numSamples, in, out, FFTW_R...

## one dimensional FFT of a MATRIX

Started by in comp.dsp14 years ago 1 reply

Hello every one I am new to FFTW library and currently i am using version FFTW3.1.2. My problem is i have a real no matrix of size 32 x 2048...

Hello every one I am new to FFTW library and currently i am using version FFTW3.1.2. My problem is i have a real no matrix of size 32 x 2048 and i want to calculate one-dimensional real to complex FFT of all 32 rows(each with 2048 points) using FFTW library. One simple approach in my mind is to use for loop for 32 times and compute one-dimensional FFT of each row saperately using "fftw_pl...

## FFTW Library error

Started by in comp.dsp16 years ago 3 replies

Hi; I use Visual C++.NET and FFTW library to calculate fft ,when i compile my program i always have a liker error ,i don't how to solve...

Hi; I use Visual C++.NET and FFTW library to calculate fft ,when i compile my program i always have a liker error ,i don't how to solve this error,may i need to include certain library ? LINK : fatal error LNK1104: cannot open file 'libm.lib' I already include fftw3.h at the begining of the program and in the program's properties I included these libraries libfftw.lib libfftw_sse2.li...

## FFTW, Imlib & OpenCV

Started by in comp.dsp16 years ago 28 replies

Hi there, I am working on an image processing project. I am trying to represent an image in terms of signal and then calculate contrast using...

Hi there, I am working on an image processing project. I am trying to represent an image in terms of signal and then calculate contrast using that signal representation of the image. I know that inorder to represent an image in terms of signal a FFT has to be performed. I am using FFTW to calcuate the FFT. My dilema is that i m using opencv(open computer vision lib)to do other parts of t...

## How to build fftw library for vxworks running on powerpc?

Started by in comp.dsp12 years ago 1 reply

Hi all, I am planning to use fftw library for one of our project using Powerpc 744x running Windriver vxworks 6.x on it instead of a COTS...

Hi all, I am planning to use fftw library for one of our project using Powerpc 744x running Windriver vxworks 6.x on it instead of a COTS signal processing library. Although it is little bit straightforward to build a generic library for x86 platform, there exist a problem in the vxworks case. The output of the cygwin is as follows. Any idea that to recover the problem will help a lot. ...

## Using FFTW to calculate derivatives

Started by in comp.dsp15 years ago 4 replies

Hello! I want to use FFTW to calculate derivatives. But it doesn't work. I think I make a big mistake, but I couldn't find it. I calculate...

Hello! I want to use FFTW to calculate derivatives. But it doesn't work. I think I make a big mistake, but I couldn't find it. I calculate the fourier transform, multiply the coefficents with -i*k, and transform back. My code is: void TestFFTW() { fstream o1,o2; o1.open("out1.txt", ios::out); o2.open("out2.txt", ios::out); int N=1000; std::complex * c=new std

## 2D FFT's and FFTW

Started by in comp.dsp16 years ago 1 reply

There's is something that I don't understand about FFTW. I already successfully performed FFT's in 1D (for sound), but when it comes to images,...

There's is something that I don't understand about FFTW. I already successfully performed FFT's in 1D (for sound), but when it comes to images, there's something that i dont understand and dont know how to deal with : fftw_plan fftw_plan_r2r_2d(int nx, int ny, double *in, double *out, fftw_r2r_kind kindx, fftw_r2r_kind kindy, unsigned flags); what i dont understand in this is the double ...

## Same input ,different ans? matlab Vs FFTW

Started by in comp.dsp15 years ago 2 replies

For learning use of the FFTW, i wrote a sample program,but campared with the result of Matlab,i find the ans are totally different. how can i...

For learning use of the FFTW, i wrote a sample program,but campared with the result of Matlab,i find the ans are totally different. how can i solve this problem ? thank u! i'm looking forward for ur answer. The result of Matlab: a=[1 2 3 1 2 3 1 2]; ans = 15.0000 -1.0000 + 0.5858i -1.0000 + 2.0000i -1.0000 - 3.4142i -1.0000 -1.0000 + 3.4142i -1.0000...

## Low-pass filtering via FFTW: artefacts and wrong scaling

Started by in comp.dsp9 years ago 5 replies

Dear members, I work on magneto-optical imaging (MOIF) of magnetic nanostructures. To compare exact calculations of magnetic field distributions...

Dear members, I work on magneto-optical imaging (MOIF) of magnetic nanostructures. To compare exact calculations of magnetic field distributions with experimental data, I want to perform some low-pass filtering on my theoretical simulations. As a first try I convolved my data with a gaussian kernel via complex multiplication in fourier domain using 2D complex-to-complex dft (FFTW release 3.1.1 in...

## FFTW velocity

Started by in comp.dsp15 years ago 2 replies

Hi, I'm using FFTW. First of all I inform you that I have overcome my "Altivec assist" problem through a modification of simd-altivec.h. In...

Hi, I'm using FFTW. First of all I inform you that I have overcome my "Altivec assist" problem through a modification of simd-altivec.h. In particular I have defined #define VLITF(x0, x1, x2, x3) (vector float)(x0, x1, x2, x3) #define VLITUI(x0, x1, x2, x3) (vector unsigned int)(x0, x1, x2, x3) and I have used VLITF or VLITUI on the two cases of "float" and "unsigned int" data. Now I'm...