# Why does the FFT of a complex variable create negative frequencies?

So I have a demodulator that streams out X and Y values. I use a spectrum analyzer within this demodulator instrument which plots the |FFT(X+iY)| against the frequency domain, which shows up with negative frequencies. There is an equal number of frequency points in both positive and negative axis.

Whereas if I take the data of X and Y directly into MATLAB, perform the FFT of this, I only get the positive half of the frequencies as seen from the spectrum analyzer.

Excuse me if my question is vague, but I am still getting to grips with DSPs and would like to understand this more.

x = dev2305.demods.sample_x{1, 1}.value; %reading X values
y = dev2305.demods.sample_y{1, 1}.value; %reading Y values
data = complex(x, y); %Create complex variable X+jY
Y = fft(data);
P2 = abs(Y/length(data));
P1 = P2(1:length(data)/2+1);
P1(2:end-1) = 2*P1(2:end-1);

f = 109900*(0:(length(data)/2))/length(data); %109,900 is the sample rate

plot(f, mag2db(P1)); %dbV
%plot(f, P1);
title('Manual MATLAB FFT')
xlabel('f /(Hz)')
ylabel('FFT|xiy| / dBV')

• could you elaborate on "take the data directly". The FFT generally produces both negative and positive frequencies, although typically with symmetry. – user28715 Nov 10 '19 at 19:26
• I stream the X and Y values over an interval into MATLAB, create a complex variable X+iY, perform the FFT of it and plot it – digeridoo Nov 10 '19 at 19:34

It's known from signal analysis that a real valued signal's Fourier transform is conjugate-symmetric $$H(w) = H^*(-w)$$ ; i.e., its positive frqeuencies are conjugate's of its negative frequencies. Hence it's not necesary to plot the whole spectrum, but just the positive half ot it is sufficient.
• x= randn(1,128) ; figure,plot( linspace(-1,1,1024), abs(fft( x, 1024))); will plot positive and negative frequencies for a real (or complex) input. – Fat32 Nov 10 '19 at 19:55