Commit 921a15ce authored by Tristan Renon's avatar Tristan Renon
Browse files

powerPoint

parent 784b14b8
......@@ -7,17 +7,18 @@ from matplotlib.pyplot import cm
nSamples = 50
inputNPhases = 10
#
inputNPhases = 5
inputPhaseAmplitude = (0, 1, 1, 1, 1)
# inputPhaseAmplitude = (0, 1.382, 1.382, 1.382, 1.382)
# inputPhaseShiftMec = (0, 72, 72*2, 72*3, 72*4)
# inputPhaseShiftReg = (0, 36, 180-36, 180+36, 360-36)
inputPhaseShiftMec = (0, 72, 72*2, 72*3, 72*4)
inputPhaseShiftReg = (0, 36, 180-36, 180+36, 360-36)
fig, ax = plt.subplots(figsize=(8, 8))
ax.set(xlim=(-(inputNPhases+1)/2, (inputNPhases+1)/2), ylim=(-(inputNPhases+1)/2, (inputNPhases+1)/2))
def generateSin(n=3, phaseShiftReg=None, phaseAmplitude=None, phaseShiftMec=None):
#Generate things if user did not tell about them
# Generate things if user did not tell about them
if phaseAmplitude is None:
phaseAmplitude = np.ones(n)
......@@ -30,7 +31,7 @@ def generateSin(n=3, phaseShiftReg=None, phaseAmplitude=None, phaseShiftMec=None
if phaseShiftReg is None:
phaseShiftReg = phaseShiftMec
#Make sure people gave valid parameters
# Make sure people gave valid parameters
assert len(phaseShiftReg) == n, "phaseShiftReg is not the same size as Phases (n)"
assert len(phaseAmplitude) == n, "phaseAmplitude is not the same size as Phases (n)"
assert len(phaseShiftMec) == n, "phaseShiftMec is not the same size as Phases (n)"
......@@ -46,8 +47,8 @@ def generateSin(n=3, phaseShiftReg=None, phaseAmplitude=None, phaseShiftMec=None
return tuple(ret), n, phaseShiftReg, phaseAmplitude, phaseShiftMec
# generatedSin, nPhases, phaseShiftReg, phaseAmplitude, phaseShiftMec = generateSin(inputNPhases, inputPhaseShiftReg, inputPhaseAmplitude, inputPhaseShiftMec)
generatedSin, nPhases, phaseShiftReg, phaseAmplitude, phaseShiftMec = generateSin(n=inputNPhases)
generatedSin, nPhases, phaseShiftReg, phaseAmplitude, phaseShiftMec = generateSin(inputNPhases, inputPhaseShiftReg, inputPhaseAmplitude, inputPhaseShiftMec)
# generatedSin, nPhases, phaseShiftReg, phaseAmplitude, phaseShiftMec = generateSin(n=inputNPhases)
def animate(i):
ax.cla()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment