title: I did a step function FFT on matlab but only getting one side of the spectrum (0 to infinity)
body: <p>with this code i am only getting half og the fft spectrum from 0 to positive infinity . i am trying to mirror this along the y axis to get the other half which is symmetric to this one from 0 to negative infinity.</p>
  
  <pre><code>    Fs = 1000;   %sampling rate
      Ts = 1/Fs; %sampling time interval
      t = -10:Ts:10-Ts; %sampling period
      n = length(t); %number of samples
      y = heaviside(t)-heaviside(t-4); %the step curve
  
      matlabFFT = figure;  %create a new figure
      YfreqDomain = fft(y); %take the fft of our step funcion, y(t)
      y=abs(YfreqDomain);
      plot(y)
      xlabel('Sample Number')
      ylabel('Amplitude')
      title('Using the Matlab fft command')
      grid
      axis([-100,100,0,5000])
  </code></pre>