- Define the size of your domain and grid points. Let's say you have an NxNxN grid.
- Define the physical size of your domain. Let's say it is LxLxL.
- Compute the spacing between grid points in each direction, dx = dy = dz = L/N.
- Compute the Nyquist frequency in each direction, ξ_nyq = π/dx.
- Compute the set of Fourier wave numbers in each direction, ξx = [-ξ_nyq, -ξ_nyq + 2π/L, ..., ξ_nyq - 2π/L, ξ_nyq], ξy = [-ξ_nyq, -ξ_nyq + 2π/L, ..., ξ_nyq - 2π/L, ξ_nyq], ξz = [-ξ_nyq, -ξ_nyq + 2π/L, ..., ξ_nyq - 2π/L, ξ_nyq]. You can use the fftfreq function from numpy.fft module to generate the frequency values.
- Compute the set of physical coordinates in each direction, x = [-L/2, -L/2 + dx, ..., L/2 - dx], y = [-L/2, -L/2 + dy, ..., L/2 - dy], z = [-L/2, -L/2 + dz, ..., L/2 - dz].
- Compute the spectral coefficient matrix using the 3D FFT of the physical data: ufourier = fftn(u_1).
- Compute the physical data using the inverse 3D FFT of the spectral data: uinverse = ifftn(u_2).
FFT ifft data turbulence
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I was wondering if you could kindly help me with this problem I've been facing.
I only have the velocity field u(x) and corresponding Fourier modes u(ξ)) from a direct numerical simulation (DNS, NxNxN points). I need to reproduce the spectral coefficient matrix by 3D FFT of the physical one and the physical data by inverse FFT of the spectral data. How do I compute the physical coordinates(x,y,z) and Fourier wave numbers(ξx,y,z) ?
data_spectral = load('uvw_fourier.mat'); u,v,w = 192x192x192
data_physical = load('uvw_physical.mat');
u_1 = data_physical.u;
ufourier = fftn(u_1);
u_2 = data_spectral.uk;
uinverse = ifftn(u_2);
0 commentaires
Réponses (1)
Sivapriya Srinivasan
le 26 Avr 2023
Modifié(e) : Sivapriya Srinivasan
le 26 Avr 2023
Hello Luke Souza,
To compute the physical coordinates (x,y,z) and Fourier wave numbers (ξx,y,z) from the velocity field u(x) and its corresponding Fourier modes u(ξ), you can follow these steps:
Note that in step 5, we include the Nyquist frequency in the set of Fourier wave numbers because the FFT algorithm assumes that the input signal is periodic, and the Nyquist frequency represents the highest possible frequency in a periodic signal.
Also can you please share the matlab files which you have used for further help
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Transforms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!