/// <summary> /// Initializes a new instance of the <see cref="Noise"/> class. /// </summary> /// <param name="context">The context.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception> public Noise(IComponentBindingContext context) : base(context) { _state = context.GetState <INoiseSimulationState>(); _rs = new NoiseThermal("rs", ComplexVariables.Positive, ComplexVariables.PosPrime); _id = new NoiseShot("id", ComplexVariables.PosPrime, ComplexVariables.Negative); _flicker = new NoiseGain("flicker", ComplexVariables.PosPrime, ComplexVariables.Negative); }
/// <summary> /// Initializes a new instance of the <see cref="Noise"/> class. /// </summary> /// <param name="context">The context.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception> public Noise(IComponentBindingContext context) : base(context) { var complex = context.GetState <IComplexSimulationState>(); _noise = context.GetState <INoiseSimulationState>(); var c = complex.GetSharedVariable(context.Nodes[0]); var b = complex.GetSharedVariable(context.Nodes[1]); var e = complex.GetSharedVariable(context.Nodes[2]); var bp = BasePrime; var cp = CollectorPrime; var ep = EmitterPrime; _rc = new NoiseThermal("rc", c, cp); _rb = new NoiseThermal("rb", b, bp); _re = new NoiseThermal("re", e, ep); _ic = new NoiseShot("ic", cp, ep); _ib = new NoiseShot("ib", bp, ep); _flicker = new NoiseGain("1/f", bp, ep); }