The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> Circuit Simulators >> Analog Artist Waveform data structures? https://designers-guide.org/forum/YaBB.pl?num=1141952888 Message started by David Sobel on Mar 9th, 2006, 5:08pm |
Title: Analog Artist Waveform data structures? Post by David Sobel on Mar 9th, 2006, 5:08pm Hi, I have a number of questions, all of which can probably be answered by someone telling me the nature of the data structure that Artist uses for its waveforms. In short, if I knew the data structure and a good set of data access functions, there are a lot of things that would be FAR EASIER to do. The Artist Skill language reference lists a few relevant data access functions (i.e. drGetWaveformXvec, drCreateVec, etc), but they are a very limited, very klugdey set of data access functions. If someone can answer the following questions, and/or point me to a more exhaustive reference, I would really appreciate it! Here are some sample issues I have: 1. If I type plot(VT("/net9") as expected I get a plot of net9 with the waveform caption VT("/net9") . But if I type: foo = VT("/net9") plot(foo) I get the same plot with the same caption. Therefore the data structure contained in foo MUST contain a field with the string VT("/net9") , right? However, I have no idea how to access that data field or to modify it. (It seems as if the documentation explains how to get the X and Y vectors from a waveform data structure, but nothing else.) 2. I have similar issues with the data structures used for vectors. They are different than the list data structure, so there are very few data access/manipulation functions for this structure. For instance, I'm trying to right a function to calculate the SFDR of a waveform. In order to do this, I take a transient waveform and do the FFT of it. It's easy to get the magnitude of the peak tone in the fft (using the ymax function), but far harder to get the magnitude of the biggest spurious tone. I've managed to solve this issue by writing some really inelegant skill code, but if I understood how the data structure for drvec 's were structured (and manipulated/accessed), these tasks would be far easier. These are examples of what I'm up against. Any info you have on the drwave and drvec data structures would be much appreciated!! Thanks, David |
Title: Re: Analog Artist Waveform data structures? Post by Andrew Beckett on Mar 30th, 2006, 5:12am David, Apologies again (after your PM) for how long its taken me to get to this - just been a bit busy with family rather than having time to look at the Designer's Guide site, but pretty much caught up again now... Waveforms and vectors are specific objects in SKILL. Waveforms consist of an X and a Y vector, which are accessed like arrays, but using a particular function (drGetElem). There's also drSetElem() to update them. Some examples: Code:
As you can see from this, the expression is stored as a list on the y vector (a resonable place for it to be). Of course, it gets a bit more complicated with family curves, but the famMap function is usually what you'd use to iterate over those. Here's some example code which traverses a waveform, and does a modulo operation - it reads the source waveform, and builds a new waveform object from it. It also manipulates some of the properties on the waveform/vectors too. It's written in LISP syntax (tends to be my preference), but I think the meaning should be clear enough. You can always pp() it to convert it into C-like syntax if LISP syntax defeats you! Code:
Regards, Andrew. |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |