MATLAB Answers

FFT for long waveform

3 views (last 30 days)
MatG
MatG on 1 Oct 2020
I should take FFT of a very long vector of length 1,636,399,763 (i.e. length order is 10^9). However, on 128 GB RAM, my code throws "Out of Memory" error on line "part2Vec = repmat(part2Vec_OneRepetition, 1000, 1)" from script below which is attempting to build a vector of length "1,636,763,000" before even attempting to build "totalVec" which is of length "1,636,399,763" and take fft which would be of length "nFftLen = 2,147,483,648".
Any thoughts how do do this? For instance, can I take FFT in chuncks and if yes, how I can do that?
%part1Vec = this is a "complex" column vector of length "1,636,763". Also, "complex" means each element is a complex number a+b*j.
%part2Vec_OneRepetition = this is a complex column vector of length "1,636,763"
part2Vec = repmat(part2Vec_OneRepetition, 1000, 1); % This is a complex column vector of length "1,636,763,000".
totalVec = [part1Vec ; part2Vec]; % This is a complex column vector of length "1,638,399,763".
nLen = length(totalVec);% This is "1,638,399,763".
nFftLen = 2.^(nextpow2(nLen));
myFft = fftshift(fft(totalVec, nFftLen));

  0 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!