mirror of
https://github.com/davrot/pytutorial.git
synced 2025-04-18 21:26:41 +02:00
Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
12bd920e8b
commit
b5e2d527a8
1 changed files with 16 additions and 0 deletions
|
@ -121,3 +121,19 @@ plt.show()
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Analyzing a test signal
|
||||||
|
First we need a test signal. We will use a 50Hz sinus for that
|
||||||
|
```python
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
f_test: float = 50 # Hz
|
||||||
|
t_test: np.ndarray = np.arange(0, 1000) / 1000
|
||||||
|
test_data: np.ndarray = np.sin(2 * np.pi * f_test * t_test)
|
||||||
|
|
||||||
|
plt.plot(t_test, test_data)
|
||||||
|
plt.xlabel("time [sec]")
|
||||||
|
plt.ylabel("time series")
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue