KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NoiseGenerator.m
Go to the documentation of this file.
1 namespace models{
2 namespace motoneuron{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
20  :public handle {
38  public:
39 
40  RandSeed = 100000;
41 
42 
56  public:
57 
59 
61 
62  a;
63 
64  b;
65 
66  AP;
67 
69 
71 
73 
74 
75  public:
76 
78  mc = metaclass(this);
79  p = load(fullfile(fileparts(which(mc.Name))," neuro_input "));
80  this.factor= sqrt(p.thetaP)*(1/p.scaleP);
81  this.AP= p.AP;
82  [this.b, this.a] = butter(2,p.LOWPASSP*2/1000," low ");
83  /* Base noise */
84  this.baseNoise= p.noiseP;
85  this.baseMean= mean(p.noiseP);
86  }
102  function setFibreType(mu_fibretype) {
103  rs = RandStream(" mt19937ar "," Seed ",round(this.RandSeed*mu_fibretype*100));
104  noiseSI = filter(this.b,this.a,rs.randn(1,length(this.baseNoise)));
105  /* Independent noise */
106  iNoise = this.factor/std(noiseSI)*noiseSI;
107  /* The mean current only goes into the independent noise, so we do this
108  * transformation here already and use a 2D input function. */
109  this.indepNoise= (iNoise + 1)*this.AP;
110  this.indepMean= mean(this.indepNoise);
111  }
112 
113 
114  function u = getInput(double t) {
115 
116  if this.DisableNoise
117  u = zeros(2,length(t));
118  u(1,:) = this.baseMean;
119  u(2,:) = this.indepMean;
120  else
121  pos = round(mod(t,length(this.baseNoise))+1);
122 
123  /* total noise. the mean current incl. factor is build into the affine input
124  * mapping B. */
125  u = [this.baseNoise(pos); this.indepNoise(pos)];
126  end
127  }
143 };
144 }
145 }
146 
logical DisableNoise
Set this to true to disable noisy signal output.
Matlab's base handle class (documentation generation substitute)
A boolean value.
function setFibreType(mu_fibretype)
NoiseGenerator()
Loads the experimental data for motoneuron noise input.
NoiseGenerator: Models the noise input for the motoneuron model as done in the original script by Fra...
function u = getInput(double t)
The raw noise data is available in a sampling interval of one millisecond. As the global model unit i...