28 lines
495 B
Python
28 lines
495 B
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
x = np.array([1, -5, 4, 8, 6, -3, -1])
|
|
|
|
n = np.arange(7)
|
|
x1 = x[(n+3)%7]
|
|
x2 = x[(n-4)%7]
|
|
x3 = x[(-n+2)%7]
|
|
|
|
plt.subplot(221)
|
|
plt.scatter(n,x)
|
|
plt.title("$x[n]$")
|
|
|
|
plt.subplot(222)
|
|
plt.scatter(n,x1)
|
|
plt.title("$x\left[\langle n + 3\\rangle_7\\right]$")
|
|
|
|
plt.subplot(223)
|
|
plt.scatter(n,x2)
|
|
plt.title("$x\left[\langle n - 4\\rangle_7\\right]$")
|
|
|
|
plt.subplot(224)
|
|
plt.scatter(n,x3)
|
|
plt.title("$x\left[\langle -n +2\\rangle_7\\right]$")
|
|
|
|
plt.show()
|