-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinjection_fc.m
93 lines (73 loc) · 2.78 KB
/
injection_fc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% INJECTION_FC: Generates figures comparing spiking behavior of
% model neurons in response to rectified sinusoidal current injections and
% FFE or FFEI synaptic input.
% Input characteristics
PR = [100 100 0];
F = logspace(log10(5), log10(1000), 50);
dt = 1e-4; % time bins
tmax = 5;
num_inputs = 10;
% Conductance parameters
Pmax_e_scaled = 1.6976e-7;
Pmax_e = [1.6976e-7*0.305 1.6976e-7*0.47 0]; % scaled Pmax so that power at 5Hz = 75Hz, alpha = 1.25
tau1i = [0.02 0 0]; % 50ms % 0.02 0.025 0.03 0.05 0.25 1 0
Im_amp = [0 0 8.38e-9];
FC = zeros(length(tau1i), length(F)); % store FCs
FC_avg = zeros(length(tau1i), length(F)); % store avg power for E/I transmission
FC_pct = zeros(length(tau1i), length(F)); % store % power at each freq for E/I transmission
disp('Starting simulations...')
for freq = 1:length(F)
if mod(freq-1,5) == 0
disp(['Progress: ' num2str(freq-1) ' frequencies analyzed'])
end
for tau = 1:length(tau1i)
FC_n = zeros(1, num_inputs); % store FC of LIF neuron for each spike train
FC_a = zeros(1, num_inputs); % store avg power of LIF neuron for each spike train
FC_p = zeros(1, num_inputs); % store percent power for each spike train
for n = 1:num_inputs
% simulate output power of triad synapse (or cell given current
% injection) using run_triad_model.m
input = generate_input(F(freq), 1, 0, 'tmax', tmax, 'PR', PR(tau),'Im_amp', Im_amp(tau));
output = run_triad_model(input, 1, 'Pmax_e', Pmax_e(tau), 'tau1i', tau1i(tau));
FC_n(n) = output.FC;
FC_a(n) = output.FC_avg;
FC_p(n) = output.FC_pct;
end
FC(tau, freq) = mean(FC_n);
FC_avg(tau,freq) = mean(FC_a);
FC_pct(tau,freq) = mean(FC_p);
end
end
% Plot FC figures
cmap = parula(5);
figure;
hold on;
plot(F, FC(1, :), 'color', cmap(1,:))
plot(F, FC(2, :), 'r-')
plot(F, FC(3, :), 'm-')
xlabel("Input modulation frequency (Hz)")
ylabel(["FC magnitude at the given input", ...
"modulation frequency (Hz) (FC_F)"])
legend("Balanced FFEI", "FFE", "8.38nA current injection")
set(gca, 'XScale', 'log')
box off;
figure;
hold on;
plot(F, FC_avg(1, :), 'color', cmap(1,:))
plot(F, FC_avg(2, :), 'r-')
plot(F, FC_avg(3, :), 'm-')
xlabel("Input modulation frequency (Hz)")
ylabel("Avg. FC magnitude over entire spectrum (Hz) (FC_a_v_g)")
legend("Balanced FFEI", "FFE", "8.38nA current injection")
set(gca, 'XScale', 'log')
box off;
figure;
hold on;
plot(F, FC_pct(1, :), 'color', cmap(1,:))
plot(F, FC_pct(2, :), 'r-')
plot(F, FC_pct(3, :), 'm-')
xlabel("Input modulation frequency (Hz)")
ylabel("FC_F/FC_a_v_g")
legend("Balanced FFEI", "FFE", "8.38nA current injection")
set(gca, 'XScale', 'log')
box off;