![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: countTriggers |
garth paine Member |
![]() ![]() ![]() Hi All I am developing an interactive dance work using the wireless bio-sensors from infusion systems - we are using EEG, ECG from the head and one arm muscle and a 2D accelerometer. I want to count the triggers from muscle activity in the face and so have the following ((!Brain gt: 0.4) countTriggers) however I really want to only count the trigger if the data has gone under a certain threshold since the last trigger - ie returned to zero or similar - what the current script does is count every transition ato above 0.4 even if they are just fast jitter around 0.4. so I want to get a cleaner count by saying that the data has to go below say 0.1 before a new count can be made. The data is continuous, so it does not jump up and down, and will go through all numbers on it's way to 0.4 and on the way back down. I also want to measure the durationBetweenTriggers in a similar way. Any suggestions welcome. You can hear some initial sounds here Thanks, Garth IP: Logged |
SSC Administrator |
![]() ![]() ![]() Hi Garth, It sounds like you might want to add hysteresis to your threshold computation. Hysteresis is kind of like inertia--the tendency to stick with your current decision until the contrary evidence becomes impossible to ignore any longer. You could get this by pasting a Threshold Sound in place of the threshold expression. One of the parameters is called Hysteresis. The value is true when input > (threshold + hysteresis). The value is false when (input - hysteresis) < threshold. In other words, your input has to go a bit higher in order for the Sound to change from false to true and it must drop a bit lower than threshold in order for the output to change from true to false. That way, if you have an input that is wavering about the threshold, you can prevent it from switching on and off on each jitter by increasing the Hysteresis value. Other expressions that might come in handy in this situation (but which are more like measures of stability over time): sameForLast: nbrMeasurements tolerance: epsilon trueForLast: nbrMeasurements [This message has been edited by SSC (edited 11 February 2008).] IP: Logged |
garth paine Member |
![]() ![]() ![]() Thanks - not sure how to proceed with the hysteresis thing - am away from Capy today - are there expressions looking at this in the library? Thanks, Garth IP: Logged |
Luddy Member |
![]() ![]() ![]() You could create two trigger counts, say, hicount and locount. hicount is incremented whenever locount equals hicount and the input value passes above 0.4. locount is triggered whenever locount is less than hicount and the input passes below 0.1. In other words, the counts are in lock step, registering hi-going and lo-going transitions respectively. I haven't checked any of the details of this, but maybe it will give you some ideas: (locount <- ((locount :lt hicount) * (!Brain :lt 0.1)) countTriggers) I've written "*" in place of "AND": this will work assuming that :lt and :gt return 1 on true and 0 on false. (I forget the assignment syntax in capytalk; sorry for syntax errors in the above.) hth, -Luddy IP: Logged |
cristian_vogel Member |
![]() ![]() ![]() sameForLast: nbrMeasurements tolerance: epsilon trueForLast: nbrMeasurements where can I find out more about these expressions? Where are their descriptions and syntax? I cant seem to find them in the book IP: Logged |
SSC Administrator |
![]() ![]() ![]() Sorry about that; they were added to Kyma after the book was printed but you can find them (and some others) on the Kyma downloads page under the category: What's New in Kyma X.43 (6.43) - 24 March 2007 IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.