-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPlayground.py
47 lines (40 loc) · 1.33 KB
/
Playground.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import scipy.signal as sps
import matplotlib.pyplot as plt
import numpy as np
import PulseGeneration as pg
import PulseInterface as pi
sampling_rate = 20000
duration = 2
hz = 2
# pulse_times = np.linspace(0, duration, duration*hz, endpoint=False)
pulse_times = [0.0, 0.4, 0.6, 1.75]
pulse_length = (1.0 / hz) / 2.0
print(pulse_times)
default_params = {'type': 'ContCorr',
'frequency': hz,
'pulse_length': pulse_length,
'pulse_times': pulse_times,
'onset': 0.0,
'offset': 0.1,
'target_duty': 0.5,
'amp_min': 0.0,
'amp_max': 1.0,
'shatter_frequency': 500.0,
'invert': False}
inverse_params = {'type': 'ContCorr',
'frequency': hz,
'pulse_length': pulse_length,
'pulse_times': pulse_times,
'onset': 0.0,
'offset': 0.1,
'target_duty': 0.5,
'amp_min': 0.0,
'amp_max': 1.0,
'shatter_frequency': 500.0,
'invert': True}
params = [default_params, inverse_params]
pulses, t = pi.make_pulse(sampling_rate, 0.0, 0.0, params)
plt.plot(t, pulses[0])
plt.plot(t, pulses[1])
# plt.xlim((0, duration))
plt.show()