-
Notifications
You must be signed in to change notification settings - Fork 0
/
noisy_ILFP_2CG.m
106 lines (88 loc) · 4.55 KB
/
noisy_ILFP_2CG.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
94
95
96
97
98
99
100
101
102
103
104
105
106
function [Mitral GraProximal GraDistal Feedforward Pyramidal Feedback param InputCurrent MitILFPs GraProxILFPs GraDistILFPs FfoILFPs PyrILFPs] = noisy_ILFP_2CG(numtp, numtrials, input_file,Delay,Wfrac,Hd)
% Simulate LFP activity using membrane voltage
% INPUTS
%
% numtp - # time points in simulation
% numtrials - # times to run simulation
% OUTPUTS
MitILFPs.GradistMit = zeros(numtp,numtrials);
MitILFPs.GloMit = zeros(numtp,numtrials);
GraDistILFPs.MitGradist = zeros(numtp,numtrials);
GraProxILFPs.PyrGra = zeros(numtp,numtrials);
GraProxILFPs.GraGra = zeros(numtp,numtrials);
PyrILFPs.MitPyr = zeros(numtp,numtrials);
PyrILFPs.PyrPyr = zeros(numtp,numtrials);
PyrILFPs.FbaPyr = zeros(numtp,numtrials);
PyrILFPs.FfoPyr = zeros(numtp,numtrials);
FfoILFPs = zeros(numtp,numtrials);
%%% Must sum ALL currents into each neuron type
for ii = 1:numtrials
[Mitral GraProximal GraDistal Feedforward Pyramidal Feedback OSNsource param InputCurrent] = noisy_OB_PC_network_2CG(input_file,Delay,Wfrac);
% Mitral LFP
nmit = length(Mitral);
% Filter input currrents into Mit (ignore respiration)
Gradistmit_filtered = zeros(nmit,length(Mitral{1}.V));
% Glomit_filtered = zeros(nmit,length(Mitral{1}.V));
for n = 1:nmit
Gradistmit_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Igradistmit(n,:));
Gradistmit_filtered(n,:) = smoothts(Gradistmit_filtered(n,:),'b');
% Glomit_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Iglomit(n,:));
% Glomit_filtered(n,:) = smoothts(Glomit_filtered(n,:),'b');
end
MitILFPs.GradistMit(:,ii) = sum(Gradistmit_filtered,1);
% MitILFPs.GloMit(:,ii) = sum(Glomit_filtered,1);
% % Proximal Granule LFP
% ngra = length(GraProximal);
% % Filter input currrents into proximal Gra
% Mitgraprox_filtered = zeros(ngra,length(GraProximal{1}.V));
% Pyrgraprox_filtered = zeros(ngra,length(GraProximal{1}.V));
% Gragraprox_filtered = zeros(ngra,length(GraProximal{1}.V));
% for n = 1:ngra
% Mitgraprox_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Imitgraprox(n,:));
% Mitgraprox_filtered(n,:) = smoothts(Mitgraprox_filtered(n,:),'b');
% Pyrgraprox_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Ipyrgraprox(n,:));
% Pyrgraprox_filtered(n,:) = smoothts(Pyrgraprox_filtered(n,:),'b');
% Gragraprox_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Igragra(n,:));
% Gragraprox_filtered(n,:) = smoothts(Gragraprox_filtered(n,:),'b');
% end
% GraILFPs.MitGra(:,ii) = sum(Mitgraprox_filtered,1);
% GraILFPs.PyrGra(:,ii) = sum(Pyrgraprox_filtered,1);
% GraILFPs.GraGra(:,ii) = sum(Gragraprox_filtered,1);
% Distal Granule LFP
ngra = length(GraDistal);
MitGradist_filtered = zeros(ngra,length(GraDistal{1}.V));
for n = 1:ngra
MitGradist_filtered(n,:) = filtfilt(Hd.Numerator,1,GraDistal{n}.V);
MitGradist_filtered(n,:) = smoothts(MitGradist_filtered(n,:),'b');
end
GraDistILFPs.MitGradist(:,ii) = sum(MitGradist_filtered,1);
% Pyramidal LFP
% npyr = length(Pyramidal);
% MitPyr_filtered = zeros(npyr,length(Pyramidal{1}.V));
% PyrPyr_filtered = zeros(npyr,length(Pyramidal{1}.V));
% FbaPyr_filtered = zeros(npyr,length(Pyramidal{1}.V));
% FfoPyr_filtered = zeros(npyr,length(Pyramidal{1}.V));
% for n = 1:npyr
% MitPyr_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Imitpyr(n,:));
% MitPyr_filtered(n,:) = smoothts(MitPyr_filtered(n,:),'b');
% PyrPyr_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Ipyrpyr(n,:));
% PyrPyr_filtered(n,:) = smoothts(PyrPyr_filtered(n,:),'b');
% FbaPyr_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Ifbapyr(n,:));
% FbaPyr_filtered(n,:) = smoothts(FbaPyr_filtered(n,:),'b');
% FfoPyr_filtered(n,:) = filtfilt(Hd.Numerator,1,InputCurrent.Iffopyr(n,:));
% FfoPyr_filtered(n,:) = smoothts(FfoPyr_filtered(n,:),'b');
% end
% PyrILFPs.MitPyr(:,ii) = sum(MitPyr_filtered,1);
% PyrILFPs.PyrPyr(:,ii) = sum(PyrPyr_filtered,1);
% PyrILFPs.FbaPyr(:,ii) = sum(FbaPyr_filtered,1);
% PyrILFPs.FfoPyr(:,ii) = sum(FfoPyr_filtered,1);
% Feedforward LFP
% nffo = length(Feedforward);
% Feedforward_filtered = zeros(nffo,length(Feedforward{1}.V));
% for n = 1:nffo
% Feedforward_filtered(n,:) = filtfilt(Hd.Numerator,1,Feedforward{n}.V);
% Feedforward_filtered(n,:) = smoothts(Feedforward_filtered(n,:),'b');
% end
% FfoLFPs(:,ii) = sum(Feedforward_filtered,1)';
end
end