# Time scaled version of discrete time signals

I have a confusion regarding time scaling of discrete time signals.

Let u[n] be the discrete time unit step signal(or sequence)

Now if i plot u[n/3] i know there will be two zeros added between each previous samples(samples before scaling).

But when i tried plotting the same on MATLAB i got the same plots for u[n] and u[n/3] and even for u[4n].

How could this be?

I am attaching the MATLAB code :

close all;
clear vars;
t=-4:1:20;
stepd=t>=0;
subplot(2,2,1)
stem(t,stepd,'b');
xlabel('n');
ylabel('u[n]');
title('discrete unit step');
stepd1=1/3.*t>=0;
subplot(2,2,2)
stem(t,stepd1,'g');
xlabel('n');
ylabel('u[n/3]');
title('time scaled discrete unit step');
stepd2=4.*t>=0;
subplot(2,2,3)
stem(t,stepd2,'r');
xlabel('n');
ylabel('u[4n]');


I know this is a very silly doubt but please help me come out of this confusion.

I have also attached the plots which i am getting on MATLAB • Try using a sinusoid signal instead. The step function is not interesting enough for this experiment. Apr 25 at 15:02
• Matlab will just round down for $u[n/3]$ when $n$ is 1,2. So it is not inserting errors.
– IanJ
Apr 25 at 16:02
• @CrisLuengo Thank you very much for your response but my purpose of asking this is that i want to know whether or not u[n/3] and u[n] are actually same and if yes then how? Apr 26 at 6:04
• @IanJ Can you please suggest me a code by which i can check this because i am not quite getting your point Apr 26 at 6:06
• But you are not indexing u[n/3], you are sampling your (continuous) step function at t/3. This is why I suggest you use a sinusoid. You’ll see it change in your three plots, you’ll see more clearly what it is that you’re doing. Apr 26 at 13:08