# 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, 2019 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 Nov 10, 2019 at 19:34

It's about the type of signal being analysed.

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.

However, a complex signal's Fourier transform does not posses this symmetry property and the whole spectrum would contain relevant information about the signal, therefore you should consider not only the positive frequencies but also the negative frequencies when you analyse a complex valued signal.

• Yeah, that makes sense (on the surface), thanks! I'm still reading up on Fourier transforms, and would like to understand this property more. Nov 10, 2019 at 19:42
• Do you know how it would be possible to plot the negative frequencies of the data in MATLAB? Nov 10, 2019 at 19:47
• 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. Nov 10, 2019 at 19:55
• Hmm, I tried your code by using linspace to plot the frequency domain but I think my fft domain is wrong since my data is a complex variable Nov 10, 2019 at 20:23