필터 지우기
필터 지우기

Plot fft result on linear period scale?

조회 수: 3 (최근 30일)
Cl
Cl 2013년 12월 10일
댓글: Wayne King 2013년 12월 10일
I need to plot the results of an fft on a linear period scale. The output is on a linear frequency scale. Is there an easy way to do this or will I have to interpolate?

답변 (1개)

Wayne King
Wayne King 2013년 12월 10일
If you really want to see the periods, then no you just have to plot by period.
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft = xdft(1:length(xdft)/2+1);
df = Fs/length(x);
freqvec = 0:df:Fs/2;
Periods = 1./freqvec;
plot(Periods(2:end),abs(xdft(2:end)))
set(gca,'xlim',[1/500 1/50]);
xlabel('Seconds');
  댓글 수: 2
Cl
Cl 2013년 12월 10일
Thank you for your help, I'm confused though. Is freqvec not linear, making Period non-linear since it's the reciprocal? My aim is to have periods 10 20 30 40 seconds etc to 100.
Wayne King
Wayne King 2013년 12월 10일
yes, Period is definitely nonlinear.

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

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by