![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/352478/image.png)
query on DFT plotting
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
pss aditya
il 27 Ago 2020
Risposto: Star Strider
il 27 Ago 2020
x_mags=abs(fft(x));
plot(x_mags);
xlabel('DFT bins');
ylabel('magnitude');
%plotting the DFT(norm freq)
num_bins=length(x_mags);
plot([0:1/(num_bins/2 -1):1], x_mags(1:num_bins/2));
xlabel('norm frequency (\pi rads/sample)');
ylabel('magnitude');
so the text i bolded and underlined, why are the limits in plot in such way?
is there any specific reason?
0 Commenti
Risposta accettata
Star Strider
il 27 Ago 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.)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/352478/image.png)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Digital Filter Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!