discrete-time real exponential signal

10 views (last 30 days)
cikalekli on 23 Nov 2021
Answered: Paul on 24 Nov 2021
HOW CAN I DELETE THOSE POINTS WHICH ARE VISIBLE AT ZERO AT COUPLE TIMES?
I was trying to create a power signal as with α = -0.9 between -10 < t < 10
Here is the graph which I was trying to achieve:
clc; clear; close all
alpha = -.9;
t = -10 : 0.5 : 10;
y = power(alpha, t);
stem(t,y, '- b',...
'LineWidth',2);
Warning: Using only the real component of complex data.
title ('\bf\it 3rd QUESTION ', 'fontsize', (25));
xlabel ('\bf INPUT ', 'fontsize', (20));
ylabel ('\bf OUTPUT ', 'fontsize', (20));
0 CommentsShowHide -1 older comments

Sign in to comment.

Accepted Answer

Paul on 24 Nov 2021
Those points at zero show up because alpha is negative and the code is raising alpha to non-integer powers t. For those values of t, alpha^t is complex, and they all have real part equal 0 for those values of t. For example
alpha = -.9;
power(alpha,-9.5)
ans = 0.0000 + 2.7208i
Then, as the warning states, stem() plots the real part, which is why those zero points show up.
The solution is to only define t with integer values
t = -10 : 1 : 10;
y = power(alpha, t);
stem(t,y, '- b','LineWidth',2);
0 CommentsShowHide -1 older comments

Sign in to comment.

More Answers (2)

VBBV on 23 Nov 2021
Edited: VBBV on 23 Nov 2021
clc; clear; close all
alpha = -.9;
t = -10 : 0.10000 : 10;
y = exp(alpha.^t); % exponent of alpha is vector t
stem(t,real(y));
xlabel('xlabel')
ylabel('Magnitude')
1 CommentShowHide None
VBBV on 23 Nov 2021
clc; clear; close all
alpha = -.9;
t = -10 : 0.50000 : 10;
y = (alpha.^t); % exponent of alpha is vector t
stem(t(3:2:end),real(y(3:2:end)),'linewidth',2,'MarkerFaceColor','blue');
xlabel('xlabel')
ylabel('Magnitude')
Do you mean like figure above ? where the first two points are not visible

Sign in to comment.

cikalekli on 23 Nov 2021
The expected result and your code is a lot different as you can see.
Here I made it more accurate version:
clc; clear; close all
alpha = -.9;
t = -10 : 0.5 : 10;
y = power(alpha, t);
stem(t,y, '- b',...
'LineWidth',2);
Warning: Using only the real component of complex data.
title ('\bf\it 3rd QUESTION ', 'fontsize', (25));
xlabel ('\bf INPUT ', 'fontsize', (20));
ylabel ('\bf OUTPUT ', 'fontsize', (20));
1 CommentShowHide None
cikalekli on 23 Nov 2021
How can I delete those points which are visible at zero
They are visible at couple times as you can see?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!