Commit c07a754d authored by Sean Leavey's avatar Sean Leavey
Browse files

Support input noise in LISO output files

parent 6cafd09a
......@@ -19,3 +19,15 @@ Output coordinates
The parser assumes all outputs are in `db` and `degrees` (noise columns are
handled appropriately, however). This leads to incorrect results. This is
easily fixed but not yet implemented.
Differences in behaviour
Input noise sinks
In LISO, input noise is always specified at the input `node`, and not the input `component`, even if
the circuit input is a current (i.e. ``iinput``). This makes no difference to the computed spectra,
but it does influence the labels used to plot the data. In |Zero| simulations, and in parsed LISO
output files, the input noise sink is always set to whatever the circuit input actually is - either
the input node in the case of ``uinput`` or the input component in the case of ``iinput``.
......@@ -87,7 +87,7 @@ class LisoParser(metaclass=abc.ABCMeta):
"input_node_n": None,
"input_impedance": None,
"output_type": None,
"input_refer": None,
"input_refer": False,
"noise_output_element": None,
"response_outputs": [],
# Displayed noise.
......@@ -322,7 +322,15 @@ class LisoOutputParser(LisoParser):
def _build_noise(self, data):
"""Build noise outputs"""
# The data sink is always the noise output element
if self.input_refer:
if self.input_type == "voltage":
# The data sink is the circuit input node.
sink = self.input_node_p
# The data sink is the circuit input component.
sink = self._input_component
# The data sink is the noise output element.
sink = self.circuit[self.noise_output_element]
# Now that we have all the noise sources, create noise outputs.
......@@ -405,6 +413,10 @@ class LisoOutputParser(LisoParser):
self.n_nodes ='n')
def t_ANY_inputrefer(self, t):
self.input_refer = True
def t_ANY_noisysources(self, t):
# match start of noise source section
......@@ -459,6 +471,10 @@ class LisoOutputParser(LisoParser):
self.n_noise_sources ='nsource')
def t_ANY_noiseinputreferred(self, t):
def t_ANY_gnuplotoptions(self, t):
# match start of gnuplot section
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment