title: Confused with fft Matlab
body: <p>I am little bit confused with fft. That would be good if anyone can help me. first, I want to convert fft output in time domain. Where <code>t = f/k</code> and <code>K = BW/Tm</code> (<code>BW</code> = bandwidth &amp; <code>Tm</code> = transmit time). After that again i need to take fft and ouput should be box (rectangular function) which is having width of BW(40e9).  </p>
  
  <pre><code>f1 = 1e6;  % first cutoff frequency
  
  f2 = 4e6;  % second cutoff frequency
  
  BW = 40e9; % bandwidth
  
  Tm = 0.2e-3; % transmit time
  
  fs = 1e7;   % sampling frequency
  
  c = 3e8;    % speed of light
  
  w1 = f1/ (fs/2); % normalizing first cutoff frequency 
  
  w2 = f2/ (fs/2): % normalizing second cutoff frequency
  
  [b,a] = butter(2, [w1,w2], 'bandpass');
  
  load('fb2040');
  
  x = fb2040(3,:);
  
  y_filt = filter(b,a,x); % filtering
  
  nfft = length(y_filt);
  
  res = fft(y_filt, nfft)/ nfft;
  
  f = fs/2 * linspace(0,1,nfft/2+1);
  
  res = res(1:nfft/2+1);
  
  figure, plot(f,abs(res));
  
  xlabel('frequency in MHz'); 
  
  ylabel('amp');
  
  return
  </code></pre>