Signal Shifting function| In MATLAB | CODE

Write the codes for given signal and time shifting of signal. 

Signal Shifting function

 [y,n] = shift(x,m,n0) 

% function of time shifting, 

y = x; 

n = m+n0; 

end

Code

clc

clear all

t = -5:1:5

x=[zeros(1,5) 1 1 2  zeros(1,3)]

subplot(211)

plot(t,x)

title('shift')

legend('IBRAR')

xlabel('x axis')

ylabel('y axis')

[y,n]=shift(x,t,2)

subplot(212)

plot(n,y)

title('shift')

legend('IBRAR')

xlabel('x axis')

ylabel('y axis')

output




Post a Comment

0 Comments