ASPL Manual v 1.00
© 2024 by SetSphere.COM
[TIE OSCILATOR SIGNALS TO ATTRIBUTES]
WORKSPACE SIGNALS DESCRIPTION:
This workspace demonstrates how you can tie oscillating signals to ASPL attributes.
Create the element grouping class:
# metagrouping -creategrouping OSCILLATORSGROUP -attributes "fosc1,t" "fosc2,t" "fx,i"
Edit /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/Feeder/Udev.pm
Edit /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/TieScaAttDev.pm
Start ASPL with workspace SIGNALS using the element grouping class OSCILLATORSGROUP:
# aspl -wsname SIGNALS -groupingclass OSCILLATORSGROUP
① aspl> S12 = ggoscillators(fonames,fosc1 fosc2,cycles,1,points,1000)
② aspl> split S12 into S1 S2
③ aspl> ks fx
④ aspl> f&`ks= S1 S2
Now you can see where the signals intersected
Since ASPL variables are case sensitive, then we can create s12 with only 300 points, hence
lowering the granularity of the points.
⑤ aspl> s12 = ggoscillators(fonames,fosc1 fosc2,cycles,1,points,300)
⑥ aspl> split s12 into s1 s2
⑦ aspl> f&`ks= s1 s2
With 300 points, there is no interesction because of floating point truncation.
The intersection of s1 and s2 showed no intersecting points because the number of points is 300. This is a limitation when doing arithmetical processing on a computer. Usually the interesction of two signals (or any two continuous functions) can be resolved by doing piecewise regression between the two functions where the points are likely to intersect. This is beyond the point of ASPL calculator and we won't be treating here. However, ASPL attributes can be of type lambda code, see the BAYS12MON example on how to have attributes processing the result of other attributes using anonymous functions.For the sake of explanation, we will show the graphical representation of the signals S1 and S2 and zoom into the intersecting area. We will also show the intersection of the signals s1 and s2 and zoom into the intersecting area.
⑧ aspl> cd ~tmp
⑨ aspl> ll
# npdata -indata foo~fosc1_fosc2~1~1000
Figure foo~fosc1_fosc2~1~1000.png
# npdata -indata foo~fosc1_fosc2~1~1000 -zoom 120,0.6,150,0.8,0.7,0.7,0.1,0.1
Figure foo~fosc1_fosc2~1~1000-zoom-signal-intersection-point1.png
# npdata -indata foo~fosc1_fosc2~1~1000 -zoom 605,-0.60,635,-0.75,0.7,0.7,0.1,0.1
Figure foo~fosc1_fosc2~1~1000-zoom-signal-intersection-point2.png
# npdata -indata foo~fosc1_fosc2~1~300
Figure foo~fosc1_fosc2~1~300.png
# npdata -indata foo~fosc1_fosc2~1~300 -zoom 25,0.6,45,0.8,0.7,0.7,0.1,0.1
Figure foo~fosc1_fosc2~1~300-zoom-nointersection-point1.png
# npdata -indata foo~fosc1_fosc2~1~300 -zoom 180,-0.60,190,-0.75,0.7,0.7,0.2,0.2
Figure foo~fosc1_fosc2~1~300-zoom-nointersection-point2.png
Note that the OSCILLATORSGROUP grouping class has been created with the metagrouping command: the attributes fosc1 and fosc2 are of type t or tied. You can issue the command attributes at the ASPL prompt to view the list of attributes and their meta data definition.
################################# OUTPUT OF metagrouping # metagrouping -creategrouping OSCILLATORSGROUP -attributes "fosc1,t" "fosc2,t" "fx,i" att[fosc1] typ[t] att[fosc2] typ[t] att[fx] typ[i] ::::::::::::::::::: GOOD fosc1,t fosc2,t fx,i creategrouping OSCILLATORSGROUP @@@ WARNING: TIE IS NOT SUPPORTED IN THIS VERSION - INTERNAL USE v2 @@@ @@@ WARNING: TIE IS NOT SUPPORTED IN THIS VERSION - INTERNAL USE v2 @@@ ADDED ELMD: /opt/ASPLv1.00/BRIDGE/ASPL/Groupings/Elements/Attributes/OSCILLATORSGROUP.ELMD ADDED /opt/ASPLv1.00/BRIDGE/ASPL/Groupings/Elements/OSCILLATORSGROUP/PrintableFormats.pm ADDED /opt/ASPLv1.00/BRIDGE/ASPL/Groupings/Elements/OSCILLATORSGROUP/Proc.pm ADDED /opt/ASPLv1.00/BRIDGE/ASPL/Groupings/Elements/OSCILLATORSGROUP/Proc1.pm Udev UNIX DEVICE MODULE CREATED: /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/Feeder/Udev.pm @@@ YOU MAY NEED TO EDIT /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/Feeder/Udev.pm TO MAKE CHANGES TO WHAT IS RETURNED BY THE UNIX DEVICES ATTRIBUTES WITH HOOKS: ADDED /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/TieScaAttDev.pm ADDED /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/TiSCA_fosc1.pm ADDED /opt/ASPLv1.00/BRIDGE/ASPL/GGs/OSCILLATORSGROUP/TiSCA_fosc2.pm OSCILLATORSGROUP HAS BEEN ADDED
This example is shown in the following terminal.
terminal for example: TIE OSCILATOR SIGNALS TO ATTRIBUTES