Efficient method for getting positive half axis only from FFT
Show older comments
So, I understand how FFT works in Matlab fairly well (or so I like to think). However, I would like to be able to do something like the following:
load(x) % time domain signal data
fs = 5e9; % sampling frequency
Nfft = 10e4; % This is to get a 50 kHz frequency resolution in the bin sizes.
df = fs/Nfft;
tempY = fft(x); % phase data doesn't matter
Y = tempY(2:(600e6/df)+1); % Extract only the first 600 MHz of the FFT omitting DC-point.
clear tempY;
The 600e6/df+1 comes out to the 12001 index. But what I would like to do is omit the temp variable entirely, or at least handle it in a more memory efficient manner. (trying to analyze 32 sets of 100 trials at a time while avoiding loops as much as possible.)
I can reduce the FFT bin size, but but for reasons outside of this post I'd prefer not to. (And even if I did, I'd like to have more efficient code in the first place since I only need the first 600 MHz of the positive half axis after the FFT.)
edit: forgot to include the clear tempY once it was done being used.
1 Comment
Daniel Kellett
on 9 Nov 2016
Accepted Answer
More Answers (0)
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!