- Replicate your 2D matrix along the third dimension to simulate a 3D dataset.
- Apply the fftn function to perform the 3D Fourier transform.
FFTN on 2D distribution
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I got a known 2D distrubution of a magnetic field
and
and the following equations to expand my field with 3D Fourier Series:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499604/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499609/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499614/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499619/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499624/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499629/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499634/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499639/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499644/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499649/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499654/image.png)
Let's assume I got a 2D-matrix with amplitudes of my magnetic field strength (
and
):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499659/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1499664/image.png)
S = rand(10,10)
Since The output Y is the same size as X according to the description, I need to modifiy the matrix first. Is this done via a meshgrid or do I understand something wrong?
0 Kommentare
Antworten (1)
Shubham
am 8 Nov. 2024
It seems you are trying to perform a 3D Fourier transform on a 2D data matrix using MATLAB's fftn function. Since the original data is 2D, you will need to extend it into a 3D matrix. Here's a how you can achieve this:
Here's an example in MATLAB:
% Assuming S is your 2D matrix
S = rand(10, 10);
% Extend S to a 3D matrix by replicating it along the third dimension
S3D = repmat(S, [1, 1, 10]); % Creates a 10x10x10 matrix
% Perform 3D FFT
Y = fftn(S3D);
% Y will be a 3D matrix of the same size as S3D
The output Y will be a 3D matrix containing complex numbers that represent the amplitudes and frequency components of your data. While meshgrid is helpful for creating coordinate grids for plotting, it is not required for using fftn.
For more information on fftn, refer to the following documentation link:
Hope this helps.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!