OSCR

Next-Generation Neural Mass Models Reproduce Features of Speech Processing.

Code ↔ Paper

21 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 21 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC_ringing_after_end_of_stimulus.jl, lines 98–180 · score 0.78 · band pass filtered, Hz band, Hilbert transform, frequency band, argument, Butterworth
  2. [2] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ Generate_Noise.jl, the whole file · a weak match · score 0.77 · 80–8000 Hz, band pass filter, Hilbert transform, cochlear, summed, 80 Hz
  3. [3] § Materials and Methods › Evaluation metrics and statistical analyses › Inter event phase coherence ↔ src/Phase_Concentration_Metric.jl, lines 231–295 · score 0.74 · analytic signal, filtered signals, complex unit vectors, instantaneous phase, Hilbert, phoneme
  4. [4] § Materials and Methods › Evaluation metrics and statistical analyses › Correlation and multiple comparison corrections ↔ Plot_paper_results_figures_and_stats.jl, lines 456–498 · score 0.73 · Confidence intervals, Benjamini Hochberg, Bonferroni correction, tailed, FDR, correlation
  5. [5] § Materials and Methods › Evaluation metrics and statistical analyses › Phase concentration metric ↔ src/Phase_Concentration_Metric.jl, lines 231–295 · score 0.71 · filtered signal, complex unit vectors, instantaneous phases, kernel, Hilbert, metric
  6. [6] § Materials and Methods › Evaluation metrics and statistical analyses › Inter event phase coherence ↔ Plot_IEPC_ringing_after_end_of_stimulus.jl, lines 98–180 · score 0.70 · band pass filtered, Hilbert transformed, frequency band, circular, IEPC, windows
  7. [7] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC.jl, lines 118–163 · score 0.70 · Hilbert transform, frequency band, 0.67 Hz, Butterworth, 35 Hz, filtered
  8. [8] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ src/NGNMM_NSP_paper_code.jl, lines 1389–1445 · score 0.67 · peak rate impulse, peak magnitude, low pass filter, threshold, events, smoothed
  9. [9] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/Phase_Concentration_Metric.jl, lines 1–70 · score 0.64 · generated sine wave, stimulus frequency, metrics, PCM, impulses, peaks
  10. [10] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/Phase_Concentration_Metric.jl, lines 297–350 · score 0.62 · Gaussian filtered, unit vectors, model response, metrics, PCM, evoked
  11. [11] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ src/NGNMM_NSP_paper_code.jl, lines 262–347 · score 0.57 · noise scaled, concatenated, squeezing, stretching, stimulus envelopes, ratio
  12. [12] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ Plot_IEPC.jl, lines 1–65 · score 0.56 · peak rate impulse, peak magnitude, threshold, events, smoothed, derivative
  13. [13] § Results ↔ Compute_and_plot_PCM.jl, lines 97–185 · score 0.56 · tuned phase resetting, sine waves, fast NMM, slow NMM, phase resetting oscillator, arrows
  14. [14] § Materials and Methods › Evaluation metrics and statistical analyses › Concordance correlation coefficient ↔ src/NGNMM_NSP_paper_code.jl, lines 1490–1532 · score 0.56 · concordance correlation coefficient, model ITPCs, variances, noise
  15. [15] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/NGNMM_NSP_paper_code.jl, lines 93–146 · score 0.55 · strictly positive, sine wave, drive amplitude, PCM, phase resetting, oscillator
  16. [16] § Results ↔ src/Phase_Concentration_Metric.jl, lines 1–70 · score 0.55 · Phase concentration, sine waves, stimulus frequency, impulses, vectors, PCM
  17. [17] § Results ↔ src/Phase_Concentration_Metric.jl, lines 72–132 · score 0.55 · impulse train, oscillator response, peak rate, Error, event, derivative
  18. [18] § Results ↔ Plot_IEPC.jl, lines 165–249 · score 0.53 · transient response, phoneme onset, subtracted, IEPC, baseline, window
  19. [19] § Materials and Methods › Evaluation metrics and statistical analyses › Phase concentration metric ↔ src/Phase_Concentration_Metric.jl, lines 205–229 · score 0.53 · frequency domain, Gaussian, width, metric, concentration, filtered
  20. [20] § Results ↔ Plot_paper_results_figures_and_stats.jl, lines 692–728 · score 0.52 · unvoiced stops, nasals, sibilants, EEG, vowel, ITPC
  21. [21] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC.jl, lines 165–249 · score 0.51 · phoneme onset, subtracted, segmented, IEPC, baseline, transient

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Julia · 403 lines · 22 KB · MIT · 7 matches

  1. ### code to run Phase concentration metric tests on each model.
  2. ### needs sine wave stimuli, from which impulse trains of a range of frequencies can be extracted from the peaks.
  3. using FFTW, DSP, Statistics
  4. ### reformed drive interpolators generator to create sine waves of varying frequency for PCM tests.
  5. """
  6. Will make an "interpolators" array that contains interpolations of 20 sine waves of different frequency and put it in global variable Interpolators.
  7. This can then be used in the ensemble simulation via the interpolation selector variable in a prob_func
  8. """
  9. function generate_sine_drive_interpolators_for_saving(sampling_rate::Float64,frequency_range::Tuple{Float64,Float64},stimulus_set_number::Int)
  10. sr=sampling_rate
  11. stimlength=sr*10 #code expects 10 seconds, 5 seconds of noise, 5 seconds of stimulus.
  12. times=range(0.0,10.0,length=Int(stimlength))
  13. frequencies=range(frequency_range[1],frequency_range[2],length=20*3) #20 frequencies per stimulus set, 3 stimulus sets. 60 freqs.
  14. sine_drives=Vector{Any}(undef,20)
  15. for trial in 1:20
  16. #will go through the noise samples in triplets: 1 is the before stimulus noise, 1 is during stimulus and 1 is after stimulus
  17. #will loop over this, and create a single interpolator for each set of noise samples, with the stimulus added to the middle and appropriate scale applied
  18. #drive is [noise,stimulus,noise,zeroes] (in case it runs over, making extrapolation to be 0 only)
  19. trial_drive_input=sin.(2.0*pi.*frequencies[trial+20*(stimulus_set_number-1)].*times) #only for the appropriate 20 frequencies of this stimulus set
  20. xs=1:1:length(trial_drive_input)
  21. sine_drives[trial]=linear_interpolation(xs,trial_drive_input,extrapolation_bc=Line())
  22. #interpolators[trial]=interpolate(Vector(trial_drive_input),BSpline(Linear()))#,extrapolation_bc=Line())
  23. end
  24. return sine_drives #look into typed global
  25. end
  26. # new prob func for the oscillator. this will update its frequency to match the stimulus frequency.
  27. function vary_noise_and_initial_conditions_and_natfreq(prob,i,repeat)
  28. prob.p.noise_selector=i
  29. freqs=prob.p.frequencies
  30. prob.p.F=freqs[Int64(i+20*(prob.p.noise_case_reference-1))] #set natural frequency to match stimulus frequency.
  31. prob.u0[1]=rand(MersenneTwister(Int64(123+i+20*(prob.p.noise_case_reference-1))))*2*π-π #random phase, but keeping r=1.0. indexed by noise selector i = 1:1:60.
  32. prob
  33. end
  34. function get_coupled_oscillator_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
  35. condition="PCM"
  36. println("testing: ",condition)
  37. flush(stdout)
  38. saveat=1/44100
  39. response_sr=Int64(1/saveat)
  40. frequencies=range(freq_range[1],freq_range[2],length=60)#[1:50] #cut to 50 to avoid failed simulations at high freq end.
  41. all_60_trials=Vector{Any}()
  42. all_stimuli=Vector{Any}()
  43. for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
  44. println("stimulus set: ",stimulus_idx)
  45. p.noise_case_reference=stimulus_idx
  46. p.noise_selector=1
  47. flush(stdout)
  48. #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
  49. if stimulus_type=="envelope"
  50. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  51. elseif stimulus_type=="derivative"
  52. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  53. interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
  54. elseif stimulus_type=="peakrate"
  55. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  56. interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
  57. elseif stimulus_type=="peakenvelope"
  58. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  59. interpolators_global=get_unitary_peakenv_impulses(interpolators_global, Float64(response_sr))
  60. else
  61. error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
  62. end
  63. #drive scaling as per phoneme case workflow.
  64. max_stimulus_amplitude=maximum(maximum.(interpolators_global))
  65. p.drive_amplitude=20000/mean(sum.([i[5.0*response_sr:10.0*response_sr] for i in interpolators_global]))
  66. p.c=1.0*pi*(1/(max_stimulus_amplitude*p.drive_amplitude*p.q)) #including q. this is the final maximumum stimulus amplitude after all normalisation.
  67. println("running sim")
  68. flush(stdout)
  69. if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
  70. trialdata=Ensemble_CoupledOscillators_modulated_PCM(vary_noise_and_initial_conditions_and_natfreq,time_range,p,u_init,20,saveat)
  71. else
  72. trialdata=Ensemble_CoupledOscillators_modulated_PCM(vary_noise_and_initial_conditions_and_natfreq,time_range,p,u_init,20,saveat)
  73. end
  74. push!(all_60_trials,trialdata...)
  75. push!(all_stimuli,interpolators_global...)
  76. end
  77. PCM_vectors,rates=calculate_PCM_oscillator_noisyrates(all_60_trials,all_stimuli,frequencies,response_sr,time_range,PCMrange) #ITPCrange can now exclude first 500ms of stimulus as per O.Cucu paper.
  78. #save the rates for each trial, for comparison across natural frequencies, and computation of conglomerate activity if desired.
  79. if save_traj
  80. #check dir exists:
  81. if !isdir(savepath*"Trajectories/")
  82. mkdir(savepath*"Trajectories/")
  83. end
  84. local name="Trajectories/$(response_sr)sr_oscillator_response_to_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
  85. CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
  86. generate_arrow(name,savepath)
  87. rm(savepath*name*".csv")
  88. end
  89. return(PCM_vectors)
  90. end
  91. function get_evoked_model_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
  92. condition="PCM"
  93. println("testing: ",condition)
  94. flush(stdout)
  95. saveat=1/44100
  96. response_sr=Int64(1/saveat)
  97. frequencies=range(freq_range[1],freq_range[2],length=60) #cut to 50 to avoid failed simulations at high freq end.
  98. all_60_trials=Vector{Any}()
  99. all_stimuli=Vector{Any}()
  100. for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
  101. println("stimulus set: ",stimulus_idx)
  102. p.noise_case_reference=stimulus_idx
  103. p.noise_selector=1
  104. flush(stdout)
  105. #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
  106. if stimulus_type=="envelope"
  107. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  108. elseif stimulus_type=="derivative"
  109. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  110. interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
  111. elseif stimulus_type=="peakrate"
  112. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  113. interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
  114. elseif stimulus_type=="peakenvelope"
  115. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  116. interpolators_global=get_unitary_peakenv_impulses(interpolators_global,Float64(response_sr))
  117. else
  118. error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
  119. end
  120. println("running sim")
  121. flush(stdout)
  122. if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
  123. trialdata=Ensemble_EvokedModel(vary_noise_and_initial_conditions_evokedmodel,time_range,p,u_init,20,saveat)
  124. else
  125. trialdata=Ensemble_EvokedModel(vary_noise_and_initial_conditions_evokedmodel,time_range,p,u_init,20,saveat)
  126. end
  127. push!(all_60_trials,trialdata...)
  128. push!(all_stimuli,interpolators_global...)
  129. end
  130. PCM_vectors,rates=calculate_PCM_EvokedModel_noisyrates(all_60_trials,all_stimuli,frequencies,response_sr,time_range,PCMrange) #ITPCrange can now exclude first 500ms of stimulus as per O.Cucu paper.
  131. #save the rates for each trial, for comparison across natural frequencies, and computation of congolmerate activity if desired.
  132. if save_traj
  133. #check dir exists:
  134. if !isdir(savepath*"Trajectories/")
  135. mkdir(savepath*"Trajectories/")
  136. end
  137. local name="Trajectories/evoked_model_response_to_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
  138. CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
  139. generate_arrow(name,savepath)
  140. rm(savepath*name*".csv")
  141. end
  142. return(PCM_vectors)
  143. end
  144. function get_NGNMM_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
  145. condition="PCM"
  146. println("testing: ",condition)
  147. flush(stdout)
  148. saveat=1/44100
  149. response_sr=Int64(1/saveat)
  150. C=p.C
  151. vsyn=p.vsyn
  152. frequencies=range(freq_range[1],freq_range[2],length=60)#[1:50] #cut to 50 to avoid failed simulations at high freq end.
  153. @info "Frequencies being tested: $(frequencies)"
  154. all_60_trials=Vector{Any}()
  155. all_stimuli=Vector{Any}()
  156. for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
  157. println("stimulus set: ",stimulus_idx)
  158. p.noise_case_reference=stimulus_idx
  159. p.noise_selector=1
  160. flush(stdout)
  161. #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
  162. if stimulus_type=="envelope"
  163. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  164. elseif stimulus_type=="derivative"
  165. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  166. interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
  167. elseif stimulus_type=="peakrate"
  168. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  169. interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
  170. elseif stimulus_type=="peakenvelope"
  171. global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
  172. interpolators_global=get_unitary_peakenv_impulses(interpolators_global,Float64(response_sr))
  173. else
  174. error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
  175. end
  176. println("running sim")
  177. flush(stdout)
  178. if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
  179. trialdata=Ensemble_NoisyPhoneme_PCM(vary_noise_and_initial_conditions_NGNMM,time_range,p,u_init,20,saveat)
  180. else
  181. trialdata=Ensemble_NoisyPhoneme_PCM(vary_noise_and_initial_conditions_NGNMM,time_range,p,u_init,20,saveat)
  182. end
  183. push!(all_60_trials,trialdata...)
  184. push!(all_stimuli,interpolators_global...)
  185. end
  186. PCM_vectors,rates=calculate_PCM_NGNMM_noisyrates(all_60_trials,all_stimuli,frequencies,response_sr,time_range,C,vsyn,PCMrange) #ITPCrange can now exclude first 500ms of stimulus as per O.Cucu paper.
  187. #save the rates for each trial, for comparison across natural frequencies, and computation of congolmerate activity if desired.
  188. if save_traj
  189. #check dir exists:
  190. if !isdir(savepath*"Trajectories/")
  191. mkdir(savepath*"Trajectories/")
  192. end
  193. local name="Trajectories/fast_NGNMM_response_to_abs_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
  194. CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
  195. generate_arrow(name,savepath)
  196. rm(savepath*name*".csv")
  197. end
  198. return(PCM_vectors)
  199. end
  200. function gaussian_filter_and_hilbert_for_PCM(signal::Vector{Float64},sampling_rate,peak_frequency::Float64)
  201. num_samples=length(signal)
  202. #put in frequency domain
  203. freqs=fftfreq(num_samples,sampling_rate)
  204. signal_fft=fft(signal)
  205. #gaussian filter parameters
  206. center_frequency=peak_frequency
  207. filter_width=center_frequency/2.0
  208. #gaussian filter:
  209. gauss_kernel=exp.(-0.5.*((abs.(freqs).-center_frequency)./(filter_width)).^2)
  210. #apply in freq domain;
  211. filtered_signal_fft=signal_fft.*gauss_kernel
  212. #return to time domain:
  213. filtered_signal=ifft(filtered_signal_fft)
  214. #return envelope via hilbert
  215. analytic_signal=hilbert(real.(filtered_signal))
  216. return analytic_signal
  217. end
  218. function calculate_PCM_oscillator_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,PCMrange,noise_seed=123)
  219. num_trials=length(vector_of_solutions)
  220. rates_sr=response_sampling_rate
  221. #add noise to the model response ('firing rates'):
  222. rates=Array{Vector}(undef,num_trials)
  223. for (idx,data) in enumerate(vector_of_solutions)
  224. rates[idx]= coupled_oscillator_activity(data)[Int64(PCMrange[1]*rates_sr):Int64(PCMrange[2]*rates_sr)]#cos(theta).*r for coupled oscillator activity
  225. trialwise_seed=noise_seed+idx
  226. noises=seeded_noise(trialwise_seed, 1.0, 0.0, length(rates[idx])) #1/f noise with specific seed, different over the 60 trials, but the same over external parameter sets.
  227. noise_power=mean(noises.^2)
  228. rate_power=mean(rates[idx].^2)
  229. # desired_signal_to_noise_ratio=0.5 #for high SNR test.
  230. desired_signal_to_noise_ratio=100.0 #for clean test.
  231. noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
  232. scaled_noise=noises.*noise_scaling_factor
  233. noisy_rates=(rates[idx]).+(scaled_noise)
  234. rates[idx]=noisy_rates
  235. end
  236. #compute PCM vectors.
  237. mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
  238. for trial_idx in 1:num_trials
  239. #get the stimulus for this trial:
  240. stimulus_interpolator=stimuli[trial_idx]
  241. #get the peak frequency of this stimulus:
  242. peak_frequency=frequencies[trial_idx]
  243. #turn stimulus interpolator into values over time range matching the response sampling rate:
  244. # response_idx=range(PCMrange[1]*44100,PCMrange[2]*44100,step=1)
  245. response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
  246. # response_times=response_idx./44100.0
  247. response_times=response_idx./rates_sr
  248. # stimulus_idxs=response_times.*44100.0 #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
  249. stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
  250. stimulus_values=1.0 .+ stimulus_interpolator(stimulus_idxs)
  251. #filter and get instantaneous phase:
  252. if trial_idx==1
  253. @info size(rates[trial_idx])
  254. @info size(stimulus_values)
  255. end
  256. filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
  257. filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
  258. #get phases
  259. instantaneous_response_phase=angle.(filtered_response)
  260. instantaneous_stimulus_phase=angle.(filtered_stimulus)
  261. #get phase diff:
  262. phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
  263. #convert to complex unit vector form:
  264. phase_diff_vectors=exp.(im.*phase_diff)
  265. #get average phase difference over time
  266. mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
  267. end
  268. PCM_vectors=mean_phase_diff_vectors
  269. return PCM_vectors,rates
  270. end
  271. function calculate_PCM_EvokedModel_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,PCMrange,noise_seed=123)
  272. num_trials=length(vector_of_solutions)
  273. rates_sr=response_sampling_rate
  274. #add noise to the model response ('firing rates'):
  275. rates=Array{Vector}(undef,num_trials)
  276. for (idx,data) in enumerate(vector_of_solutions)
  277. rates[idx]= data[1,Int64(PCMrange[1]*rates_sr):Int64(PCMrange[2]*rates_sr)] #just the first component of the solution, the 'activity' of the evoked model, similar to global conductance in NGNMM.
  278. trialwise_seed=noise_seed+idx
  279. noises=seeded_noise(trialwise_seed, 1.0, 0.0, length(rates[idx])) #1/f noise with specific seed, different over the 60 trials, but the same over external parameter sets.
  280. noise_power=mean(noises.^2)
  281. rate_power=mean(rates[idx].^2)
  282. # desired_signal_to_noise_ratio=0.5 #for high SNR test.
  283. desired_signal_to_noise_ratio=100.0 #for clean test.
  284. noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
  285. scaled_noise=noises.*noise_scaling_factor
  286. noisy_rates=(rates[idx]).+(scaled_noise)
  287. rates[idx]=noisy_rates
  288. end
  289. #compute PCM vectors.
  290. mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
  291. for trial_idx in 1:num_trials
  292. #get the stimulus for this trial:
  293. stimulus_interpolator=stimuli[trial_idx]
  294. #get the peak frequency of this stimulus:
  295. peak_frequency=frequencies[trial_idx]
  296. #turn stimulus interpolator into values over time range matching the response sampling rate:
  297. response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
  298. response_times=response_idx./rates_sr
  299. stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
  300. stimulus_values=stimulus_interpolator(stimulus_idxs)
  301. #filter and get instantaneous phase:
  302. if trial_idx==1
  303. @info size(rates[trial_idx])
  304. @info size(stimulus_values)
  305. end
  306. filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
  307. filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
  308. #get phases
  309. instantaneous_response_phase=angle.(filtered_response)
  310. instantaneous_stimulus_phase=angle.(filtered_stimulus)
  311. #get phase diff:
  312. phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
  313. #convert to complex unit vector form:
  314. phase_diff_vectors=exp.(im.*phase_diff)
  315. #get average phase difference over time
  316. mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
  317. end
  318. PCM_vectors=mean_phase_diff_vectors
  319. return PCM_vectors,rates
  320. end
  321. function calculate_PCM_NGNMM_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,C,vsyn,PCMrange,noise_seed=123)
  322. num_trials=length(vector_of_solutions)
  323. rates_sr=response_sampling_rate
  324. #add noise to the model response ('firing rates'):
  325. rates=Array{Vector}(undef,num_trials)
  326. for (idx,data) in enumerate(vector_of_solutions)
  327. rates[idx]=get_firing_rate_NMM(data,C,vsyn)[1][Int64(PCMrange[1]*rates_sr):Int64(PCMrange[2]*rates_sr)]#
  328. trialwise_seed=noise_seed+idx
  329. noises=seeded_noise(trialwise_seed, 1.0, 0.0, length(rates[idx])) #1/f noise with specific seed, different over the 60 trials, but the same over external parameter sets.
  330. noise_power=mean(noises.^2)
  331. rate_power=mean(rates[idx].^2)
  332. # desired_signal_to_noise_ratio=0.5 #for high SNR test.
  333. desired_signal_to_noise_ratio=100.0 #for clean test.
  334. noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
  335. scaled_noise=noises.*noise_scaling_factor
  336. noisy_rates=(rates[idx]).+(scaled_noise)
  337. rates[idx]=noisy_rates
  338. end
  339. #compute PCM vectors.
  340. mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
  341. for trial_idx in 1:num_trials
  342. #get the stimulus for this trial:
  343. stimulus_interpolator=stimuli[trial_idx]
  344. #get the peak frequency of this stimulus:
  345. peak_frequency=frequencies[trial_idx]
  346. if trial_idx==1
  347. @info "peak frequency for trial 1: $(peak_frequency)"
  348. end
  349. #turn stimulus interpolator into values over time range matching the response sampling rate:
  350. response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
  351. response_times=response_idx./rates_sr
  352. stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
  353. # stimulus_values=stimulus_interpolator(stimulus_idxs)
  354. stimulus_values=1.0 .+(stimulus_interpolator(stimulus_idxs)) #set to abs to match what the NGNMM recieved.
  355. #filter and get instantaneous phase:
  356. if trial_idx==1
  357. @info size(rates[trial_idx])
  358. @info size(stimulus_values)
  359. end
  360. filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
  361. filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
  362. #get phases
  363. instantaneous_response_phase=angle.(filtered_response)
  364. instantaneous_stimulus_phase=angle.(filtered_stimulus)
  365. #get phase diff:
  366. phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
  367. #convert to complex unit vector form:
  368. phase_diff_vectors=exp.(im.*phase_diff)
  369. #get average phase difference over time
  370. mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
  371. end
  372. PCM_vectors=mean_phase_diff_vectors
  373. return PCM_vectors,rates
  374. end

Phase_Concentration_Metric.jl at commit 7df5e28, under MIT · at the source

Overview

  1. School of Computer Science, University of Bristol, Bristol BS8 1TH, United Kingdom
  2. School of Engineering Mathematics and Technology, University of Bristol, Bristol BS8 1TH, United Kingdom
Institutions: University of Bristol (United Kingdom)
Journal: eNeuro, volume 13, issue 8, pages ENEURO.0379-25.2026
Dates: received 14 October 2025; accepted 24 June 2026; published online 21 August 2026; in print August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1523/eneuro.0379-25.2026 · PMID 42547453 · PMCID PMC13505880 · OpenAlex W4415372432
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism)
Methods: Spectral & time-frequency, Statistics, Connectivity, Preprocessing, Single-unit activity, calcium imaging
Keywords: biophysical modeling, mathematical modeling, neural mass model, speech processing, syllable segregation
MeSH: Models, Neurological*, Speech Perception*, Acoustic Stimulation, Computer Simulation, Electroencephalography, Humans (* major topic)
Journal subjects: Research Article: New Research, Cognition and Behavior
Topic: Neural Networks and Applications (Artificial Intelligence, Computer Science), according to OpenAlex
Funding: URKI | EPSRC | Centre for Doctoral Training in Interactive Artificial Intelligence (EP/S022937/1)
Citations: not cited yet (Europe PMC); 29 references in the paper

Abstract

Segregation of speech into syllables is a key step in neural speech processing. It relies on the alignment of neural activity with the rhythmic structure of speech. Two competing hypotheses explain this “neural speech tracking”, phase-resetting and evoked responses. While phenomenological modeling of these hypotheses has been successful, we still lack understanding of the underlying cortical circuits. To investigate these mechanisms, we evaluate whether a biophysical next-generation neural mass model (NMM) can reproduce several features of neural speech tracking, using phenomenological models of the competing hypotheses as algorithmic baselines. We investigate the models’ dynamics with four tests: recreating in silico an EEG experiment that identified a correlation between tracking strength and phoneme sharpness, computing the phase concentration metric, testing the effect of varying syllabic rates, and evaluating the inter event phase coherence (IEPC) across phoneme onsets. While all of the models that we study reproduce the sharpness-tuned rhythmic speech tracking, the evoked model requires a pre-processed acoustic edge impulse stimulus. We demonstrate that the NMM is performing thresholded phase-resetting triggered by sharp onsets in the continuous speech envelope. This produces cross-frequency nested oscillations that qualitatively match an experimentally-observed dual-peak signature in the IEPC. Our results indicate that the biophysical NMM provides a mechanistic bridge between generic oscillatory dynamics in cortical populations and the cognitive computations of speech tracking. Indeed, the nonlinear dynamics of the NMM offer an explanation for how peak-rate event representations in auditory cortex activity arise in response to continuous acoustic input.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 21 matches between paragraphs and lines of code.

Modelling-Speech-Processing/Shannon_et_al

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 7df5e283a78c36c77fc39686b403526c03b4c553, 25 June 2026
Languages: Julia (19)
Size: 377 files, 19 scripts
Software Heritage: not archived
Found in: “Code accessibility”
Holds: README, license file, environment (Manifest.toml, Project.toml)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: Plots.jl (18 files), DataFrames.jl (7 files), DifferentialEquations.jl (6 files), Distributions.jl (2 files)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
21 files

Code accessibility

The code/software and data described in the paper is freely available online at https://github.com/Modelling-Speech-Processing/Shannon_et_al, and the code is also provided in Extended Data 1 (https://doi.org/10.1523/ENEURO.0379-25.2026.d1). In addition, the code and data are available at the University of Bristol data repository, data.bris, at https://doi.org/10.5523/bris.2796nqydg7fub27scai9muahlr.

Reproduced under the paper's license (CC BY), from the paper cited above.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 19 scripts, each with its path and the digest of its content;
  • 21 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 6 MeSH terms, 1 funder, 28 references.

Cite

This paper

Shannon, A., Barton, D. A. W., Homer, M., & Houghton, C. (2026). Next-Generation Neural Mass Models Reproduce Features of Speech Processing. eNeuro, 13(8), ENEURO.0379-25.2026. https://doi.org/10.1523/eneuro.0379-25.2026

BibTeX

@article{shannon2026next,
author = {Shannon, Andrew and Barton, David Andrew William and Homer, Martin and Houghton, Conor},
title = {{Next-Generation Neural Mass Models Reproduce Features of Speech Processing}},
journal = {eNeuro},
year = {2026},
month = aug,
volume = {13},
number = {8},
pages = {ENEURO.0379--25.2026},
publisher = {Society for Neuroscience},
issn = {2373-2822},
doi = {10.1523/eneuro.0379-25.2026},
url = {https://doi.org/10.1523/eneuro.0379-25.2026},
pmid = {42547453},
pmcid = {PMC13505880}
}

RIS

TY - JOUR
AU - Shannon, Andrew
AU - Barton, David Andrew William
AU - Homer, Martin
AU - Houghton, Conor
TI - Next-Generation Neural Mass Models Reproduce Features of Speech Processing
T2 - eNeuro
J2 - eNeuro
PY - 2026
DA - 2026/08/24
VL - 13
IS - 8
SP - ENEURO.0379
EP - 25.2026
SN - 2373-2822
PB - Society for Neuroscience
DO - 10.1523/eneuro.0379-25.2026
UR - https://doi.org/10.1523/eneuro.0379-25.2026
LA - en
ER -

CSL-JSON

{
"id": "10.1523/eneuro.0379-25.2026",
"type": "article-journal",
"title": "Next-Generation Neural Mass Models Reproduce Features of Speech Processing",
"container-title": "eNeuro",
"author": [
{
"family": "Shannon",
"given": "Andrew"
},
{
"family": "Barton",
"given": "David Andrew William"
},
{
"family": "Homer",
"given": "Martin"
},
{
"family": "Houghton",
"given": "Conor"
}
],
"container-title-short": "eNeuro",
"volume": "13",
"issue": "8",
"page": "ENEURO.0379-25.2026",
"DOI": "10.1523/eneuro.0379-25.2026",
"PMID": "42547453",
"PMCID": "PMC13505880",
"ISSN": "2373-2822",
"publisher": "Society for Neuroscience",
"URL": "https://doi.org/10.1523/eneuro.0379-25.2026",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
24
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1371/journal.pcbi.1014222 [code]
Neural population models for EEG: From Canonical models to alternative model structures.
Journal: PLoS computational biology
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool, EEG, 2 references
[2] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool
[3] doi:10.1038/s41540-026-00749-5 [code]
A novel approach to quantify out-of-distribution uncertainty in Neural and Universal Differential Equations.
Journal: NPJ systems biology and applications
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool
[4] doi:10.1371/journal.pcbi.1014549 [code]
Inward rectifier potassium channels interact with calcium channels to promote robust and physiological bistability.
Journal: PLoS computational biology
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool
[5] doi:10.1093/pnasnexus/pgag213 [code]
Two-factor synaptic plasticity enables memory consolidation during neuronal burst firing.
Journal: PNAS nexus
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool
[6] doi:10.1371/journal.pcbi.1014001 [code]
Burst firing creates an attractor in synaptic weight dynamics.
Journal: PLoS computational biology
In common: DifferentialEquations.jl, DataFrames.jl, Plots.jl, 1 other tool
[7] doi:10.1162/imag.a.1249 [code]
Global search metaheuristics for neural mass model calibration.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: DifferentialEquations.jl, Plots.jl, Distributions.jl, EEG
[8] doi:10.1038/s41586-026-10629-x [code]
Whole-genome duplication shaped cell-type evolution in the vertebrate brain.
Journal: Nature
In common: DataFrames.jl, Plots.jl, Distributions.jl
[9] doi:10.7554/elife.89629 [code]
Active dendrites enable robust spiking computations despite timing jitter.
Journal: eLife
In common: DifferentialEquations.jl, Plots.jl, Distributions.jl
[10] doi:10.1371/journal.pbio.3003924
Endogenous auditory and motor brain rhythms predict individual speech tracking.
Journal: PLoS biology
In common: 5 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.