Simulating Lossy or Custom Transmission Lines, using NG-Spice.

One of the fun things that can be done using the Open-Source circuit-simulator ‘NG-Spice’ is, that transmission lines can be simulated, with the parameters ‘Z0′ and ‘TD’, which stand for the characteristic impedance, and the delay down the length of the transmission line. However, what some people have noticed, and recorded as a bug, elsewhere on the Web, is, that such transmission lines will appear to have ideal behaviour right down to ‘DC frequencies’.

Rather than to think of this as a bug, I’d categorize this as the behaviour, that if the ‘RefDes’ of the transmission line begins with the letter ‘T’, NG-Spice will always simulate a lossless transmission line.

What some people might prefer is, to simulate a lossy transmission line. And When using NG-Spice, this capability is available, but hidden. Basically, NG-Spice uses the same simulation engine, to simulate the Netlists, that other versions of Spice will use. But, the Open-Source version will be lacking in GUI support, as well as in the available libraries of components.

The key to understanding, how to simulate a lossy transmission line, is, that NG-Spice will only process them as being a different type of component, if their reference descriptor begins with the letter ‘O’. This is similar to how NG-Spice will require that the ‘RefDes’ begin with the letter ‘X’, if what is to be simulated, is some sort of sub-circuit. But, because this will stem from a modelcard, the model of the transmission line will actually need to be specified within the Schematic Editor, as the Value of the component, for which there also needs to be a Model entry in the schematic, that points to the file, which will define the model. This Model entry will have a reference descriptor, beginning with the letter ‘A’…

(Updated 6/07/2021, 2h25… )

Continue reading Simulating Lossy or Custom Transmission Lines, using NG-Spice.

A single time-delay can also be expressed in the frequency-domain.

Another way to state, that a stream of time-domain samples has been given a time-delay, is simply to state that each frequency-coefficient has been given a phase-shift, that depends both on the frequency of the coefficient, and on the intended time-delay.

A concern that some readers might have with this, is the fact that a number of samples need to be stored, in order for a time-delay to be executed in the time-domain. But as soon as differing values for coefficients, for a Fourier Transform, are spaced closer together, indicating in this case a longer time-delay, its computation also requires that a longer interval of samples in the time-domain need to be combined.

Now, if the reader would like to visualize what this would look like, as a homology to a graphical equalizer, then he would need to imagine a graphical equalizer the sliders of which can be made negative – i.e. one that can command, that one frequency come out inverted – so that then, if he was to set his sliders into the accurate shape of a sine-wave that goes both positive and negative in its settings, he should obtain a simple time-delay.

But there is one more reason for which this homology would be flawed. The type of Fourier Transform which is best-suited for this, would be the Discrete Fourier Transform, not one of the Discrete Cosine Transforms. The reason is the fact that the DFT accepts complex numbers as its terms. And so the reader would also have to imagine, that his equalizer not only have sliders that move up and down, but sliders with little wheels on them, from which he can give a phase-shift to one frequency, without changing its amplitude. Obviously graphical equalizers for music are not made that way.

Continue reading A single time-delay can also be expressed in the frequency-domain.