Efficient method for getting positive half axis only from FFT
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!