A framework to quantify controlled directed interactions in network physiology applied to cognitive function assessment

The complex nature of physiological systems where multiple organs interact to form a network is complicated by direct and indirect interactions, with varying strength and direction of influence. This study proposes a novel framework which quantifies directional and pairwise couplings, while controlling for the effect of indirect interactions. Simulation results confirm the superiority of this framework in uncovering directional primary links compared to previous published methods. In a practical application of cognitive attention and alertness tasks, the method was used to assess controlled directed interactions between the cardiac, respiratory and brain activities (prefrontal cortex). It revealed increased interactions during the alertness task between brain wave activity on the left side of the brain with heart rate and respiration compared to resting phases. During the attention task, an increased number of right brain wave interactions involving respiration was also observed compared to rest, in addition to left brain wave activity with heart rate. The proposed framework potentially assesses directional interactions in complex network physiology and may detect cognitive dysfunctions associated with altered network physiology.


Results
Controlled time delay stability to uncover directional primary interactions. The proposed framework, namely Controlled Time Delay Stability (CTDS) stems from TDS, and quantifies the direct dynamical interactions between pairs of nodes in the physiological systems while controlling for indirect interactions. We further visualise the network physiology with nodes showing different physiological systems, connected via directional links indicating their dynamical interactions. This framework demonstrates the directional primary interactions and their changes from one cognitive-physiological state to another. CTDS was evaluated in a simulation example which showed its superior performance compared to the original TDS.
We further demonstrate a practical application of the CTDS for quantifying the interactions between left and right side brain rhythms, heart-and respiration rates, in a cognitive function experiment consisting of an initial rest period, the alertness and attention tasks, the transition between these two tasks and a final recovery period. This experiment resulted in a new discovery of the topology and dynamic interactions of the physiological networks during the cognitive tasks. Results show that the two hemispheres of the brain, the heart and respiratory systems interact in different ways and that the node connectivity, link strength and direction also change during the two different cognitive tasks. This is substantially different from previous studies which only investigated brain structure and dynamics [12][13][14][15][16] , as our framework demonstrates a broader picture showing the role of the heart and respiration in the network depending on the cognitive function state and their relationship to left and right hand side brain rhythms. Generally, we found that compared to rest, the number of active links increases most noticeably during the alertness task within the left side of the brain, and during attention particularly involving the right hand side of the brain in addition to the left hand side. Few but isolated links were also noted during rest, transition or recovery states, which were generally stronger than those in alertness and attention states, however they were inconsistent across individuals.
The network physiology interactions are better characterised with our new CTDS framework, since it not only looks for the time delay at which the dynamics between sub-systems are consistently related, similar to TDS, but also excludes indirect interactions, to focus on the pairwise links. It then also enables identification of the subsystem which follows or precedes the other to assess the directionality. The percentage of time for the observed CTDS indicates the strength of the links (see "Controlled time delay stability" section). Therefore, the physiological system is modelled as a dynamical network with physiological interactions with directed pairwise coupling if stronger than a significance threshold determined by surrogate analysis.
Performance of the new framework in simulation. The proposed framework was initially applied to a simulated network as an example, to compare its performance with that of the previous TDS method. The simulation was then extended to various randomly generated networks. As shown in Fig. 1a, and described in "Simulation study" section, and Eq. (4), the methods evaluated a network consisting of five nodes, two bi-directional and three unidirectional links between them, with various coefficients. As shown in Fig. 1b, the original TDS demonstrated stronger links between the nodes with a simulated relationship than other nodes (except one incorrect link between nodes 3 and 1), with average strength being over 70%. However, it does not distinguish between coupling directions. To enable a direct comparison to the CTDS, we modified the TDS method, by specifying the direction of the coupling directly from the sign of stable time delays, i.e. whether each node precedes or follows the other. Then we compared this modified TDS method with the new CTDS (Fig. 1c,d) and found a better performance by the proposed CTDS method.

