Requesting only a certain frequency range from FFT function
古いコメントを表示
Hello all! I'm currently working on the fft function that has 1024 input data and requires only a 400 output data (400 number of lines). Below is the code I apply.
fftGui = getappdata(0,'fftGui');
xdata = getappdata(fftGui, 'xdata');
graphselection = getappdata(fftGui, 'graphselection');
L = length(handles.y);
NFFT = L/1.28; % e.g 800
Y= fft(handles.y,NFFT);
positiveY = Y(1:((NFFT+1)/2));
normalizedY = positiveY./(L/2);
handles.amplitudeY = abs(normalizedY);
deltaT = xdata(2,graphselection) - xdata(1,graphselection)
fs = 1/deltaT
DF = fs/size(Y,1)
handles.freq = 0:DF:fs/2;
plot(handles.axes2,handles.freq(1:400),handles.amplitudeY)
grid on
The outcome produces exactly 400 number of lines as needed. However, I would like to implement where the user can apply any desired frequency range and the FFT function would perform on the time domain graph to produce the frequency domain graph only in that desired frequency range, but having 400 number of lines too.
Thanks!
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Fast Fourier Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!