FFT function error with higher size of data
21 次查看(过去 30 天)
显示 更早的评论
I want to do 2D FFT for 1100x 32x 16384 and 1100x 32x36864 size of data.
i have added sample code here .I could able to do FFT upto 1100x32x4096 data.If try for 1100x 32x 16384 data matlab throws error "Requested 2048x32x16384 (16.0GB) array exceeds maximum array size preference. Creation of arrays greater than this limit
may take a long time and cause MATLAB to become unresponsive."
How to do FFT for higher size of data without any error?
%%%%%%%%%%My matlab code used for 2D FFT %%%%%%%%%%%%%%%%
Nrow= 128;
Ncol=128;
input_data = rand(1100,32,Nrow*Ncol);
Nr = size(input_data,1);
Nd = size(input_data,2);
Nant = size(input_data,3);
rng_window = hann(Nr);
dop_window = hann(Nd)';
range_NFFT = 2^nextpow2(Nr);
doppler_NFFT = 2^nextpow2(Nd);
rng_fft_input = input_data .* rng_window;
Xrng_fft_output = fft(rng_fft_input,range_NFFT);
dop_fft_input = Xrng_fft_output .* dop_window;
yout_1 =fft(dop_fft_input,doppler_NFFT,2);
yout_2= fftshift(yout_1,2);
Xrngdop_output= fftshift(yout_2,1);
%%%%%%%%%%My matlab code used for 2D FFT %%%%%%%%%%%%%%%%
回答(2 个)
atharva
2023-12-19
Hey Mani,
I understand that you face the error "Requested 2048x32x16384 (16.0GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive." when trying to do 2-D fast Fourier transformation.
To perform the 2D FFT for larger data sizes without encountering the "exceeds maximum array size preference" error, you can use the fft2 function instead of performing separate 1D FFTs along the rows and columns.
The fft2 function is used to compute the two-dimensional discrete Fourier transform (DFT) of an image or a matrix. It takes a two-dimensional input signal and returns its frequency domain representation.
You can go through the official MathWorks documentation for a better understanding
I hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!