4. Digital Filters
4.1Set the digital filter
PhyOSC can convert the sensor data sent from the Apple Watch directly into OSC messages, or it can process the data with digital filters.
There are three types of digital filters: Raw, Bool, and Nomalize.
For example, Pitch, one of the angular rate sensor data of Apple Watch, is in the range of -90 to +90 degrees, but it can be filtered as follows.
# |
Filter Name |
Example of use |
1 |
Raw |
OSC messages only data in the range -45 to +45. |
2 |
Bool |
OSC message 1 for positive values and 0 for negative values. |
3 |
Normaization |
Normalize -90 to 90 data to 0-127 |
Digital filters can be set for Accelaration's X, Y, Z and Attitude's Pitch, Roll, Yaw, and Displacement's X, Y, Z respectively.
In addition to these three, there is an "Input range" to specify the minimum and maximum values, a "Number type" to convert to a Float/Integer, and a "Threshold" for the Attitude threshold.
# |
Filter Name |
Function |
4 |
Input range |
The data between min and max is used as the OSC message. |
5 |
Number type |
Converts the data part of the OSC message to Float or Int type. |
6 |
Threshold |
Compares the Attitude input data with the previous data and sends an OSC message when the difference is greater than or equal to the threshold. |
4.2Raw filter
Raw filter applies "Input Range" and "Number type" and "Reverse Input Data" filter to the input data.
Input Range
Sets the range of inputs to filter.
When Min is set to -10.0 and max is set to 10.0 in the minimum / maximum value input fields, -10 is output if the sensor value is less than -10.0.
Outputs 10 if the sensor value is greater than 10.0.
Number Type
Converts the output to a real number or an integer.
Reverse Input Data
Reversals the polarity of the sensor value.
4.3Bool filter
Bool filter sends 0 or 1 according to the following three conditions.
When the minimum value is set to -20 and the maximum value to 20 using the slider as shown in the figure below, 0 is output when the sensor value is less than -20 or greater than 20, and 1 is output when the sensor value is between -20 and
20.
Input Range
Set the minimum and maximum values for the judgment range slider.
Reverse Range
Reverses the setting of the judgment range specification slider.
When Reverse Range is turned on, 0 is output when the sensor value is -15 to 15, and 1 is output when the sensor value is -15 or less or 15 or more.
The range of the slider itself is synchronized with the Input Range.
When the min of Input Range is -20 and max is 20, as shown in the above figure, the minimum and maximum values of the judgment range specification slider are also -20 and 20.
Reverse Input Data
Reversals the polarity of the sensor value.
4.4Bool Less than filter
Outputs 1 when the sensor value is less than the slider specifying the judgment range, and 0 when the value is greater.
Input Range
Sets the minimum and maximum values for the slider to specify the judgment range.
Number Type
Converts output to a real or integer number.
Reverse Input Data
Reverses the polarity of the sensor value.
4.5Bool Greater than filter
Outputs 1 when the sensor value is greater than the slider specifying the judgment range, and 0 when the value is less than the slider.
Input Range
Sets the minimum and maximum values for the slider to specify the judgment range.
Number Type
Converts output to a real or integer number.
Reverse Input Data
Reverses the polarity of the sensor value.
4.6Normalize filter
Normalize filter normalizes the input data to the "Nomarization" Min to Max range.
Input Range
Sets the range of input to be normalized.
Nomalization
Normalizes the input specified by Input Range within the min to max range of Normalization.
As shown in the figure to the right, if the min and max of Input Range are set to -10 and 10, respectively, and the min and max of Normalization are set to 0 and 127, respectively, the input value of 0 is output if the input value is
less than -10.
If the input value is 0, 64 is output; if the input value is greater than 10, 127 is output.
Number Type
Converts output to a real or integer number.
Reverse Input Data
Reverses the polarity of the sensor value.
Output example when Min / Max of "Input Range" is set to -3.00 / 3.00 and Min / Max of "Nomarization" is set to 0/127.
Input Data |
OutPut Data |
-4.00 |
Do not send OSC messages |
-3.00 |
0 |
0 |
63.5 |
3.00 |
127 |
4.00 |
Do not send OSC messages |
4.7Set the Attitude threshold
Attitude's X, Y, and Z can be filtered by thresholds.
The sensor data received from the AppleWatch is compared with the previous date, and OSC is sent when the difference is greater than the threshold value.
If you increase the threshold value, you can ignore the minute movement of Apple Watch.
On the contrary, a smaller threshold value allows Apple Watch to react to minute movements.