mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2025-05-17 21:39:23 +02:00
ZH: use correct DTFT convention
Only affects phase determination. Introduces a minus sign for the s_k terms and changes arctan2 parameters
This commit is contained in:
parent
ecc79a8c91
commit
4c834ad8e7
3 changed files with 35 additions and 4 deletions
1
simulations/airshower_beacon_simulation/lib/tests/lib
Symbolic link
1
simulations/airshower_beacon_simulation/lib/tests/lib
Symbolic link
|
@ -0,0 +1 @@
|
|||
../
|
30
simulations/airshower_beacon_simulation/lib/tests/test_beacon_fourier.py
Executable file
30
simulations/airshower_beacon_simulation/lib/tests/test_beacon_fourier.py
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
import lib
|
||||
|
||||
seed = 12345
|
||||
dt = 1 # ns
|
||||
t = np.arange(0, 10*int(1e3), dt)
|
||||
frequency = 45e-3 # GHz
|
||||
|
||||
N = 5e2
|
||||
rng = np.random.default_rng(seed)
|
||||
|
||||
phase_res = np.zeros(int(N))
|
||||
|
||||
for i in range(int(N)):
|
||||
phase = lib.phase_mod(np.pi*(2*rng.uniform(size=1) -1)) # rad
|
||||
beacon = lib.sine_beacon(frequency, t, t0=0, phase=phase)
|
||||
|
||||
measured = lib.find_beacon_in_traces([beacon], t, frequency, frequency_fit=False)
|
||||
|
||||
phase_res[i] = lib.phase_mod(measured[1][0] - phase)
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
ax.set_xlabel("$\\varphi_{meas} - \\varphi_{true}$ [rad]")
|
||||
ax.set_ylabel("#")
|
||||
ax.hist(phase_res, bins='sqrt')
|
||||
plt.show()
|
Loading…
Add table
Add a link
Reference in a new issue