How to interpret a spectrum with FFT mirroring? I have this code which interprets a few data points on magnetic field strength into a spectrum, as shown below:
c = fft(magfield);
c = c*2/n;
ca = abs(c);
dt = 1/fs;
f = (0:n-1)/(500*dt);

for i = 1:length(ca)
    if ca(i) &gt; 0.002608
        ca(i) = 0; 
    end
end

spectrum = fftshift(ca);
plot(spectrum)
    

Where fs is 5e5 and n is 50000000. what i get is a graph which looks like the one below:

I have no idea how to interpret the spectrum, where the peak frequencies are and why this mirroring effect is happening. Could you guys please shed some light on what's going on?
Thanks!
Your field data is real (as in &quot;not complex&quot;) and hence your spectrum is conjugate symmetric.
fftshift() rotates the spectrum so that 0 Hz is in the middle of the vector. Your x-axis on the plot should be fs*[-nFFT/2:nFFT/2-1]/nFFT; where $nFFT$ is the FFT length and $fs$ is the sampling rate.
Remember that time discrete signals are periodic in frequency the second half of the spectrum represents the negative frequencies.