Efficient method for getting positive half axis only from FFT
Mostrar comentarios más antiguos
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 comentario
Daniel Kellett
el 9 de Nov. de 2016
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Fourier Analysis and Filtering en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!