Oct 11, 2011 #1 moonnightingale Full Member level 6 Joined Sep 17, 2009 Messages 362 Helped 5 Reputation 10 Reaction score 5 Trophy points 1,298 Activity points 3,832 this is condition after inverse Z transform I want to plot it y[n]= u[n-1]-u[n-2]-u[n-3]+u[n-4]
Oct 12, 2011 #2 Z zorro Advanced Member level 4 Joined Sep 6, 2001 Messages 1,130 Helped 357 Reputation 712 Reaction score 298 Trophy points 1,363 Location Argentina Activity points 8,913 I guess u[n] is the step function, right? Try yourself: u[n-1] is u[n] delayed 1 sample, ...etc... Plot the 4 parts and add graphically. Regards Z
I guess u[n] is the step function, right? Try yourself: u[n-1] is u[n] delayed 1 sample, ...etc... Plot the 4 parts and add graphically. Regards Z
Oct 15, 2011 #3 blooz Advanced Member level 2 Joined Dec 29, 2010 Messages 560 Helped 121 Reputation 242 Reaction score 116 Trophy points 1,343 Location India Activity points 4,985 moonnightingale said: this is condition after inverse Z transform I want to plot it y[n]= u[n-1]-u[n-2]-u[n-3]+u[n-4] Click to expand... Code: function y=ustep(x) Y=zeros(size(x)); Y(x>=0)=1; y=Y eg Code: t=-10:1:10; plot(t,t.*ustep(t)-(t-2).*ustep(t-2)-(t-3).*ustep(t-3)+(t-5).*ustep(t-5)) grid on xlabel('t') ylabel('x(t)') Discrete Code: n=-10:1:10; stem(n,n.*ustep(n)-(n-2).*ustep(n-2)-(n-3).*ustep(n-3)+(n-5).*ustep(n-5)) grid on xlabel('n') ylabel('x(n)')
moonnightingale said: this is condition after inverse Z transform I want to plot it y[n]= u[n-1]-u[n-2]-u[n-3]+u[n-4] Click to expand... Code: function y=ustep(x) Y=zeros(size(x)); Y(x>=0)=1; y=Y eg Code: t=-10:1:10; plot(t,t.*ustep(t)-(t-2).*ustep(t-2)-(t-3).*ustep(t-3)+(t-5).*ustep(t-5)) grid on xlabel('t') ylabel('x(t)') Discrete Code: n=-10:1:10; stem(n,n.*ustep(n)-(n-2).*ustep(n-2)-(n-3).*ustep(n-3)+(n-5).*ustep(n-5)) grid on xlabel('n') ylabel('x(n)')
Oct 15, 2011 #4 Z zorro Advanced Member level 4 Joined Sep 6, 2001 Messages 1,130 Helped 357 Reputation 712 Reaction score 298 Trophy points 1,363 Location Argentina Activity points 8,913 @ Blooz: Why do you multply each shifted step by the functions (t-...) or (n-...)? That gives ramps. Regards Z
@ Blooz: Why do you multply each shifted step by the functions (t-...) or (n-...)? That gives ramps. Regards Z
Oct 15, 2011 #5 blooz Advanced Member level 2 Joined Dec 29, 2010 Messages 560 Helped 121 Reputation 242 Reaction score 116 Trophy points 1,343 Location India Activity points 4,985 zorro said: @ Blooz: Why do you multply each shifted step by the functions (t-...) or (n-...)? That gives ramps. Regards Z Click to expand... hi Zorro just an example . . Blooz ---------- Post added at 19:28 ---------- Previous post was at 19:17 ---------- And here is the solution for y[n]= u[n-1]-u[n-2]-u[n-3]+u[n-4] Code: n=-10:1:10; stem(n,ustep(n-1)-ustep(n-2)-ustep(n-3)+ustep(n-4)) grid on xlabel('n') ylabel('x(n)')
zorro said: @ Blooz: Why do you multply each shifted step by the functions (t-...) or (n-...)? That gives ramps. Regards Z Click to expand... hi Zorro just an example . . Blooz ---------- Post added at 19:28 ---------- Previous post was at 19:17 ---------- And here is the solution for y[n]= u[n-1]-u[n-2]-u[n-3]+u[n-4] Code: n=-10:1:10; stem(n,ustep(n-1)-ustep(n-2)-ustep(n-3)+ustep(n-4)) grid on xlabel('n') ylabel('x(n)')
Oct 15, 2011 #6 Z zorro Advanced Member level 4 Joined Sep 6, 2001 Messages 1,130 Helped 357 Reputation 712 Reaction score 298 Trophy points 1,363 Location Argentina Activity points 8,913 One thing to remark: The sequence is 0, 1, 0 -1, 0, 0, 0,... In the plot above, n=0 is at the middle. Regards Z
One thing to remark: The sequence is 0, 1, 0 -1, 0, 0, 0,... In the plot above, n=0 is at the middle. Regards Z