Research Article

Time-Frequency Linearization of Reactive Cortical Responses for the Early Detection of Balance Losses

Pseudocode 1

Pseudocode of logic network classifier routine and system calibration.
Routine: Logic Network Classification
Inputs:
MSMA; imSMA; //MSMA: Vector of Nc values from cortical group “Supplementary Motor Area”
        //imSMA: values from cortical group SMA @ ith MT contraction
MM1; imM1;  //MM1: Vector of Nc values from cortical group “Motor Area”
        //imM1: values from cortical group M1 @ ith MT contraction
MS1; imS1;   //MSMA: Vector of Nc values from cortical group “Sensory-motor area”
        //imSMA: values from cortical group S1 @ ith MT contraction
MPPC; imPPC; //MM1: Vector of Nc values from cortical group “Parietal area”
        //imM1: values from cortical group PPC @ ith MT contraction
Outputs:
Gen_Flag; //Generalization Flag. It identifies a general cortical activity increment
Lat_Flag; //Lateralization Flag. It identifies a NOT lateralized cortical involvement
Alarm_on_BoI (); //The function is used to activate a warning flag on the specific evaluated BoI
    / Body Program LogicNetwork_Classifier  /
  1. [Class] LogicNetwork_Classifier (imSMA, imM1, imS1, imPPC){
  2.  CG_Sum = [imSMA>ThrSMA imM1>ThrM1 imS1>Thrs1 imPPC>ThrPPC]/4;
  3.  if (CG_Sum>0.5) {
  4.    Gen_Flag=1;
  5.    Lat_flag=lateral_check ();
  6.    if (Lat_flag == 1) {
  7.      → call Alarm_on_BoI ();
  8.    }
  9.  }
  10.  calibration (imSMA, imM1, imS1, imPPC); //refresh calibration values
  11. }
    /Example Calibration Step /
  12. [ThrSMA, ThrM1, ThrS1, ThrPPC] calibration(imSMA, imM1, imS1, imPPC) {
  13. //In the first calibration section, the system embeds the extraction of the 95th
   percentile‑based thresholds for every cortical group.
   ThrsMA = prctile (MSMA, 95); ; ThrPPC = prctile (MPPC, 95);
  14. //In the second one, the vector is automatically updated with the new “im” value, preparing the system for the next contraction.
  15. MSMA(0) = []; MSMA=[MSMA imSMA]; ;MPPC(0)=[]; MPPC=[MPPC imPPC]
  16. }