Unit Step and Discrete Delta function Data Sequence

16 views (last 30 days)
Hello,
I am curious about solving the following problem. Using an index vector from -3 to 14, I must create a data sequence consisting of the following: x[n] = u[n] * s[n] + 1.4 * d[n-3]
u[n] being the unit step function
s[n] being the sampled sine wave
d[n] being the discrete delta function
What I have so far is my sampled sinewave described in the following code:
Ts = 1.6e-3;% sample time
Fs = 1600; % sample rate
t = linspace(-3, 14, Fs); % time
uu = 1*(t >= 1);% unit step
w = 2*pi*187; % omega
xx = 0.187*sin(w*t);% x(t) = 0.187sin(w*t)
xxuu = xx .* uu; % multiplying step function with sine wavestem(t, xxuu)% stem plot
If possible, I would appreciate any comments made on the code as they would help me understand what exactly is going on. Any help is deeply appreciated.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!