ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine


11-6

   TIE OSCILATOR SIGNALS TO ATTRIBUTES

[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

⑤  aspl> s12 = ggoscillators(fonames,fosc1 fosc2,cycles,1,points,300)

⑥  aspl> split s12 into s1 s2

⑦  aspl> f&`ks= s1 s2

There is no interesction because of float 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 treated here.

However, ASPL attributes can be of type lambda code, see the following example on

howto have attributes processing the result of other attributes using anonymous functions.

#################################

For the sake of explantion, we will show the grapical 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

You can see two files being created

~tmp/foo~fosc1_fosc2~1~1000

~tmp/foo~fosc1_fosc2~1~300

npdata -indata foo~fosc1_fosc2~1~1000

npdata -indata foo~fosc1_fosc2~1~1000 -zoom 120,0.6,150,0.8,0.7,0.7,0.1,0.1

npdata -indata foo~fosc1_fosc2~1~300

npdata -indata foo~fosc1_fosc2~1~300 -zoom 25,0.6,45,0.8,0.7,0.7,0.1,0.1

################################# 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.