Skip to content

Instantly share code, notes, and snippets.

@raytroop
Created April 5, 2026 01:10
Show Gist options
  • Select an option

  • Save raytroop/c4a15600f9da1a8a8824ec94bd11c65d to your computer and use it in GitHub Desktop.

Select an option

Save raytroop/c4a15600f9da1a8a8824ec94bd11c65d to your computer and use it in GitHub Desktop.
si = [1,0.3,0.5];
vi = kron(si, ones(1,3));
xi = 0:1:(length(vi)-1);
subplot(6,1,1)
stem(xi, vi, "filled", 'r', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
ir = [0.1, 0.2, 0.3, 0.6, 1];
xir = -length(ir)+1:1:0;
subplot(8,1,2)
stem(xir, ir, "filled", 'b', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,3)
stem(xir+1, ir, "filled", 'b', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,4)
stem(xir+8, ir, "filled", 'b', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,5)
stem(xir+9, ir, "filled", 'm', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,6)
stem(xir+10, ir, "filled", 'm', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,7)
stem(xir+11, ir, "filled", 'm', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
subplot(8,1,8)
stem(xir+12, ir, "filled", 'm', LineWidth=2); xlim([-4,12]); xticks(-4:1:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment