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
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?