Scientific Reports
| (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/ More specifically, as shown in Fig. 2, one indirect link (3 to 1) is found to be stronger than a primary link (2 to 4) by the modified TDS, while CTDS consistently finds all primary links stronger than non-primary links. It therefore provides a better distinction between primary and non-primary links.
The simulation was further extended by generating random networks with various numbers of nodes from 4 to 8. For each simulated network, various subsets of two nodes were randomly selected to have uni-or bidirectional links, with random coefficients in the range of −1 to 1, multiplied by an exponential decay term to decline at a rate proportional to the lag between them. The time series were generated with five different amplitudes of the additive Gaussian noise ( k = 10 −2 , 10 −2 , 1, 10 1 , 10 2 ) . The results were evaluated for 10 randomly generated networks for each selection of noise amplitude and number of nodes, as summarised in Table 1. The table shows that CTDS finds the actual primary links to be significantly stronger than non-primary/non-existent links, for all network sizes and noise levels, as shown by Mann Whitney Wilcoxon (MWW) p-values < 0.05 and large difference between average strength of primary links and others (denoted by ). Athough TDS resulted in significantly stronger primary vs other links for smaller networks ( n = 4 , 5, 6), it failed to achieve that for larger networks, particularly for higher levels of noise, where there is a higher chance of indirect pathways from one node to the other. The new CTDS method addresses this issue by controlling for other nodes when computing the link between each pair of nodes, to avoid the indirect interactions.
The link strength values derived by the modified TDS and CTDS were also evaluated for various coefficients of simulated links for simulated networks with n = 6 nodes and a range of noise amplitude ( k = 0.01 to 100). Figure 3 compares the link strength found by the modified TDS and CTDS for different ranges of coefficients of simulated networks. Results show that both methods cannot effectively differentiate weak links (coefficient < 0.25 for this example) from non-existent/non-primary links. However for larger coefficients, CTDS can better differentiate various levels of interactions from each other and from weak and non-existent/non-primary links, while there are larger overlaps between TDS strength of links with different levels of coefficients. Generally TDS tends to detect higher levels of strength, since it does not control for indirect interactions between nodes. CTDS not only shows the directions, but also refines the couplings by controlling for indirect relationships and highlighting the primary links. It can better distinguish between primary and indirect links, e.g. the modified TDS found the indirect link from 3 to 1 to be stronger than the primary link from 2 to 4, while in the network derived by the proposed CTDS method, all primary links were stronger than indirect links.

Scientific Reports
| (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/  Network physiology changes with cognitive function. In our experimental cognitive function study we found that the network physiology changed from initial rest to the WAFA alertness test (Schufried GmbH, Vienna), followed by another rest (transition) period, then to the WAFF focused attention test (Schufried GmbH, Vienna) and the final rest (recovery), with the left and right hemisphere locations having different signal characteristics (Fig. 4).
The initial surrogate analysis, provided an appropriate threshold level to identify significant links. As shown in Fig. 5, k = 19% is the threshold level above which, 100% of links are statistically significant. This significance was determined by the Student t-test showing that the links are significantly stronger (p-value < 10 −3 ) than the surrogate ones (i.e. the same systems but for different subjects). More details about the surrogate test can be found in "CTDS analysis and surrogate test". Figure 4 indicates that during rest, only one significant link among brain waves (delta, theta, alpha and beta) was observed for 40% of cases, namely from the lowerβ (13-18 Hz) to α (8-13 Hz) on the left side of the brain. are shown for various coefficients of links for randomly generated networks with 6 nodes and a range of noise amplitude ( k = 0.01 to 100), excluding the outliers. Comparison of link strength found by the modified TDS and CTDS shows that both methods fail to effectively differentiate weak links (coefficient < 0.25 for this example) from non-existent/nonprimary links (with zero coefficients). For larger coefficients ( ≥ 0.25 ), CTDS can better differentiate various levels of interactions which are generally stronger than the links with coefficients < 0.25.

Scientific Reports
| (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/ This link weakens during subsequent phases, but becomes stronger again during the final rest (recovery) phase, although only for 37% of cases, hence not shown in the graph. On the right side no link reached significance during the initial rest phase, or the links were inconsistent across individuals, i.e. not significantly stronger for over 40% of cases. For the current experiments, the number of significant links during the initial rest period on both right and left hand sides of the brain, were generally significantly lower than all other states (MWW test p < 0.005 ) as shown in Fig. 6b. These links are however stronger than the links during the WAFA and WAFF states, as shown in Fig. 6a.
The system interactions during the rest phase were less consistent across participants, as they also resulted in a larger variability in the link strengths, compared to other phases (Fig. 6a). This could be due to an arbitrary cognitive state of the participant during the starting phase, since they were not performing any specific task.
During the WAFA alertness test, more links became stronger than the threshold, compared to the initial rest phase as shown in Figs. 4 and 6b. Although the number of significant links did not differ between the right and left sides of the brain, they were the highest among all states and those links connected different subsystems on the left and right sides. Of interest is that the brain rhythms on the left side were more engaged with heart rate and breathing than the brain rhythms on the right side, particularly during alertness. Also different intrahemispheric connection patterns were found between brain wave rhythms during the WAFA test, e.g. (4)(5)(6)(7)(8) interacted bi-directionally with higher β (18-30 Hz) only on the left side whereas significant links from γ (30-45 Hz) to α and δ (2-4 Hz) were only observed on the right side. This suggests that the different functions of the left and right hand side of the brain are reflected by different brain wave rhythm connections especially as seen in the current experiments during the WAFA alertness test.
The WAFA test was followed by a rest phase (transition) during which the number of significant links were significantly lower (but stronger) than observed during the alertness phase, but higher than the initial rest phase (Fig. 6b). After the transition rest phase, the WAFF focused attention test was performed. The coloured matrices in Fig. 4 indicate that there were many links between the brain rhythms on the left brain, heart rate and respiration which more than ( 40% of) participants had in common. However, they did not reach the threshold for significance in this set of experiments. One exception was the link from (4-8 Hz) to heart rate. A higher number of significant links were found for the right side than the left, as shown in Figs. 4 and 6b and between different . Group-averaged CTDS coloured matrices and corresponding network physiology of left-and rightside brain rhythms, heart and breathing rates, interactions during initial rest; WAFA alertness test; transition (rest); WAFF attention test and final recovery (rest). Each matrix element colour-maps the average strength of the CTDS (the fraction of time with stable delay over the total phase duration) for each pair of physiological systems. The coloured matrices show the strength averaged over all subjects during each phase. The number in each matrix element is the percentage of cases with significant links (CTDS strength > threshold) out of the total number of cases ( N = 110 ). The threshold was determined by surrogate analysis ( k = 19 , see "CTDS analysis and surrogate test" section and Fig. 5). The links are displayed in the network graph with arrows, only if CTDS strength in that specific direction is greater than the threshold ( k = 19 ) commonly for more than 40% of cases. This representation resulted in a fewer number of consistent links during the rest phase than for the attention and alertness phases, although the isolated links during rest (left side) or transition and recovery (right) appear stronger than those during cognitive tasks, as also shown in Fig. 6.

Scientific Reports
| (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/ brain wave rhythms. Overall, the number of significant links were higher during the WAFF test, compared to the three rest states, but smaller than those during the WAFA test. The strength of the links during the WAFA test were the lowest of all phases. The final rest (recovery) phase consisted of approximately the same number of significant links as the transition rest state between the WAFA and WAFF tests. Overall, we found a higher percentage of participants with links in common during the WAFA and WAFF tests as shown in Fig. 4. Cardio-respiratory coupling, which has been extensively studied during rest periods was not evident during the initial rest phase, but became stronger during subsequent states, although only significant during the transition phase. This suggests that cardio-respiratory coupling changes with cognitive function states and may also be sensitive to influences such as stress or expectations during rest.
We also applied the modified TDS to the physiological data for comparison. As shown in Fig. 7. Comparing Figs. 6 and 7, very similar patterns of changes in network physiology are observed with a lower level of significance, i.e. higher number of links during cognitive states but with less strength. However, similar to our simulation results, TDS found a larger number of strong links, making it difficult to visualise and interpret. Hence the new CTDS provides a more natural interpretation of the physiological changes of cortical processing.

Discussion
The proposed CTDS framework extends the concept of TDS, to address its limitation in distinguishing between different coupling directions. CTDS enables quantification of directional interactions. Unlike TDS, CTDS also quantifies the coupling links between pairs of systems while controlling for indirect links. In this study CTDS quantified the coupling between pairs of specific brain wave frequencies on the left and right side of the brain (sensors placed at Fp1 and Fp2) as well as respiratory and cardiac systems while controlling for indirect links with other systems in the network. It can identify robust interactions between physiological systems in both directions and allows investigation of their stability across participants during different physiological/cognitive states.
Besides the theoretical formulation of CTDS and demonstrating its desired performance during simulation experiments, the major part of our study aimed to assess the network physiology measured as links between systems during two cognitive function states, namely attention and alertness. We found that although TDS resulted in similar patterns to those obtained by CTDS, TDS found a larger number of strong links, possibly including non-primary links and those resulting from covariates, which makes it difficult to visualise, distinguish and interpret the interactions. Better performance of CTDS, particularly for larger networks, is however achieved at the cost of extra computations. Equation (2) shows that for each pair of nodes (x and y), additional terms, namely, ρ xz and ρ yz cross-correlations, are computed for CTDS while controlling for one extra node (z). In comparison, TDS only requires computation of one cross-correlation term ( ρ xy ). The level of computation grows for larger networks. However both methods can be implemented in computationally efficient ways by vectorisation methods 31 .  www.nature.com/scientificreports/ During the changes between cognitive function phases alternating with rest phases, we identified varying network patterns. A significantly higher number of network links were observed during alertness and attention states, compared to the rest phases. This shows the higher level of connectivity between brain and cardiorespiratory rhythms during cognitive tasks, which was not possible in previous studies on cognitive function as they only focused on brain rhythms [12][13][14][15][16] .
While the overall number of significant links did not differ significantly between the left and right sides of the brain, ipsilateral network evaluation showed different patterns of interactions for the left and right brain rhythms and cardio-respiratory coupling for the WAFA and WAFF cognitive tasks. More specifically during the alertness task (WAFA), there were more interactions on the left-hand side of the brain, which also engaged the heart and breathing rhythms, which was not the case for the right side. During the attention test (WAFF) there were more interactions on the right side of the brain, also affecting the breathing rate, rather than on the left side where only theta wave was found to interact with the heart rate.
Functional connectivity may play an important role for optimising task efficiency and task integration within or between functional networks at rest or during task conditions 32 . Lateralisation of brain function has been known for some time with the left hemisphere being more associated with language and motor function, whereas the right hemisphere is characterised by visuospatial attention 33 . Lateralisation may therefore be dependent on specificity of task or whether functional integration is required. More recent findings further suggest that the left hemisphere more strongly interacts within the same hemisphere, whereas the right hemisphere interacts with both hemispheres 33 . Our results agree with previous work proposing a lateralisation based on functional connectivity density mapping of long-range connectivity or functional integration and short-range connectivity implicated in functional specialisation 34 , which may be now extended to include networks other than cortical networks such as the cardiac and respiratory systems.
Our results established that the attention task had stronger links between right brain wave rhythms with some cross-over to the left hemisphere whereas for alertness, the links were stronger on the left side. Importantly however are our findings that the type of links either between cortical EEG rhythms only or extending to respiratory and cardiac rhythms differ between tasks and that these differ to resting periods. Our results further support the proposal that lateralisation may be an advantage for dual tasking by enhancing brain efficiency during A larger variability range for the link strength for subjects at rest, and lower link strengths during the WAFF test were observed. Overall, from Fig. 6b and this figure, there are fewer, but stronger links for rest, compared to WAFA and WAFF. According to the MWW test results, the strength of the links significantly differs between WAFA and all other states ( p < 0001 ), and between WAFF and all other states ( p < 0.0001 ) for both sides of the brain. No significant difference was found between the left and right sides of the brain during the same cognitive state (WAFA and WAFF). The strength of the links associated with right side during the rest phase was significantly different from both transition and recovery (same side), but it was not significant for the left side. (b) The boxplots show the distribution of the number of significant links by CTDS over all subjects ( N = 110 ). It shows a higher number of links during the two cognitive tasks compared to the resting phases. According to MWW test results, the number of links were significantly different between rest and all other states ( p < 0.005 ), WAFA and all other states ( p < 0.005 ), WAFF and all other states ( p < 0.005 ). No significant difference was found between transition and recovery. No significant difference was found between the links associated with the left and right hand sides of the brain during the WAFA but were found for WAFF attention test ( p < 0.05).

Scientific Reports
| (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/ cognitive tasks and suggests that Alertness and Attention are subtly different types of cognitive processes that are bidirectionally linked to diverse physiological networks [35][36][37] . Brain processes of working memory involve oscillatory activities at multiple frequencies in local and longrange neural networks. The relevance of changes in the magnitude of cortical oscillations has also been reported to be modulated by the demands of a specific task 38 . Alpha wave magnitude or power indicates a state of desynchronisation in which local neural assemblies become increasingly independent in preparation for a subsequent active process 39 . Cortical and subcortical coupling with ANS function has been studied primarily in psychopathology in association with the limbic system 40 . Our findings now extend this to cognitive function associated with the prefrontal cortex and defines not only laterality but directionality as well.
Overall, during the WAFA and WAFF the coupling patterns were more consistent across the participants. Although the couplings during the rest phases were stronger compared to the cognitive task phases, there were less consistent and more isolated across the participants. This might be explained by the well-defined tasks which were consistently performed by all individuals during WAFA and WAFF tests, rather than being in a more general and arbitrary rest state. The observed network topology and interactions which changed for the WAFA and WAFF, provides new insights into the collective role of physiological systems during various cognitive states and the importance of network physiology as a model in health and disease.
Although we focused on a specific alertness and attention task in this study, the proposed framework can enable future investigations on directional physiological interaction during other cognitive functions and beyond. Only healthy participants with no known or reported cognitive dysfunction or general health issue were included in the current experiments. However, our method is potentially useful in clinical practice where the network physiology is affected by individual system malfunction or altered interactions for cases with cognitive impairment or other pathological conditions. Future studies in our laboratory are investigating the use of this framework in assessing the dynamical interactions of the physiological systems for cases with cognitive dysfunction and effectiveness of treatment. On a broader perspective, our framework is applicable to a wider range of applications Generally TDS strength were higher than that of CTDS, for most links, with less variability between states, compared to CTDS. TDS also found similar patterns for changes in the link strength between states. It also found a larger range variability during rest, similar to CTDS. Consistent with CTDS results but with less significance, there are fewer, but stronger links for rest, compared to WAFA and WAFF. According to the MWW test results, the strength of the links significantly differs between WAFA and all other states (p < 0001), except for the rest (left-side), and between WAFF and all other states (p < 0.0001) for both sides of the brain. No significant difference was found between the left and right sides of the brain during the same cognitive state, except for recovery (p = 0.04). (b) The boxplots show the distribution of the number of significant links over all subjects (N =110) found by the modified TDS. Generally higher number of links was found by TDS than CTDS. However, the trend of changes in the number of links across states is similar to that of CTDS results. It shows slightly higher number of links during the two cognitive tasks compared to the resting phases. According to MWW test results, the number of links were significantly different between rest and all other states (p < 0.005), WAFA and WAFF (p < 0.005), WAFF and all other states (p < 0.005). No significant difference was found between WAFA, transition and recovery. No significant difference was found between the links associated with the left and right hand sides of the brain.

Methods
Modified time delay stability. The proposed framework extends the TDS method for integrated physiological systems interacting with a range of time delays 2 . TDS quantifies stability and strength of interactions with a stable time lag between the signals of the coupled systems. It determines the coupling strength by evaluating the periods of constant time delays. In brief, it quantifies the interaction between two physiological systems X and Y, through output signals x and y by first windowing them into N L overlapping segments v of length L, and normalising (subtracting the mean and dividing by the standard deviation). Then it finds the cross-correlation function for each segment, accounting for a time delay τ: The delay τ = τ v 0 resulting in maximum absolute value of the cross-correlation function is then found in each segment. Relatively constant delay in a defined limited range is assumed to indicate stable coupling between two signals, while its large variability represents absence of stable coupling. Overall stability is then defined as at least four out of five consecutive segments with stable time delays, namely Time Delay Stability (TDS), where longer period of TDS is equivalent to more stable coupling. Strength of the coupling is defined as the percentage of time with observed TDS, with a threshold level determined through surrogate analysis.
TDS method in its original form does not distinguish between the coupling direction, i.e. whether each subsystem proceeds or follows the other 2 . Since in this work a directional method is proposed, we modified the original TDS to allow for directionality and to be able to compare the TDS and the new CTDS frameworks. To this aim, we assumed the time delay τ to be a positive value, and found the stable time delays maximizing ρ v xy and ρ v yx (in Eq. (1)), corresponding to system Y following or preceding system X, respectively.
Controlled time delay stability. One of the main contributions of the proposed CTDS framework is to distinguish between primary (direct) links and non-primary (indirect) ones in a complex network, which isolates the directional links between each pair of systems, while controlling for the effect of other nodes. Therefore, it further refines the actual delay and direction corresponding to each link rather than being the delay incurred via indirect link through different pathways involving other nodes. This was achieved by finding a stable delay which maximises the partial cross-correlation of each pair of nodes, while controlling for other systems in the network.
If there is an additional system Z with output signal z, interacting with the other two systems X and Y, it can influence their coupling via indirect pathways. In order to account for this indirect link, the network interactions should be corrected for the effect of z on the cross-correlation between x and y, the output signals associated with X and Y. Based on the concept of partial cross correlation 41,42 , the partial cross correlation can be written as: Assuming that there are N additional systems Z 1 , Z 2 , . . . , Z N interacting with X and Y, the partial cross-correlation is extended to higher order partial cross-correlation, by controlling for N other output signals z 1 , z 2 , . . . , z N . By recursion, the N th −order partial cross-correlation is as follows 43 : This coefficient can be calculated through a regression procedure, noting that the partial cross-correlation coefficient ρ xy|z is the correlation coefficient between the residuals of x and y signals after the regression on control signal z. The partial cross-correlation function is obtained for each N L overlapping normalised segments v of length L, accounting for a time delay τ . Then for each segment v, the delay τ v 0 which maximises the function ρ xy|z 1 ,z 2 ,...,z N (τ ) is found. Similar to TDS, the relatively constant delay in a defined limited range indicates stable coupling, and overall stability requires as least four out of five consecutive segments with stable time delays. The threshold level is determined through surrogate analysis for each application, explained in "CTDS analysis and surrogate test".
Original TDS, modified directional TDS (see "Modified time delay stability" section), and the new CTDS framework were applied to the simulated network in MATLAB, and the results were shown in Fig. 1.
The simulation was then extended by randomly generating networks with n = 4 to 8 nodes and five different noise amplitudes. For each selected number of nodes and noise amplitude, 10 sets of time series were randomly generated. For each node, the time series were generated as follows: where each pair of nodes (i and j) were randomly assigned coefficients ( W i,j,d ) which can be either zero (i.e. no link) or nonzero. The nonzero coefficients were randomly generated from real positive or negative values from − 1 to 1. The coefficients were also multiplied by an exponential decay term to decrease at the rate of 0.1× the lag between time series. w i s were Gaussian noise samples taken from normal distribution with amplitude of k = 0.01 , 0.1, 1, 10 or 100. Modified TDS and CTDS were applied to the generated time series and the strength of the primary links ( W = 0 ) and non-primary links ( W = 0 ) obtained by two methods were compared for the networks with different number of nodes, noise amplitudes and coefficients.
Cognitive function experiment. The proposed framework was applied to a cognitive function experiment, in which the interactions between brain rhythms, heart rate and breathing rate were investigated.
Data collection and procedure. The study recruited 110 participants at the Charles Sturt University Diabetes Complications Health Research Clinic. Written informed consent was obtained from each participant, following an information session with each potential participant having the opportunity to ask questions of the principal investigators. Ethics approval was obtained from the Charles Sturt University Human Ethics Committee and the study was conducted in accordance with the World Medical Association Declaration of Helsinki (Approval Number 2006-042).
The participant had an initial rest for an average 4.4 (± 3.6 std) minutes. Then they performed the WAFA intrinsic-visual test of alertness. More specifically, the participants should notice a circle appearing and disappearing; and must react as quickly as possible by pressing a button each time. The test took an average of 4.6 (± 0.4) minutes, and was followed by another rest (transition) period of average 2.1 (± 0.4) minutes. After this rest period, the WAFF test of focused attention was performed, where participants were shown a square which appeared and disappeared, while appearing sometimes lighter before disappearing, and other times remaining dark. The participant had to watch closely and press a button as quickly as possible after the square appeared and then became lighter twice in succession. The WAFF test took an average of 9.9 (± 1.6) minutes and was followed by a final rest (recovery) of average 2.1 (± 0.1) minutes. While performing these tasks, a single channel ECG, and two channel EEG from right and left frontal sites were recorded, using Biopack Student Lab 3.7.7, and sampled at 1000 samples per second.
Pre-processing. ECG signals were initially processed by a band-pass filtering (cut-off frequencies: 5 Hz and 45 Hz) for noise and artefact removal, and QRS locations were identified to find the heart rate using a modified Pan and Tompkins method 44 . Respiration rate was derived from the ECG using respiratory sinus arrhythmia 45 .
Automated Wavelet Independent Component Analysis (WICA) was used to remove artefacts such as cardiac, muscle, eye movement and transmission line interference from EEG recordings 46 . For this purpose, EEG Rhythms were extracted through Discrete Wavelet Transform (DWT), and decomposed into 8 levels using a Daubechies 4 wavelet. Rènyi Entropy and Kurtosis of each Wavelet Component were calculated and normalised, and those exceeding a threshold were marked as critical and Independent Component Analysis (ICA) was applied to them, to extract Wavelet Independent Components (WICs). The WICs were segmented into smaller windows, and those with Kurtosis or Rènyi Entropy exceeding the threshold in more than one fifth of the signal, were discarded. The edited critical wavelet components were then reconstructed by applying the inverse ICA and restored into the original wavelet dataset. The denoised EEG signals were obtained by taking the inverse DWT of the edited Wavelet Components. The following brain rhythms were then extracted using Welch's power spectrum: delta ( δ ) at 2-4 Hz, theta ( θ ) at 4-8 Hz, alpha ( α ) at 8-13 Hz, lower beta ( lβ ) at 13-18 Hz, higher beta ( hβ ) at [18][19][20][21][22][23][24][25][26][27][28][29][30] Hz and gamma ( γ ) at 30-45 Hz.
Scientific Reports | (2020) 10:18505 | https://doi.org/10.1038/s41598-020-75466-y www.nature.com/scientificreports/ The threshold for stable time delays was determined through surrogate testing, to find a threshold for detecting physiologically relevant interactions. The surrogate test was performed by applying CTDS to the pairs of physiological signals from different subjects. For 100 surrogates, a student t-test was performed to determine the statistical significance comparing the distribution of CTDS values for the links from the same subject versus those paired from different subjects. This procedure was performed for all pairs of systems and the identified links were assumed significant if the t-test p-value was < 10 −3 . The significance threshold level was determined as the value above which all network links were statistically significant, which resulted in a threshold of 19% (Fig. 5).
TDS was also applied to the physiological data and the results were compared with CTDS.
Statistical analysis. In order to compare the number and strength of the links at different states, the Mann Whitney Wilcoxon (MWW) test was used (the distributions were not normal according to Jarque-Bera test).

Conclusion
The new network physiology framework was proposed to generalise the TDS method, by quantifying pairwise directional coupling, while controlling for indirect links. The proposed framework outperformed the original and modified directional TDS as demonstrated in simulations. It was further applied in our cognitive function experiment, where different lateralised brain-heart-breath couplings were found during different cognitive states. It showed significantly higher number of interactions which were more consistent across subjects, during attention and alertness tests compared to rest. Our study addressed a significant gap in understanding the network physiology during cognitive states, which can be extended to future studies on cognitive dysfunctions and other applications.