Next-Generation Neural Mass Models Reproduce Features of Speech Processing.
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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § Results ↔ src/Phase_Concentration_Metric.jl, lines 1–70 · score 0.55 · Phase concentration, sine waves, stimulus frequency, impulses, vectors, PCM
- [17] § Results ↔ src/Phase_Concentration_Metric.jl, lines 72–132 · score 0.55 · impulse train, oscillator response, peak rate, Error, event, derivative
- [18] § Results ↔ Plot_IEPC.jl, lines 165–249 · score 0.53 · transient response, phoneme onset, subtracted, IEPC, baseline, window
- [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] § Results ↔ Plot_paper_results_figures_and_stats.jl, lines 692–728 · score 0.52 · unvoiced stops, nasals, sibilants, EEG, vowel, ITPC
- [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
- ### 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.1371/journal.pcbi.1014222 [code]
- Neural population models for EEG: From Canonical models to alternative model structures.Journal: PLoS computational biologyIn 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 biologyIn 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 applicationsIn 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 biologyIn 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 nexusIn 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 biologyIn 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: NatureIn common: DataFrames.jl, Plots.jl, Distributions.jl
- [9] doi:10.7554/elife.89629 [code]
- Active dendrites enable robust spiking computations despite timing jitter.Journal: eLifeIn 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 biologyIn 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.
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:f09f34de18dc9ed8…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
