PyAMS  (the software under revision)

FM Current


Ideal linear electrical Current source

Information

Frequency Modulated Sinusoidal Current Source Model based or described by the following formula:

V(t) = IO + IA sin[2pfct + m sin(2pfst)]

Parameters

NameDefaultDescription
Ia1.0mAAmplitude of Ifm [Amper]
m1.0Modulation index
fc1KhzCarrier frequency [hz]
fs100.0hzSignal frequency [hz]

PyAMS definition

from PyAMS import Signal,RealTime
from math  import sin,pi
 
class SourceIfm:
     def __init__(self, p, n):
         #Signal
         self.Ifm = Signal('out','current',p,n)
         #Paramatres
         self.Ia=1.0e-3      #Amplitude of Ifm
         self.m=1.0        #Modulation index
         self.fc=1000.0    #Carrier frequency
         self.fs=100.0     #Signal frequency
         self.Offset=0.0
         self.StartTime=0.0
     def StepTime(self):
          return min(1/self.fc,1/self.fs)
     def analog(self):
         time=RealTime()
         self.Ifm+=self.Offset
         if time>=self.StartTime:
          self.Ifm+=self.Ia*sin(2*pi*self.fc*time+self.m*sin(2*pi*self.fs*time))

Documentation generated by PyAMS