Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FFT Help in Matlab - Absolute Value or Complex Conjugate

318 views
Skip to first unread message

ms

unread,
Oct 29, 2007, 1:10:09 PM10/29/07
to
Depending on the version of Matlab, the help menu for FFT shows 2
different ways of plotting a frequency spectrum. One way is to use
the complex conjugate: Y=fft(x); Y2= Y.*conj(Y) and the other way
uses the the absolute value Y=abs(fft(x)). When I try these two
different ways(plot Y or Y2 versus frequency), my plots look very
different, and I am trying to understand why. I realize taking the
abs or conj of the signal are different, but don't know why one way
would be better than the other. Any help or reference would be
appreciated.

Randy Poe

unread,
Oct 29, 2007, 2:42:15 PM10/29/07
to
On Oct 29, 1:10 pm, ms <silvert...@gmail.com> wrote:
> Depending on the version of Matlab, the help menu for FFT shows 2
> different ways of plotting a frequency spectrum. One way is to use
> the complex conjugate: Y=fft(x); Y2= Y.*conj(Y) and the other way
> uses the the absolute value Y=abs(fft(x)). When I try these two
> different ways(plot Y or Y2 versus frequency), my plots look very
> different, and I am trying to understand why.

For a complex vector Y, Y.*conj(Y) is the same as
(abs(Y)).^2. That is, multiplying a complex number by
its conjugate gives you the magnitude squared.

So the first plot is just the square of the second.

Both should have the same shape on semilog axes, e.g.
set(gca, 'yscale', 'log')

- Randy

Randy Poe

unread,
Oct 29, 2007, 2:45:54 PM10/29/07
to
On Oct 29, 1:10 pm, ms <silvert...@gmail.com> wrote:

I should add that a "spectrum" usually refers to the
power spectrum, which is Y2. The second plot
Y = abs(fft(x)) is the amplitude, the square root of
the power spectrum. Power spectra are usually plotted
in dB units, so the squaring only affects whether you
would use 10 or 20 to calculate power in dB.

Thus:

Y = fft(x);
Y2 = Y.*conj(Y);
plot( 10*log10(Y2) );

Or:

Y = abs(fft(x))
plot( 20*log10(Y) );

Those should be the same plot.

- Randy

ms

unread,
Oct 30, 2007, 8:22:51 AM10/30/07
to

> I should add that a "spectrum" usually refers to the
> power spectrum, which is Y2. The second plot
> Y = abs(fft(x)) is the amplitude, the square root of
> the power spectrum. Power spectra are usually plotted
> in dB units, so the squaring only affects whether you
> would use 10 or 20 to calculate power in dB.
>
> Thus:
>
> Y = fft(x);
> Y2 = Y.*conj(Y);
> plot( 10*log10(Y2) );
>
> Or:
>
> Y = abs(fft(x))
> plot( 20*log10(Y) );
>
> Those should be the same plot.
>
> - Randy


Yes, these were the same plot, but when I plot them on different
graphs (frequency, Y), the graph with Y2 seems to have a more abrupt
peak to the specific frequency, where the graph with Y (abs(fft(x))
has a "gradual" slope before the peak of the specific frequency (I am
looking at a signal with 2 distinct frequencies). Which would be
better to use when looking for and quantifying specific frequencies of
a signal?

0 new messages