query on DFT plotting

7 views (last 30 days)
pss aditya
pss aditya on 27 Aug 2020
Answered: Star Strider on 27 Aug 2020
xlabel('DFT bins');
%plotting the DFT(norm freq)
plot([0:1/(num_bins/2 -1):1], x_mags(1:num_bins/2));
xlabel('norm frequency (\pi rads/sample)');
so the text i bolded and underlined, why are the limits in plot in such way?
is there any specific reason?

Accepted Answer

Star Strider
Star Strider on 27 Aug 2020
It is plotting only the first half of the fft result ‘x_mags’ from 0 to π radians. This is the usual approach, since ‘x_mags’ is actually symmetrical, with the second half being the complex conjugate of the first half. (There is usuallny no reason to plot both halves, unless you are using fftshift and plotting from to π in this instance. That is not the situation here.)

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by