0
$\begingroup$

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


enter image description here

$\endgroup$
6
  • $\begingroup$ Try using a sinusoid signal instead. The step function is not interesting enough for this experiment. $\endgroup$ Apr 25 at 15:02
  • $\begingroup$ Matlab will just round down for $u[n/3]$ when $n$ is 1,2. So it is not inserting errors. $\endgroup$
    – IanJ
    Apr 25 at 16:02
  • $\begingroup$ @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? $\endgroup$ Apr 26 at 6:04
  • $\begingroup$ @IanJ Can you please suggest me a code by which i can check this because i am not quite getting your point $\endgroup$ Apr 26 at 6:06
  • $\begingroup$ 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. $\endgroup$ Apr 26 at 13:08
0
$\begingroup$

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

No.

You are confusing up-sampling with time scaling. The time scaled version of a unit step is a unit step. You would only insert 2 zeros if you up-sample by a factor of 3.

$\endgroup$
2
  • $\begingroup$ Thank you very much for your response. $\endgroup$ Apr 25 at 14:42
  • $\begingroup$ Like you said that the time scaled response of unit step is a unit step,but my confusion is how would i define u[n/3] for all the n which are not multiples of 3.Because the argument in the discrete sequence have to be integer(n/3 must be integer) $\endgroup$ Apr 25 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.