MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / wave_modulating

Function wave_modulating

example_code/item_046.py:107–114  ·  view source on GitHub ↗
(steps)

Source from the content-addressed store, hash-verified

105
106print("Example 5")
107def wave_modulating(steps):
108 step_size = 2 * math.pi / steps
109 amplitude = yield # Receive initial amplitude
110 for step in range(steps):
111 radians = step * step_size
112 fraction = math.sin(radians)
113 output = amplitude * fraction
114 amplitude = yield output # Receive next amplitude
115
116
117print("Example 6")

Callers 2

item_046.pyFile · 0.85
complex_wave_modulatingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected