Next-Generation Neural Mass Models Reproduce Features of Speech Processing.
17 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 21 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
- [1] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC_ringing_after_end_of_stimulus.jl, lines 98 to 180 · score 0.78 · band pass filtered, Hz band, Hilbert transform, frequency band, argument, Butterworth · block
oscr:b:Q00ZGQ7W2JKVN-N· Report a mismatch - [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 · block
oscr:b:GV9H4MYM05924-8· Report a mismatch - [3] § Materials and Methods › Evaluation metrics and statistical analyses › Inter event phase coherence ↔ src/Phase_Concentration_Metric.jl, lines 231 to 295 · score 0.74 · analytic signal, filtered signals, complex unit vectors, instantaneous phase, Hilbert, phoneme · block
oscr:b:ZCVAMJHANPBNB-E· Report a mismatch - [4] § Materials and Methods › Evaluation metrics and statistical analyses › Correlation and multiple comparison corrections ↔ Plot_paper_results_figures_and_stats.jl, lines 456 to 498 · score 0.73 · Confidence intervals, Benjamini Hochberg, Bonferroni correction, tailed, FDR, correlation · block
oscr:b:X10JPCYCJVH6E-I· Report a mismatch - [5] § Materials and Methods › Evaluation metrics and statistical analyses › Phase concentration metric ↔ src/Phase_Concentration_Metric.jl, lines 231 to 295 · score 0.71 · filtered signal, complex unit vectors, instantaneous phases, kernel, Hilbert, metric · block
oscr:b:ZCVAMJHANPBNB-E· Report a mismatch - [6] § Materials and Methods › Evaluation metrics and statistical analyses › Inter event phase coherence ↔ Plot_IEPC_ringing_after_end_of_stimulus.jl, lines 98 to 180 · score 0.70 · band pass filtered, Hilbert transformed, frequency band, circular, IEPC, windows · block
oscr:b:Q00ZGQ7W2JKVN-N· Report a mismatch - [7] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC.jl, lines 118 to 163 · score 0.70 · Hilbert transform, frequency band, 0.67 Hz, Butterworth, 35 Hz, filtered · block
oscr:b:03HRTTDG0GWWJ-L· Report a mismatch - [8] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ src/NGNMM_NSP_paper_code.jl, lines 1389 to 1445 · score 0.67 · peak rate impulse, peak magnitude, low pass filter, threshold, events, smoothed · block
oscr:b:QJ44CGT5VC45S-G· Report a mismatch - [9] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/Phase_Concentration_Metric.jl, lines 1 to 70 · score 0.64 · generated sine wave, stimulus frequency, metrics, PCM, impulses, peaks · block
oscr:b:JDQ4YA67S17SS-B· Report a mismatch - [10] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/Phase_Concentration_Metric.jl, lines 297 to 350 · score 0.62 · Gaussian filtered, unit vectors, model response, metrics, PCM, evoked · block
oscr:b:VYSXZ57GY9N88-C· Report a mismatch - [11] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ src/NGNMM_NSP_paper_code.jl, lines 262 to 347 · score 0.57 · noise scaled, concatenated, squeezing, stretching, stimulus envelopes, ratio · block
oscr:b:54H6QHKWKBJ4G-M· Report a mismatch - [12] § Materials and Methods › Sharpness-specific tuning of tracking › Stimulus construction ↔ Plot_IEPC.jl, lines 1 to 65 · score 0.56 · peak rate impulse, peak magnitude, threshold, events, smoothed, derivative · block
oscr:b:C58JYWJAZF8BS-9· Report a mismatch - [13] § Results ↔ Compute_and_plot_PCM.jl, lines 97 to 185 · score 0.56 · tuned phase resetting, sine waves, fast NMM, slow NMM, phase resetting oscillator, arrows · block
oscr:b:P9E5FEJSGS69Q-W· Report a mismatch - [14] § Materials and Methods › Evaluation metrics and statistical analyses › Concordance correlation coefficient ↔ src/NGNMM_NSP_paper_code.jl, lines 1490 to 1532 · score 0.56 · concordance correlation coefficient, model ITPCs, variances, noise · block
oscr:b:8DQKVJ4EZJ2AG-P· Report a mismatch - [15] § Materials and Methods › Model dynamics investigation › PCM experiment ↔ src/NGNMM_NSP_paper_code.jl, lines 93 to 146 · score 0.55 · strictly positive, sine wave, drive amplitude, PCM, phase resetting, oscillator · block
oscr:b:QXQD01VWMTA32-Q· Report a mismatch - [16] § Results ↔ src/Phase_Concentration_Metric.jl, lines 1 to 70 · score 0.55 · Phase concentration, sine waves, stimulus frequency, impulses, vectors, PCM · block
oscr:b:JDQ4YA67S17SS-B· Report a mismatch - [17] § Results ↔ src/Phase_Concentration_Metric.jl, lines 72 to 132 · score 0.55 · impulse train, oscillator response, peak rate, Error, event, derivative · block
oscr:b:1ZY3ZZPF2AF1C-7· Report a mismatch - [18] § Results ↔ Plot_IEPC.jl, lines 165 to 249 · score 0.53 · transient response, phoneme onset, subtracted, IEPC, baseline, window · block
oscr:b:BZPXJRJE4QG9Z-4· Report a mismatch - [19] § Materials and Methods › Evaluation metrics and statistical analyses › Phase concentration metric ↔ src/Phase_Concentration_Metric.jl, lines 205 to 229 · score 0.53 · frequency domain, Gaussian, width, metric, concentration, filtered · block
oscr:b:Z4PX4WKHJ5HF3-A· Report a mismatch - [20] § Results ↔ Plot_paper_results_figures_and_stats.jl, lines 692 to 728 · score 0.52 · unvoiced stops, nasals, sibilants, EEG, vowel, ITPC · block
oscr:b:H6JGN1BR6MH5H-O· Report a mismatch - [21] § Materials and Methods › Model dynamics investigation › IEPC about phoneme onsets ↔ Plot_IEPC.jl, lines 165 to 249 · score 0.51 · phoneme onset, subtracted, segmented, IEPC, baseline, transient · block
oscr:b:BZPXJRJE4QG9Z-4· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Julia · 403 lines · 22 KB · MIT · 7 matches
- ### code to run Phase concentration metric tests on each model.
- ### needs sine wave stimuli, from which impulse trains of a range of frequencies can be extracted from the peaks.
- using FFTW, DSP, Statistics
- ### reformed drive interpolators generator to create sine waves of varying frequency for PCM tests.
- """
- Will make an "interpolators" array that contains interpolations of 20 sine waves of different frequency and put it in global variable Interpolators.
- This can then be used in the ensemble simulation via the interpolation selector variable in a prob_func
- """
- function generate_sine_drive_interpolators_for_saving(sampling_rate::Float64,frequency_range::Tuple{Float64,Float64},stimulus_set_number::Int)
- sr=sampling_rate
- stimlength=sr*10 #code expects 10 seconds, 5 seconds of noise, 5 seconds of stimulus.
- times=range(0.0,10.0,length=Int(stimlength))
- frequencies=range(frequency_range[1],frequency_range[2],length=20*3) #20 frequencies per stimulus set, 3 stimulus sets. 60 freqs.
- sine_drives=Vector{Any}(undef,20)
- for trial in 1:20
- #will go through the noise samples in triplets: 1 is the before stimulus noise, 1 is during stimulus and 1 is after stimulus
- #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
- #drive is [noise,stimulus,noise,zeroes] (in case it runs over, making extrapolation to be 0 only)
- 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
- xs=1:1:length(trial_drive_input)
- sine_drives[trial]=linear_interpolation(xs,trial_drive_input,extrapolation_bc=Line())
- #interpolators[trial]=interpolate(Vector(trial_drive_input),BSpline(Linear()))#,extrapolation_bc=Line())
- end
- return sine_drives #look into typed global
- end
- # new prob func for the oscillator. this will update its frequency to match the stimulus frequency.
- function vary_noise_and_initial_conditions_and_natfreq(prob,i,repeat)
- prob.p.noise_selector=i
- freqs=prob.p.frequencies
- prob.p.F=freqs[Int64(i+20*(prob.p.noise_case_reference-1))] #set natural frequency to match stimulus frequency.
- 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.
- prob
- end
- function get_coupled_oscillator_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
- condition="PCM"
- println("testing: ",condition)
- flush(stdout)
- saveat=1/44100
- response_sr=Int64(1/saveat)
- frequencies=range(freq_range[1],freq_range[2],length=60)#[1:50] #cut to 50 to avoid failed simulations at high freq end.
- all_60_trials=Vector{Any}()
- all_stimuli=Vector{Any}()
- for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
- println("stimulus set: ",stimulus_idx)
- p.noise_case_reference=stimulus_idx
- p.noise_selector=1
- flush(stdout)
- #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
- if stimulus_type=="envelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- elseif stimulus_type=="derivative"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakrate"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakenvelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_unitary_peakenv_impulses(interpolators_global, Float64(response_sr))
- else
- error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
- end
- #drive scaling as per phoneme case workflow.
- max_stimulus_amplitude=maximum(maximum.(interpolators_global))
- p.drive_amplitude=20000/mean(sum.([i[5.0*response_sr:10.0*response_sr] for i in interpolators_global]))
- 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.
- println("running sim")
- flush(stdout)
- if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
- trialdata=Ensemble_CoupledOscillators_modulated_PCM(vary_noise_and_initial_conditions_and_natfreq,time_range,p,u_init,20,saveat)
- else
- trialdata=Ensemble_CoupledOscillators_modulated_PCM(vary_noise_and_initial_conditions_and_natfreq,time_range,p,u_init,20,saveat)
- end
- push!(all_60_trials,trialdata...)
- push!(all_stimuli,interpolators_global...)
- end
- 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.
- #save the rates for each trial, for comparison across natural frequencies, and computation of conglomerate activity if desired.
- if save_traj
- #check dir exists:
- if !isdir(savepath*"Trajectories/")
- mkdir(savepath*"Trajectories/")
- end
- local name="Trajectories/$(response_sr)sr_oscillator_response_to_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
- CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
- generate_arrow(name,savepath)
- rm(savepath*name*".csv")
- end
- return(PCM_vectors)
- end
- function get_evoked_model_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
- condition="PCM"
- println("testing: ",condition)
- flush(stdout)
- saveat=1/44100
- response_sr=Int64(1/saveat)
- frequencies=range(freq_range[1],freq_range[2],length=60) #cut to 50 to avoid failed simulations at high freq end.
- all_60_trials=Vector{Any}()
- all_stimuli=Vector{Any}()
- for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
- println("stimulus set: ",stimulus_idx)
- p.noise_case_reference=stimulus_idx
- p.noise_selector=1
- flush(stdout)
- #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
- if stimulus_type=="envelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- elseif stimulus_type=="derivative"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakrate"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakenvelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_unitary_peakenv_impulses(interpolators_global,Float64(response_sr))
- else
- error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
- end
- println("running sim")
- flush(stdout)
- if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
- trialdata=Ensemble_EvokedModel(vary_noise_and_initial_conditions_evokedmodel,time_range,p,u_init,20,saveat)
- else
- trialdata=Ensemble_EvokedModel(vary_noise_and_initial_conditions_evokedmodel,time_range,p,u_init,20,saveat)
- end
- push!(all_60_trials,trialdata...)
- push!(all_stimuli,interpolators_global...)
- end
- 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.
- #save the rates for each trial, for comparison across natural frequencies, and computation of congolmerate activity if desired.
- if save_traj
- #check dir exists:
- if !isdir(savepath*"Trajectories/")
- mkdir(savepath*"Trajectories/")
- end
- local name="Trajectories/evoked_model_response_to_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
- CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
- generate_arrow(name,savepath)
- rm(savepath*name*".csv")
- end
- return(PCM_vectors)
- end
- function get_NGNMM_PCM_across_60freqs_randinitcond(p,u_init,time_range,PCMrange,freq_range,save_traj,savepath,stimulus_type)
- condition="PCM"
- println("testing: ",condition)
- flush(stdout)
- saveat=1/44100
- response_sr=Int64(1/saveat)
- C=p.C
- vsyn=p.vsyn
- frequencies=range(freq_range[1],freq_range[2],length=60)#[1:50] #cut to 50 to avoid failed simulations at high freq end.
- @info "Frequencies being tested: $(frequencies)"
- all_60_trials=Vector{Any}()
- all_stimuli=Vector{Any}()
- for stimulus_idx in 1:3 #3 sets of 20 stimuli to cover 60 frequencies, structured this way to match prior phoneme drive generation.
- println("stimulus set: ",stimulus_idx)
- p.noise_case_reference=stimulus_idx
- p.noise_selector=1
- flush(stdout)
- #set stimulus based on type: either normal envelopes, or derivative or event based impulse trains (peak rate or peak envelope)
- if stimulus_type=="envelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- elseif stimulus_type=="derivative"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_smooth_derivative(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakrate"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_scaled_peakrate_impulses(interpolators_global,Float64(response_sr))
- elseif stimulus_type=="peakenvelope"
- global interpolators_global = jldopen("./Sine_Drives/drive_interpolators_$(stimulus_idx).jld2","r")["drives"]
- interpolators_global=get_unitary_peakenv_impulses(interpolators_global,Float64(response_sr))
- else
- error("Unknown stimulus type: $(stimulus_type), must be one of 'envelope', 'derivative', 'peakrate', or 'peakenvelope'.")
- end
- println("running sim")
- flush(stdout)
- if stimulus_idx==3 #to match the cut to 50 frequencies above. #no longer cut.
- trialdata=Ensemble_NoisyPhoneme_PCM(vary_noise_and_initial_conditions_NGNMM,time_range,p,u_init,20,saveat)
- else
- trialdata=Ensemble_NoisyPhoneme_PCM(vary_noise_and_initial_conditions_NGNMM,time_range,p,u_init,20,saveat)
- end
- push!(all_60_trials,trialdata...)
- push!(all_stimuli,interpolators_global...)
- end
- 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.
- #save the rates for each trial, for comparison across natural frequencies, and computation of congolmerate activity if desired.
- if save_traj
- #check dir exists:
- if !isdir(savepath*"Trajectories/")
- mkdir(savepath*"Trajectories/")
- end
- local name="Trajectories/fast_NGNMM_response_to_abs_sine_stimulus_freq_range_$(freq_range[1])to$(freq_range[2])Hz_$(stimulus_type)_transformed"
- CSV.write(savepath*name*".csv",DataFrame(rates,:auto),writeheader=true)
- generate_arrow(name,savepath)
- rm(savepath*name*".csv")
- end
- return(PCM_vectors)
- end
- function gaussian_filter_and_hilbert_for_PCM(signal::Vector{Float64},sampling_rate,peak_frequency::Float64)
- num_samples=length(signal)
- #put in frequency domain
- freqs=fftfreq(num_samples,sampling_rate)
- signal_fft=fft(signal)
- #gaussian filter parameters
- center_frequency=peak_frequency
- filter_width=center_frequency/2.0
- #gaussian filter:
- gauss_kernel=exp.(-0.5.*((abs.(freqs).-center_frequency)./(filter_width)).^2)
- #apply in freq domain;
- filtered_signal_fft=signal_fft.*gauss_kernel
- #return to time domain:
- filtered_signal=ifft(filtered_signal_fft)
- #return envelope via hilbert
- analytic_signal=hilbert(real.(filtered_signal))
- return analytic_signal
- end
- function calculate_PCM_oscillator_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,PCMrange,noise_seed=123)
- num_trials=length(vector_of_solutions)
- rates_sr=response_sampling_rate
- #add noise to the model response ('firing rates'):
- rates=Array{Vector}(undef,num_trials)
- for (idx,data) in enumerate(vector_of_solutions)
- rates[idx]= coupled_oscillator_activity(data)[Int64(PCMrange[1]*rates_sr):Int64(PCMrange[2]*rates_sr)]#cos(theta).*r for coupled oscillator activity
- trialwise_seed=noise_seed+idx
- 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.
- noise_power=mean(noises.^2)
- rate_power=mean(rates[idx].^2)
- # desired_signal_to_noise_ratio=0.5 #for high SNR test.
- desired_signal_to_noise_ratio=100.0 #for clean test.
- noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
- scaled_noise=noises.*noise_scaling_factor
- noisy_rates=(rates[idx]).+(scaled_noise)
- rates[idx]=noisy_rates
- end
- #compute PCM vectors.
- mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
- for trial_idx in 1:num_trials
- #get the stimulus for this trial:
- stimulus_interpolator=stimuli[trial_idx]
- #get the peak frequency of this stimulus:
- peak_frequency=frequencies[trial_idx]
- #turn stimulus interpolator into values over time range matching the response sampling rate:
- # response_idx=range(PCMrange[1]*44100,PCMrange[2]*44100,step=1)
- response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
- # response_times=response_idx./44100.0
- response_times=response_idx./rates_sr
- # stimulus_idxs=response_times.*44100.0 #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
- stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
- stimulus_values=1.0 .+ stimulus_interpolator(stimulus_idxs)
- #filter and get instantaneous phase:
- if trial_idx==1
- @info size(rates[trial_idx])
- @info size(stimulus_values)
- end
- filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
- filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
- #get phases
- instantaneous_response_phase=angle.(filtered_response)
- instantaneous_stimulus_phase=angle.(filtered_stimulus)
- #get phase diff:
- phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
- #convert to complex unit vector form:
- phase_diff_vectors=exp.(im.*phase_diff)
- #get average phase difference over time
- mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
- end
- PCM_vectors=mean_phase_diff_vectors
- return PCM_vectors,rates
- end
- function calculate_PCM_EvokedModel_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,PCMrange,noise_seed=123)
- num_trials=length(vector_of_solutions)
- rates_sr=response_sampling_rate
- #add noise to the model response ('firing rates'):
- rates=Array{Vector}(undef,num_trials)
- for (idx,data) in enumerate(vector_of_solutions)
- 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.
- trialwise_seed=noise_seed+idx
- 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.
- noise_power=mean(noises.^2)
- rate_power=mean(rates[idx].^2)
- # desired_signal_to_noise_ratio=0.5 #for high SNR test.
- desired_signal_to_noise_ratio=100.0 #for clean test.
- noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
- scaled_noise=noises.*noise_scaling_factor
- noisy_rates=(rates[idx]).+(scaled_noise)
- rates[idx]=noisy_rates
- end
- #compute PCM vectors.
- mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
- for trial_idx in 1:num_trials
- #get the stimulus for this trial:
- stimulus_interpolator=stimuli[trial_idx]
- #get the peak frequency of this stimulus:
- peak_frequency=frequencies[trial_idx]
- #turn stimulus interpolator into values over time range matching the response sampling rate:
- response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
- response_times=response_idx./rates_sr
- stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
- stimulus_values=stimulus_interpolator(stimulus_idxs)
- #filter and get instantaneous phase:
- if trial_idx==1
- @info size(rates[trial_idx])
- @info size(stimulus_values)
- end
- filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
- filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
- #get phases
- instantaneous_response_phase=angle.(filtered_response)
- instantaneous_stimulus_phase=angle.(filtered_stimulus)
- #get phase diff:
- phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
- #convert to complex unit vector form:
- phase_diff_vectors=exp.(im.*phase_diff)
- #get average phase difference over time
- mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
- end
- PCM_vectors=mean_phase_diff_vectors
- return PCM_vectors,rates
- end
- function calculate_PCM_NGNMM_noisyrates(vector_of_solutions,stimuli,frequencies,response_sampling_rate,timerange,C,vsyn,PCMrange,noise_seed=123)
- num_trials=length(vector_of_solutions)
- rates_sr=response_sampling_rate
- #add noise to the model response ('firing rates'):
- rates=Array{Vector}(undef,num_trials)
- for (idx,data) in enumerate(vector_of_solutions)
- rates[idx]=get_firing_rate_NMM(data,C,vsyn)[1][Int64(PCMrange[1]*rates_sr):Int64(PCMrange[2]*rates_sr)]#
- trialwise_seed=noise_seed+idx
- 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.
- noise_power=mean(noises.^2)
- rate_power=mean(rates[idx].^2)
- # desired_signal_to_noise_ratio=0.5 #for high SNR test.
- desired_signal_to_noise_ratio=100.0 #for clean test.
- noise_scaling_factor=sqrt(rate_power/(noise_power*desired_signal_to_noise_ratio))
- scaled_noise=noises.*noise_scaling_factor
- noisy_rates=(rates[idx]).+(scaled_noise)
- rates[idx]=noisy_rates
- end
- #compute PCM vectors.
- mean_phase_diff_vectors=Vector{ComplexF64}(undef,num_trials)
- for trial_idx in 1:num_trials
- #get the stimulus for this trial:
- stimulus_interpolator=stimuli[trial_idx]
- #get the peak frequency of this stimulus:
- peak_frequency=frequencies[trial_idx]
- if trial_idx==1
- @info "peak frequency for trial 1: $(peak_frequency)"
- end
- #turn stimulus interpolator into values over time range matching the response sampling rate:
- response_idx=range(PCMrange[1]*rates_sr,PCMrange[2]*rates_sr,step=1)
- response_times=response_idx./rates_sr
- stimulus_idxs=response_times.*rates_sr #stimulus at 44100Hz sampling rate. (hang over from phoneme drive interpolator.)
- # stimulus_values=stimulus_interpolator(stimulus_idxs)
- stimulus_values=1.0 .+(stimulus_interpolator(stimulus_idxs)) #set to abs to match what the NGNMM recieved.
- #filter and get instantaneous phase:
- if trial_idx==1
- @info size(rates[trial_idx])
- @info size(stimulus_values)
- end
- filtered_response=gaussian_filter_and_hilbert_for_PCM(rates[trial_idx],rates_sr,peak_frequency)
- filtered_stimulus=gaussian_filter_and_hilbert_for_PCM(stimulus_values,rates_sr,peak_frequency)
- #get phases
- instantaneous_response_phase=angle.(filtered_response)
- instantaneous_stimulus_phase=angle.(filtered_stimulus)
- #get phase diff:
- phase_diff=instantaneous_response_phase.-instantaneous_stimulus_phase
- #convert to complex unit vector form:
- phase_diff_vectors=exp.(im.*phase_diff)
- #get average phase difference over time
- mean_phase_diff_vectors[trial_idx]=mean(phase_diff_vectors)
- end
- PCM_vectors=mean_phase_diff_vectors
- return PCM_vectors,rates
- end
Phase_Concentration_Metric.jl at commit 7df5e28, under MIT · at the source
Overview
- School of Computer Science, University of Bristol, Bristol BS8 1TH, United Kingdom
- School of Engineering Mathematics and Technology, University of Bristol, Bristol BS8 1TH, United Kingdom
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
7df5e283a78c36c77fc39686b403526c03b4c553, 25 June 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
21 files
- Compute_ITPCs_Across_Pho
nemes_ControlCase_modula , Julia, 75 linested_randinitconds.jl - Compute_ITPCs_Across_Pho
nemes_ControlCase_modula , Julia, 76 linested_randinitconds_vary_n atural_frequency_savetra j.jl - Compute_ITPCs_Across_Pho
nemes_EvokedODEModel_ran , Julia, 64 linesdinitconds.jl - Compute_ITPCs_Across_Pho
nemes_randinitconds_1of. , Julia, 102 linesjl - Compute_and_plot_PCM.jl, Julia, 186 lines, 1 match
- Generate_Drives.jl, Julia, 57 lines
- Generate_Noise.jl, Julia, 44 lines, 1 match
- Generate_Phoneme_Envelop
es.jl , Julia, 22 lines - Generate_Sine_Drives.jl, Julia, 40 lines
- Plot_IEPC.jl, Julia, 253 lines, 4 matches
- Plot_IEPC_ringing_after_
end_of_stimulus.jl , Julia, 180 lines, 2 matches - Plot_concordance_coeffic
ient_heatmaps.jl , Julia, 264 lines - Plot_example_trajectorie
s.jl , Julia, 135 lines - Plot_paper_results_figur
es_and_stats.jl , Julia, 1,142 lines, 2 matches - Plot_phase_reset_ripples
.jl , Julia, 177 lines - Plot_vary_stim_rate.jl, Julia, 40 lines
- Vary_Stimulus_Rate.jl, Julia, 723 lines
- src/
NGNMM_NSP_paper_code.jl , Julia, 1,596 lines, 4 matches - src/
Phase_Concentration_Metr , Julia, 403 lines, 7 matchesic.jl - LICENSE, License, 21 lines
- README.md, Text, 60 lines
Code accessibility
The code/
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://
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/
url = {https://
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/
VL - 13
IS - 8
SP - ENEURO.0379
EP - 25.2026
SN - 2373-2822
PB - Society for Neuroscience
DO - 10.1523/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1523/
"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":
"volume": "13",
"issue": "8",
"page": "ENEURO.0379-25.2026",
"DOI": "10.1523/
"PMID": "42547453",
"PMCID": "PMC13505880",
"ISSN": "2373-2822",
"publisher": "Society for Neuroscience",
"URL": "https://
"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.3389/fnins.2022.826105 [code]
- Syllable-Initial Phonemes Affect Neural Entrainment to Consonant-Vowel Syllables.Journal: Frontiers in neuroscienceIn common: EEG, 8 references, author Conor Houghton
- [2] doi:10.1523/jneurosci.1663-22.2023 [code]
- Phase Alignment of Low-Frequency Neural Activity to the Amplitude Envelope of Speech Reflects Evoked Responses to Acoustic Edges, Not Oscillatory Entrainment.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: 11 references
- [3] doi:10.1371/journal.pcbi.1014222 [code]
- Neural population models for EEG: From Canonical models to alternative model structures.Journal: PLoS computational biologyIn common: DifferentialEquations.jl, Distributions.jl, DataFrames.jl, 1 other tool, EEG, 2 references
- [4] doi:10.7554/elife.84602 [code]
- Bayesian analysis of phase data in EEG and MEG.Journal: eLifeIn common: Distributions.jl, DataFrames.jl, EEG, 1 reference, author Conor Houghton
- [5] doi:10.1371/journal.pbio.3001713
- Neural dynamics differentially encode phrases and sentences during spoken language comprehension.Journal: PLoS biologyIn common: EEG, 8 references
- [6] doi:10.1162/nol_a_00141 [code]
- Exploring the Interplay Between Language Comprehension and Cortical Tracking: The Bilingual Test Case.Journal: Neurobiology of language (Cambridge, Mass.)In common: EEG, 8 references
- [7] doi:10.1002/hbm.70199 [code]
- Temporal Structure of Music Improves the Cortical Encoding of Speech.Journal: Human brain mappingIn common: EEG, 8 references
- [8] doi:10.1126/sciadv.ado8915 [code]
- The human auditory cortex concurrently tracks syllabic and phonemic timescales via acoustic spectral flux.Journal: Science advancesIn common: 8 references
- [9] doi:10.1371/journal.pone.0320519 [code]
- Anatomically distinct cortical tracking of music and speech by slow (1-8Hz) and fast (70-120Hz) oscillatory activity.Journal: PloS oneIn common: 7 references
- [10] doi:10.7554/elife.75515 [code]
- Neural synchronization is strongest to the spectral flux of slow music and depends on familiarity and beat salience.Journal: eLifeIn common: EEG, 7 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 19 scripts, and 21 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:4f933e1d61d65896…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1523/eneuro.0379-25.2026)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1523/eneuro.0379-25.2026.svg
:target: https://openscicode.org/badge/doi/10.1523/eneuro.0379-25.2026
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1523/eneuro.0379-25.2026"><img src="https://openscicode.org/badge/doi/10.1523/eneuro.0379-25.2026.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
