How to Represent Discrete Time Signals in Matlab

  • Context: MATLAB 
  • Thread starter Thread starter EugP
  • Start date Start date
  • Tags Tags
    Discrete Matlab Time
Click For Summary

Discussion Overview

The discussion revolves around representing discrete time signals in Matlab, specifically focusing on the convolution of two signals, r[-k - 2] and u[k - 2]. Participants explore how to plot these signals and clarify definitions related to them.

Discussion Character

  • Technical explanation
  • Homework-related
  • Conceptual clarification

Main Points Raised

  • One participant seeks assistance in plotting a convolution result in Matlab, expressing uncertainty about how to represent discrete time signals correctly.
  • Another participant questions the definitions of r[n] and u[n], indicating that clarity on these definitions is necessary for the problem at hand.
  • A participant provides definitions for continuous-time unit step and ramp signals, suggesting these definitions might apply to the discrete-time context as well.
  • There is a mention that the signals are discrete-time because they consist of samples at specific moments in the vector t.
  • A suggestion is made to use the "conv" function in Matlab for calculating the convolution, with a reference to the Matlab help documentation for further information.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the definitions of r[n] and u[n], and there is uncertainty regarding the correct approach to plotting the convolution in Matlab. Multiple viewpoints on how to interpret the signals and their representation remain present.

Contextual Notes

The discussion lacks explicit definitions for r[n] and u[n] in the context of the current problem, and there are unresolved aspects regarding the transition between continuous-time and discrete-time representations.

EugP
Messages
104
Reaction score
0
Can anyone tell me how to represent signals in discrete time in Matlab?
I had a lab assignment in my Linear Systems and Signals class, which said to plot the result of this:

[tex]r[-k - 2] \ast u[k -2][/tex], where [tex]\ast[/tex] represents convolution.

Now, I know the answer, which is 0. I now need to plot it. The way I plotted it, is I did the following:

Code:
x = (0:100);
y = 0;
plot (x, y);

Of course I get a line on x = 0 which has all values of y as 0, but that's the TRULY right way. I want Matlab to get that answer by itself.

I tried reading some stuff online about discrete time in Matlab, but nothing seems to help. Maybe it's because this is the first time I've ever used Matlab.

If someone could please help me, it would be greatly appreciated.
 
Physics news on Phys.org
How are r[n] and u[n] defined?
 
antonantal said:
How are r[n] and u[n] defined?

Well for this particular problem it doesn't say, but for a previous problem in continuous time, they are defined as:

Code:
% continuous-time unit step
t1=-10:0; t2=0:10; t=[t1 t2];
u=[zeros(1,11) ones(1,11)];

% continuous-time ramp signal
t1=-10:-1; t2=0:10; t=[t1 t2]
r=[zeros(1,10) t2]

So I will assume it should remain that way.
 
I don't understand how do you make the difference between discrete-time and continuous-time.

Anyway, those signals are discrete-time since they are composed of the samples at the moments in the vector t.

You should use the function "conv" to calculate the convolution of the two signals.
Type "help conv" in Matlab for more info on the "conv" function.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
5
Views
3K