Question

y = 0.5*δ(t+9) + 0.25*δ(t+3) + 0.25*δ (t-3) + 0.25*δ(t-9) how to you plot y function...

y = 0.5*δ(t+9) + 0.25*δ(t+3) + 0.25*δ (t-3) + 0.25*δ(t-9)

how to you plot y function in MATLAB? δ is a delta function i tried to use dirac function in MATLAB i am just keep getting errors could you give me a code for the y function in MATLAB? thank you

0 0
Add a comment Improve this question Transcribed image text
Answer #1

While using dirac function for generating impulse signal, then for t=0 or t+a=0 or t-a=0 it will give infinite value (Inf).

Then we should find the positions where the value is infinite and there we need to replace with finite coefficient value.

If coefficient is 1 then replace with 1 (it will give unit impulse at that point).

MATLAB code:

clc;clear all;
t=-15:1:15;
y = 0.5*dirac(t+9) + 0.25*dirac(t+3) + 0.25*dirac(t-3) + 0.25*dirac(t-9);
idt = y == Inf; % find Inf
y(idt) = 1*[0.5;0.25;0.25;0.25]; % set Inf to finite coefficient value
stem(t,y)
xlabel('Time t')
ylabel('amplitude of y')

MATLAB result (plot):

Add a comment
Know the answer?
Add Answer to:
y = 0.5*δ(t+9) + 0.25*δ(t+3) + 0.25*δ (t-3) + 0.25*δ(t-9) how to you plot y function...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT