signal fourier transform include unit step function

hey there. the question is this : x(t) = (exp(1)^-t)×u(t) note: u(t) is unit step function that has valeu 1 for (t >= 0) question is calcutlating X(w) the main idea is that (t) is symbol but u(t) only changes the range of fourier integral.
my code :
syms t;
t = linspace(-20, 20, 5000);
u = @(t) (t >= 0);
x = @(t) exp(1).^(-t).*u(t);
x_w = fourier(x(t))
error : check for missing argument or incorrect argument data type in call to function 'fourier'
i found that I can't handle that unit step function in x(t). when i don't have u(t) so I don't need t = linspace...... then every thing works great. but i need to solve this question

 採用された回答

Star Strider
Star Strider 2020 年 7 月 1 日

0 投票

Try this version of your code:
syms t x(t)
% t = linspace(-20, 20, 5000);
% u = @(t) (t >= 0);
x(t) = exp(-t) * heaviside(t);
x_w = fourier(x(t))
producing:
x_w =
1/(1 + w*1i)
The parts I commented (%) are not necessary here.
.

4 件のコメント

hey there
hey there 2020 年 7 月 1 日
good job!
is this format correct too?
syms t
x = @(t) exp(-t) * heaviside(t);
x_w = fourier(x(t))
Star Strider
Star Strider 2020 年 7 月 1 日
Thank you!
Yes. When I ran it, the result was:
x_w =
1/(1 + w*1i)
This slightlly surprised me, because I did not believe that the Symbolic Math Toolbox recognised anonymous functions.
ketul Modi
ketul Modi 2021 年 1 月 25 日
what is @(t) here??
Star Strider
Star Strider 2021 年 1 月 25 日

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by