Make ifft2 to give real output
Afficher commentaires plus anciens
I'm trying to generate a randomly rough surface(isotropic surface). Suppose I have the absolute values of fourier components of the surface in "H" and H has symmetry with respect to center of the array. Now, I need to define some random phase for the fourier series which are between -pi to pi (due to fftshift) as in:
phi = -pi + (pi+pi)*rand(n); % random phase
Now, I don't know what to do to make the output of my surface real..
Here is the gist of the code I used so far:
[a,b] = pol2cart(phi,H);
H_complex = complex(a,b); % the complex fourier transform composed of H & phi
z = ifft2(ifftshift((H_complex)));
If I need to apply conjugate symmetry to the fourier components, how should I do it? The output is complex and I need a real surface.
Please help! Thanks a lot.
Réponse acceptée
Plus de réponses (1)
Thomas Koelen
le 20 Mai 2015
0 votes
use abs() or real()? depending on if you want only the real number or the absolute value.
1 commentaire
Mona Mahboob Kanafi
le 20 Mai 2015
Modifié(e) : Mona Mahboob Kanafi
le 20 Mai 2015
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!