Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
b1300dcd5b
commit
1969ee1bd3
1 changed files with 15 additions and 9 deletions
|
@ -13,18 +13,23 @@ import matplotlib.pyplot as plt
|
||||||
rng = np.random.default_rng()
|
rng = np.random.default_rng()
|
||||||
|
|
||||||
time_series_length: int = 1000
|
time_series_length: int = 1000
|
||||||
number_of_channels: int = 3
|
number_of_channels: int = 100
|
||||||
|
|
||||||
|
t: np.ndarray = np.arange(0, time_series_length) / 1000
|
||||||
|
|
||||||
# Clean data
|
# Clean data
|
||||||
|
frequencies = 10 / rng.random((1, number_of_channels))
|
||||||
|
phase = 2 * np.pi * rng.random((1, number_of_channels))
|
||||||
clean_data: np.ndarray = (
|
clean_data: np.ndarray = (
|
||||||
rng.random((time_series_length, number_of_channels))
|
0.5
|
||||||
+ 5 * np.arange(0, number_of_channels)[np.newaxis, ...]
|
* rng.random((1, number_of_channels))
|
||||||
|
* np.sin(t[..., np.newaxis] * 2 * np.pi * frequencies + phase)
|
||||||
|
+ np.arange(0, number_of_channels)[np.newaxis, ...]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Perturbation
|
# Perturbation
|
||||||
t: np.ndarray = np.arange(0, time_series_length) / 1000
|
|
||||||
y: np.ndarray = np.sin(t * 2 * np.pi * 1)
|
y: np.ndarray = np.sin(t * 2 * np.pi * 1)
|
||||||
mix_coefficients: np.ndarray = 1 + rng.random((3))
|
mix_coefficients: np.ndarray = 1 + rng.random((number_of_channels)) * 5
|
||||||
perturbation: np.ndarray = y[..., np.newaxis] * mix_coefficients[np.newaxis, ...]
|
perturbation: np.ndarray = y[..., np.newaxis] * mix_coefficients[np.newaxis, ...]
|
||||||
|
|
||||||
# Dirty data
|
# Dirty data
|
||||||
|
@ -35,19 +40,20 @@ np.savez(
|
||||||
"data.npz", clean_data=clean_data, perturbation=perturbation, dirty_data=dirty_data
|
"data.npz", clean_data=clean_data, perturbation=perturbation, dirty_data=dirty_data
|
||||||
)
|
)
|
||||||
|
|
||||||
plt.plot(t, clean_data)
|
|
||||||
|
plt.plot(t, clean_data[..., 0:3])
|
||||||
plt.xlabel("Time [s]")
|
plt.xlabel("Time [s]")
|
||||||
plt.ylabel("Clean data waveform")
|
plt.ylabel("Clean data waveform")
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
plt.plot(t, perturbation)
|
plt.plot(t, perturbation[..., 0:3])
|
||||||
plt.xlabel("Time [s]")
|
plt.xlabel("Time [s]")
|
||||||
plt.ylabel("Perturbation ")
|
plt.ylabel("Perturbation ")
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
plt.plot(t, dirty_data)
|
plt.plot(t, dirty_data[..., 0:3])
|
||||||
plt.xlabel("Time [s]")
|
plt.xlabel("Time [s]")
|
||||||
plt.ylabel("Dirty data waveform ")
|
plt.ylabel("Dirty data ")
|
||||||
plt.show()
|
plt.show()
|
||||||
```
|
```
|
||||||
We get three fully random time series
|
We get three fully random time series
|
||||||
|
|
Loading…
Reference in a new issue