Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Time delay and time advance of a sequence in MATLAB


%Code for right shift:

n1=input('Enter the required amount of shift');
n=-3:3;
x=[-2 0 1 -3 2 -1 3];
subplot(2,1,1);
stem(n,x);
xlabel('Time sample');
ylabel('Amplitude');
title('Original Signal');
m=n+n1;
subplot(2,1,2);
stem(m,x);
xlabel('Time sample');
ylabel('Amplitude');
title('Advanced signal')

%Code for left shift:

n1=input('Enter the required amount of shift');
n=-3:3;
x=[-2 0 1 -3 2 -1 3];
subplot(2,1,1);
stem(n,x);
xlabel('Time sample');
ylabel('Amplitude');
title('Original Signal');
m=n-n1;
subplot(2,1,2);
stem(m,x);
xlabel('Time sample');
ylabel('Amplitude');
title('Advanced signal');


No comments

Popular Posts

Followers