fourier transform of this:

3 ビュー (過去 30 日間)
HADIMARGO
HADIMARGO 2019 年 6 月 28 日
編集済み: HADIMARGO 2019 年 6 月 28 日
hi this is my shape that i want it's fourier transform
this is my code:
clc
clear all
t=-3:0.0001:3;
%x=-heaviside(t+2)
%y=t
%z=rectangularPulse(t-1)
%unitstep = t>-1;
%ramp = t.*unitstep;
f= -heaviside(t+2)+ heaviside(t+1)+t.*(t>=-1)-t.*(t>=1)+ heaviside(t-1)-heaviside(t-2)
figure(1)
plot(t,f)
axis([-3,3,-2,2])
FT=fourier(f)
this is error:
Undefined function 'fourier' for input arguments of type 'double'.
Error in Untitled12 (line 19)
FT=fourier(f)
how could i fix this?
the result of my code:
untitled5.jpg

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 6 月 28 日
編集済み: KALYAN ACHARJYA 2019 年 6 月 28 日
FT=fft(f);
First FFT then plot, requested you to read this documentation
  4 件のコメント
HADIMARGO
HADIMARGO 2019 年 6 月 28 日
編集済み: HADIMARGO 2019 年 6 月 28 日
ok final code:
clc
clear all
t=-3:0.0001:3;
%x=-heaviside(t+2)
%y=t
%z=rectangularPulse(t-1)
%unitstep = t>-1;
%ramp = t.*unitstep;
f= -heaviside(t+2)+ heaviside(t+1)+t.*(t>=-1)-t.*(t>=1)+ heaviside(t-1)-heaviside(t-2)
figure(1)
plot(t,f)
axis([-3,3,-2,2])
FT=fft(f)
g = (0:length(FT)-1)*50/length(FT);
figure(2)
plot(g,abs(FT))
axis([-10,60,-2,100])
result:
hope this is true!
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 6 月 28 日
編集済み: KALYAN ACHARJYA 2019 年 6 月 28 日
Read here (Differences)
I dont have Matlab in my Laptop, I will try when I will return to Lab.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by