필터 지우기
필터 지우기

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by