|
import numpy as np |
|
import matplotlib.pyplot as plt |
|
|
|
def generate_brainwave(frequency, duration, sampling_rate=1000): |
|
t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False) |
|
wave = np.sin(2 * np.pi * frequency * t) |
|
return t, wave |
|
|
|
def combine_waves(waves): |
|
combined_wave = np.sum(waves, axis=0) |
|
return combined_wave / len(waves) |
|
|
|
|
|
duration = 5 |
|
sampling_rate = 1000 |
|
|
|
|
|
t, alpha_wave = generate_brainwave(10, duration, sampling_rate) |
|
_, beta_wave = generate_brainwave(20, duration, sampling_rate) |
|
|
|
|
|
wealthy_brain_wave = combine_waves([alpha_wave, beta_wave]) |
|
|
|
|
|
plt.plot(t, wealthy_brain_wave) |
|
plt.title(".159 Incorporated") |
|
plt.xlabel("Time (s)") |
|
plt.ylabel("Amplitude") |
|
plt.show() |