
function [rangeProfile_fft, peakAmp, maxFreq] = rangeFFT (Idata, Qdata, param)

    cplx = zeros(param.numChirps,param.numSamplesperChirp);
    X = zeros(param.numChirps, param.numSamplesperChirp);
    Y = zeros(param.numChirps, param.numSamplesperChirp);
    
%% fasttime FFT operation

    for i=1:param.numChirps 
        
         cplx(i,:) = complex(Idata(i,:), Qdata(i,:));
         N = length(cplx(i,:));
         X(i,:) = fft(hanning(1,N).*cplx(i,:))/N;
         fx = (0:N-1)*param.adcSamplingrate/N;
         Y(i,:) = fftshift(X(i,:));
         fy = (-N/2:N/2-1)*param.adcSamplingrate/N;
         [peakAmp{i}, maxFreq{i}] = findpeaks((abs(X(i,:))),fx);


    end
%%
         figure
         plot(fy,(abs(Y(30,:))))
         xlim([0 1.5e6])
         title ("Range Profile");
         xlabel('Frequency Hz')
         ylabel('amplitude')

    
    rangeProfile_fft = X;

end