1
$\begingroup$

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')
$\endgroup$
  • $\begingroup$ could you elaborate on "take the data directly". The FFT generally produces both negative and positive frequencies, although typically with symmetry. $\endgroup$ – user28715 Nov 10 '19 at 19:26
  • $\begingroup$ 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 $\endgroup$ – digeridoo Nov 10 '19 at 19:34
0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Yeah, that makes sense (on the surface), thanks! I'm still reading up on Fourier transforms, and would like to understand this property more. $\endgroup$ – digeridoo Nov 10 '19 at 19:42
  • $\begingroup$ Do you know how it would be possible to plot the negative frequencies of the data in MATLAB? $\endgroup$ – digeridoo Nov 10 '19 at 19:47
  • $\begingroup$ 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. $\endgroup$ – Fat32 Nov 10 '19 at 19:55
  • $\begingroup$ 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 $\endgroup$ – digeridoo Nov 10 '19 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.