フィルターのクリア

what is the x-axis in the figure represent ? frequency, samples?

2 ビュー (過去 30 日間)
Mary Jon
Mary Jon 2014 年 11 月 26 日
コメント済み: Mohammad Abouali 2014 年 11 月 26 日
Hi all....
I so confusing really!
I Have this code
Fs = 20000;
t = 0:1/Fs:0.01;
fc1=200;
x = 10*sin(pi*fc1*t)
xFFT = abs(fft(x));
x_psd = abs(fft(x).^2);
stem(xFFT);
stem(x_psd);
1.let we say this simple HW, what is the x-axis of xFFT represent(frequency or samples SPS)? 2.can I say this signal of frequency 100 ,sampling frequency 20000,number of samples 201? 3.How can find resolution of this can I say (Fs/number of samples N) is resolution, if not resolution how can find resolution ?
than you

採用された回答

Mohammad Abouali
Mohammad Abouali 2014 年 11 月 26 日
the way that you are using stem function, the x axis would be the index number.
So your xFFT is an array of 201 double precision numbers. the x axis is from 1 to 201.
So pretty much you can interpret it as sample number.
use this form:
stem(xValues, YValues)
if you want to show something else as your x-axis.
Two more thing (not in your question)
1) usually use fftshift before plotting your stuff.
2) You have two calls to stem() function. The second one will override the first one. So either use 'hold on' to have both graph in one figure or if you want them in two separate figure then change it to something like this:
figure, stem(xFFT);
figure, stem(x_psd);
  3 件のコメント
Mary Jon
Mary Jon 2014 年 11 月 26 日
why use fftshift?
how can made x axis in frequency unite
Mohammad Abouali
Mohammad Abouali 2014 年 11 月 26 日
Have a look here

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by