Write a Matlab code to generate the following signal:
๐‘š (๐‘ก)=2๐‘ ๐‘–๐‘›๐‘ (2๐‘ก๐‘‡)+๐‘ ๐‘–๐‘›๐‘ (2๐‘ก๐‘‡+1)+ ๐‘ ๐‘–๐‘›๐‘ (2๐‘ก๐‘‡โˆ’1)

 Accepted Answer

Ameer Hamza
Ameer Hamza on 14 Jun 2020
Edited: Ameer Hamza on 14 Jun 2020
easy peasy:
t = -2:0.01:2;
T = 2;
y = 2*sinc(2*T*t) + sinc(2*T*t+1) + sinc(2*T*t-1);
plot(t, y)
sinc() function is defined in Signal Processing toolbox.
If you don't have the toolbox, then you can define it like this
function y = sinc(x)
y = sin(pi*x)./(pi*x);
y(x==0) = 1;
end

2 Comments

Thanks alot
I am glad to be of help!

Sign in to comment.

More Answers (0)

Categories

Find more on Signal Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!