no idea
This commit is contained in:
parent
79bb459da9
commit
2e2e79f5fe
@ -248,23 +248,23 @@ def extract_stim_data(stimulus):
|
|||||||
stim_freq = round(stimulus.metadata[stimulus.name]['Frequency'][0][0])
|
stim_freq = round(stimulus.metadata[stimulus.name]['Frequency'][0][0])
|
||||||
stim_dur = stimulus.duration
|
stim_dur = stimulus.duration
|
||||||
# calculates the amplitude modulation
|
# calculates the amplitude modulation
|
||||||
amp_mod, ny_freq = AM(eodf, stim_freq)
|
_, ny_freq = AM(eodf, stim_freq)
|
||||||
|
amp_mod = find_AM(eodf, ny_freq, stim_freq)
|
||||||
return amplitude, df, eodf, stim_freq, stim_dur, amp_mod, ny_freq
|
return amplitude, df, eodf, stim_freq, stim_dur, amp_mod, ny_freq
|
||||||
|
|
||||||
def find_AM(frequency, eodf, nyquist, stimulus_frequency):
|
def find_AM(eodf, nyquist, stimulus_frequency):
|
||||||
t = signal.windows.triang(eodf) * nyquist
|
t = signal.windows.triang(eodf) * nyquist
|
||||||
length_t2 = len(frequency) // eodf
|
length_t2 = int(eodf*10)
|
||||||
length_t2 = int(length_t2)
|
|
||||||
t2 = np.tile(t, length_t2)
|
t2 = np.tile(t, length_t2)
|
||||||
x_values = np.arange(len(t2))
|
x_values = np.arange(len(t2))
|
||||||
|
|
||||||
fig, ax = plt.subplots()
|
#fig, ax = plt.subplots()
|
||||||
ax.plot(t2)
|
#ax.plot(t2)
|
||||||
ax.scatter(stimulus_frequency, t2[np.argmin(np.abs(x_values - stimulus_frequency))])
|
#ax.scatter(stimulus_frequency, t2[np.argmin(np.abs(x_values - stimulus_frequency))])
|
||||||
plt.grid()
|
#plt.grid()
|
||||||
|
|
||||||
AM = t2[np.argmin(np.abs(x_values - stimulus_frequency))]
|
AM = t2[np.argmin(np.abs(x_values - stimulus_frequency))]
|
||||||
return fig, AM
|
return AM
|
||||||
|
|
||||||
def firing_rate(binary_spikes, dt = 0.000025, box_width = 0.01):
|
def firing_rate(binary_spikes, dt = 0.000025, box_width = 0.01):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user