Leblay Joffrey

Rabah Mourad

Champagnat Ronan

Nowakowski Samuel

PROCESS-BASED ASSISTANCE METHOD FOR LEARNER ACADEMIC ACHIEVEMENT

Keywords: Process mining, Recommendation, Learning, Traces-based system

How can we learn to use properly business software, digital environments, games or intelligent tutoring systems (ITS) ? Mainly, we assume that the new user will learn by doing. But what about the efficiency of such a method? Our approach proposes an answer by introducing on-line coaching. In learning process, learners may need guidance to help them in their academic achievement. In this paper, we introduce a process-based assistance method to provide this help. Our method proposes to build a model using process mining upon the observations collected during previous users' experiences with the considered application. It represents the steps chaining and their impacts on the states of the overall process and is used to recommend the most suitable step to guide the current user or learner. We implemented our coaching approach in the La Rochelle University Institute of Technology jury decision system to show its relevance.

INTRODUCTION

The aim of our work is to assist users involved with a business process, by guiding them in order to find the best way to complete successfully the process. Without guidance, users can fail at reaching business process objective, which may have severe consequences on the overall process or the information system, such as the loss of sensitive data, hampering service-providing processes of a company, etc. To prevent such failing situations, we can observe previous users' behaviors to extract chains of steps that represent the organization of activities within the application and their impacts on the application state. Both information serve to build, step by step, a way to reach the goal from the actual state of the business process. Therefore, we can recommend the next activity to perform in order to achieve the given goal.

This issue has been studied in some previous works such as [START_REF] Cordier | Trace-Based Reasoning-Modeling Interaction Traces for Reasoning on Experiences[END_REF], Ho et al. (2018), [START_REF] Toussaint | Mining surgery phase-related sequential rules from vertebroplasty simulations traces[END_REF], to name a few. In [START_REF] Toussaint | Mining surgery phase-related sequential rules from vertebroplasty simulations traces[END_REF], the authors introduced a method to supervise surgeon student during their practical work and tried to prevent their potential errors by using a data model that identifies the potential steps that could describe an error. The data model, called process model, represents a schedule of steps done by the users (Van der [START_REF] Van Der Aalst | Process mining: a research agenda[END_REF][START_REF] Polyvyanyy | Impact-driven process model repair[END_REF]. In our case, we try to guide users to achieve their goals even if they make some errors. Therefore, our approach suggests a corrective way, if necessary. In Ho et al. (2018), the authors introduced a method to drive the users to take the right decisions according to some information extracted from a data model that describes the possible activities to perform to reach the goal and their impact. This data model is an input to the method, in the sense that it is built a priori by field experts. In our case, our method discovers the data model from the information before recommending the next step. In [START_REF] Cordier | Trace-Based Reasoning-Modeling Interaction Traces for Reasoning on Experiences[END_REF], the authors defined a data model based on traces that are interaction logs between the users and the software in previous executions to help the users take decisions. Such a help can be provided by presenting a ranking of the most used activities. We borrowed from [START_REF] Cordier | Trace-Based Reasoning-Modeling Interaction Traces for Reasoning on Experiences[END_REF] the data model and adapted it to our context to develop a process-based learning assistance method that we aim to use in ITSs.

Figure 1. Process-based learning assistance method steps

In this paper, we describe our process-based assistance method that searches in given data, such as traces, for information about the organization of activities on the application state. It consists in three steps as follows: (i) we transform the given traces for process model discovery, (ii) use the transformed traces to obtain the process model, and (iii) calculate the most efficient path to the defined goal and recommend it to the user. We have applied our method on the jury decision system of La Rochelle University Institute of Technology to recommend to the students the best semester validation path to achieve their studies and get the qualification of the Institute of Technology. The obtained results show that our learning assistance approach provides relevant recommendations.

Section 2 describes our process-based learning assistance method. Section 3 presents our experimentation and discusses the results obtained. Section 4 concludes the paper and presents some future works.

PROCESS-BASED LEARNING ASSISTANCE SYSTEM

Our approach explores system's traces to discover the activities' organization and past users learning processes that are seen as business processes. Then, it uses the obtained model to guide current learners through the application or the learning environment. As illustrated in figure 1, our method consists of three steps: (i) trace modeling, (ii) process discovery and (iii) guidance of the user.

Trace Modeling

This step transforms raw traces collected by the system into modeled ones corresponding to the entry data model of our approach. We can see raw traces as data, where each entry is a tuple of values of attributes with different domain of definition. For example, let "A,Case 1,2,1" be a row of a set of traces in CSV1 format. The first and second attributes are string type, and the third and fourth attributes are integers.

More formally, let T be a set of traces. Each tuple t ∈ T is such that t = (v1,..., vn) where ∀ i ∈ {0,...,n}, vi ∈ Di and Di being the domain of definition of the attribute ri associated to vi [START_REF] Cordier | Trace-Based Reasoning-Modeling Interaction Traces for Reasoning on Experiences[END_REF][START_REF] Rozinat | Conformance checking of processes based on monitoring real behavior[END_REF]. The set of all attributes is denoted R. We associate to them two functions: (i) fR(r1,...,rj), the projection of T on attributes rk |1 ≤ k ≤ j ≤ n as it is defined in the relational algebra for databases and (ii) fT (ti), the selection of row (tuple) ti in T with i = 1,...,|T|.

We have to identify the information we need from the raw traces, such as the organization of the observed activities and their impacts. Therefore, we use Event Log [START_REF] Leemans | Discovering block-structured process models from incomplete event logs[END_REF]) as a trace model. We introduce hereafter only the needed tools for the Event Log model; a more complete presentation can be found in [START_REF] Verbeek | XES, XESame, and ProM 6, Information Systems Evolution[END_REF]. The model describes the schedule of users' process by using the organization of activities and their impacts. Therefore, this model has to identify: (i) the activity performed inside the observed data, (ii) an identifier that defines to which sequence the observation belongs. We consider that the traces are ordered chronologically according to their activities achievement time. Furthermore, we have to identify the impact of the activity by extracting the subset of data that describes the state of the process used through the application before or after the activity is performed.

Each modeled trace is an entry e = (a,l,o) with an activity a ∈ A , a sequence identifier l ∈ L and a set of data that describes the impact of the considered activity o ∈ O. We consider the set of entries E = A ×L×O and we can get or set the values of an entry e ∈ E with the following three functions:

fa : E → A e → fa(e) = a fl : E → L e → fl(e) = l fo : E → O e → fo(e) = o In the trace modeling step, we use the knowledge about the location of activity, sequences identifier and the other data, to model the raw traces. To transform the raw traces into event logs, we need to match attributes of event logs with attributes of raw traces. Each attribute of event log is a Cartesian product, denoted ∏, of a subset of raw traces attributes such that A = fR(r1,..

.rn), ri ∈ Ra, 1 ≤ i ≤ n, Ra ⊆ R, L = fR(r1,...,rn), ri ∈ Rl , 1 ≤ i ≤ n, Rl ⊆ R, and O = fR(r1,...rn), ri ∈ Ro, 1 ≤ i ≤ n, Ro ⊆ R.
With functions fa, fl and fo, we create each entry e from the raw traces. We use formulas (1) to associate activity (fa), sequence identifier (fl) and other data (fo) to an entry, as follows:

fa(e) ← ∏ fR(r) ∩ fT(t) r∈Ra fl(e) ← ∏ fR(r) ∩ fT(t) r∈Rl fo(e) ← ∏ fR(r) ∩ fT(t) (1)
r∈Ro Example 1: Table 1 shows some modeled traces corresponding to raw traces in the form of "A,Case 1,2,1" presented earlier. To transform the entry t of raw traces into the entry e of modeled traces, we associate the first attribute to Ra (the subset on activity attributes), the second one to Rl (the subset of sequence identification attributes), the third and fourth attributes as Ro (the subset of other attributes). Hence, the first line e1 = (A,Case1,{2,1}) is obtained by considering the activity a = "A", its sequence identifier l = "Case1" and the other data o = (2,1).

For

Process Discovery

From the modeled traces, we extract the schedule of activities as a business process that reaches a given goal. We admit that the business process always ends even if the users goal is not necessarily reached, and whatever the path the execution takes. Hence, failing is seen as a process reachable goal. This is the soundness property of a process model as defined in [START_REF] Leemans | Discovering block-structured process models from incomplete event logs[END_REF]. We need an algorithm that verifies that property and among the existing process discovery algorithms that we tested Inductive Miner (IM) [START_REF] Leemans | Discovering block-structured process models from incomplete event logs[END_REF]) is the only one able to extract a sound process model in finite time for all given modeled traces.

IM provides sound structured workflow-net from traces. A structured workflow-net is a representation of activities organization. It is a variant of Petri-net model. In this paper, we introduce the needed notion for our method. A complete introduction to Petri-nets and workflow-nets can be found in [START_REF] Desel | Free choice Petri nets[END_REF], [START_REF] Reisig | Lectures on petri nets I: basic models: advances in petri nets[END_REF], [START_REF] Murata | Petri nets: Properties, analysis and applications[END_REF], [START_REF] Van Der Aalst | Data Science in Action, Process Mining[END_REF]. We consider a process model constituted with a set of transitions, a set of places and a set of directed arcs. The set of transitions represents a potential activity performed, the set of places represents the state of the process and the set of directed arcs represents the condition of utilization of an activity if the arc links a place to a transition, and a realization of the condition otherwise. A structured workflow-net, or simply SWF-net, is a tuple (P,W,F ) where:

 P is a finite set of places, with an input place i (no arc to it) and an output place u (no arc from it);

 F ⊆ (P×W)∪(W×P) is a set of directed arcs, called the flow relation,
 W is a finite set of transitions such that P∩W =∅, and all transitions W can reach any other transitions in the case of adding an arc from u to i. The process model in Figure 2 is a SWF-net corresponding to the modeled traces of Table 1 and respecting the soundness property. This type of model offers standard building blocks such as AND-split, AND-join, OR-split and OR-join. They are used to model sequential, conditional and parallel routing [START_REF] Russell | Workflow patterns: the definitive guide[END_REF]. The sequential routing is a succession of activities such as E and F in Figure 2, the conditional routing is a choice between some activities such as A and E, and the parallel routing is some activities used in any order such as B and C. These routings allow to schedule the activities and are used by the process mining algorithm to extract the process model.

To check if a condition is met, we add to the model an overlay, named marking, which describes the number of token on each place. A token represents an achieved condition and counts only zero or one token per place since we consider a condition cannot be completed more than once.

A marked SWF-net is a pair (M,s), where M = (P,W,F ) is a SWF-net and where s ∈ N |P| is a bag over P denoting the marking of the net. Let M be a SWF-net, x and y be two places of M, w be a transition of M, xF w denote an arc from x to w and wFy denote an arc from w to y. Let us define the following notations: IM process mining algorithm extracts process models from modeled traces as SWF-net. We provide modeled traces E obtained above and it returns the process model M = (P,W,F ). This algorithm works in one recursive step. It observes the sequences in the given set of modeled traces and find the set of activities A.

 F = {xFw,
Then it makes a cut into the activities to split the set into two other subsets. The cut is done if and only if A1≠A2|A1∪A2=A. After that, it searches for a routing that explains the link between the two parts of the split. There is four possible cuts or routings: exclusive choice cut, sequence cut, parallel cut and redo loop cut. To find the right routing, the algorithm uses a model, which describes the routing with some rules found in the considered sequences. Then this step is recursively done as long as the sequences, i.e. the subset of activities, have more than one activity inside. A more complete introduction to IM can be found in [START_REF] Leemans | Discovering block-structured process models from incomplete event logs[END_REF].

Example 2: Let use the IM algorithm on the traces in Table 1 where A = {A,B,C,D,E,F}. We first perform a parallel cut to obtain A1 = {A,B,C,D} and A2 = {E,F}. Then, we apply the algorithm on the two resulting subsets. For instance, with the sequence ⟨E,F⟩, which defines A2 and is constituted with the entries e11 and e17 of E , IM will perform a sequence cut to obtain A3 = {E} and A4 = {F} and do not go farther since |A3| = |A4| = 1. Then, it searches for the cut on A1 and so on to definitively stop when there is no more recursive cut to run.

To sum up, the process discovery step uses the event log obtained from the previous step to extract the scheduling of the activities by using a process-mining algorithm. To find the scheduling, we use the IM algorithm. The next step is about how to use the process model to find a path to guide the user.

Guidance of the User

The aim of this step is to find the path to reach a given goal from the current progression of the user in the system. The guidance step uses the process model and waits for a query that only contains an incomplete sequence σx. This query is made when a user performs an activity according to the studied overall business process. The guidance step verifies if the sequence σx follows the process model by checking if a marking s exists after firing the sequence of activities, such that (M,[i])[σx⟩(M,s), where M = (P,W,F ) is the process model and i its input place. If no marking s exists, the query is skipped. If the marking exists, we try to find a sequence σz that reaches u the output place of the model, such that (M,s)[σz⟩(M,[u]). We search for a sequence that reaches the output with the lower number of activities, using a path-finding algorithm.

The path-finding algorithm is a way to obtain a path in a model that describes a relation between entities, such as our model that describes the schedule of activities. Some path finding algorithms using different approaches have been tested. We consider the number of activities as quality of a sequence because we just need a path that completes the process model. Therefore, Dijkstra's algorithm [START_REF] Heineman | Trace-Based Multi-Criteria Preselection Approach for Decision Making in Interactive Applications like Video Games[END_REF]) is enough to solve our problem by searching for the shortest path in a set of sequences to the goal. This algorithm iterates three steps:

1. We consider a list of candidate sequences (at the beginning it only contains the requested sequence).

For each sequence, we search for all firable transitions and make a list of possible resulting sequences; 2. From the resulting list, we keep the shortest sequence, i.e. with the lower number of activities, not already in the candidate list. We choose one randomly if several and add it to the candidate sequences list; 3. We check if the kept sequence reaches the output place u, this sequence is returned and the algorithm stops, otherwise, we continue with the next iteration. The returned path describes the succession of activities completing the process model. This path contains the sequence σz that reaches u from the marking s corresponding to the query sequence σx: (M, Both are 1-activity length and suppose that we randomly choose σE that is added to the candidate sequences list. u is not reached, the execution moves on.

Iteration 2 the candidate sequences' list contains σ[i] and σE. The firable transitions are A and F. The resulting sequences are σA containing only the activity A and σEF containing E and F. σA is the shortest and is added to the candidate sequences list. u is not reached.

Iteration 3 the candidate sequences' list contains σ[i], σA and σE. The firable transitions are B, and F. The resulting sequences are σAB containing A and B, σAC containing A and C, σEF containing E and F, all of same 2-activities length. Let suppose that we randomly choose σEF that is added to the candidate sequences list. However, firing F reaches the output place u, the execution stops, and the sequence σEF is returned.

EXPERIMENTAL RESULTS

The context of our experiment is the academic jury decision taken at the end of each semester at the University Institute of Technology of La Rochelle (France). The institute delivers a two-year technical degree that requires the validation of 4 semesters. We apply our method on the jury delivery data in order to identify students' progression, lack of learning and courses with high fail grade. The process considered in this case study is the semester validation process followed by the students. This process can be analyzed with different granularity points of view. For instance, we can consider the courses as activities for the most accurate point of view and the semesters' validation decision for the most generic one.

For our experimentation, we consider the semesters' decisions as activities in order to have an overall view of student academic achievement (or fail). This point of view considers the chaining of decision the students got. Thanks to this, it is possible to identify the learners who need remediation to reach their qualification. However, it is also possible to look at the courses that the learner fails at. This increases the accuracy of the provided recommendation.

Context of the La Rochelle Institute of Technology

In the La Rochelle Institute of Technology, some students have difficulties to achieve their semesters due to their initial academic lacks in some specific courses or to their insufficient motivation. Our first goal is to use our process-based method on jury statistical data to identify the fail paths and the no classical success path thanks to the process model. Then the results could be correlated with learners' marks to give them a more precise recommendation (but this part is out of the scope of this paper).

French Institutes of Technology have normalized format for jury decisions. Each semester (numbered 1 to 4) may be: V for the automatic validation if student results meets the academic requirements; C-or C+ for a validation with compensation between two successive semesters (C-denotes the compensation by the previous semester and C+ by the next one); N for a no validation caused by not sufficient academic results; J for a validation granted by the jury when the academic requirements are not met but student's results are close to what expected and E if the student fails and is not allowed to pursue for any reason. Each decision is followed by the concerned semester level number. For instance, V//S1 means that the student had sufficient results and the first semester was automatically validated. An additional code DEM is also possible and denotes student's resignation.

The considered data in our study was provided, after anonymization, by the Computer Science Department of La Rochelle Institute of Technology and concerns 6 years of jury decisions (2007)(2008)(2009)(2010)(2011)(2012)(2013). Each year, about 100 students start the first semester in September. For each semester, the studies are organized in two Learning Units (LU) each of which includes several Teaching Units (TU). To validate a semester a student must have at least 10/20 overall average mark and at least 8/20 average mark in each Learning Unit.

Technical process

The row traces format is: "LearnerId, Decision, Semester, Date, EvalAvr, EvalLU1, EvalLU2, EvalTU11, ... EvalTU1n, EvalTU21,...EvalTU2m". LearnerId is the learner identifier assigned after the preliminary anonymization step. Decision is the jury decision with one of values in {V, J,N,C+,C-,A,E,DEM}. Semester is the semester level. Eval* are student marks during the considered semester where EvalAvr is the overall average mark, EvalLU1 and EvalLU2 are average marks in the two semester's Learning Units and EvalTU* are the detailed marks in each Teaching Unit that we do not consider in for this experiment.

The raw traces are transformed into modeled traces according to the Event Log Model (cf. 2.2). The model needs the sequence identifier and the activity. We instantiate the sequence identifier with LearnerId and the activity with the couple Decision, Semester. The remaining row data attributes represent other attributes of the trace model.

For the sake of clarity, we prefer to present the Markov model2 corresponding the SWF-net instead of the SWF-net3 itself. Nevertheless, the guidance step is applied on the SWF-net as stated in section 2.3. Figure 3 shows the obtained model. Each state of the Markov model represents the most frequent decision and each arrow points out the most probable activity after the considered one. The model is a second order Markov model shows the possible preceded and followed linking. Furthermore, the presented model is a compacted model, i.e. all the states do not appear. The states with lower incidence are grouped together.

After that, we use the models, such as the Markov model, to compute the sequences as explained in Section 2.3. The sequences are verified to know if they respect the French Institutes of Technology decision rules previously presented. If they do, we consider our method able to recommend a way to get qualification.

Discussion

The model in Figure 3 shows the frequency of activities used in the studied process. We can see that globally validating activities are the most frequent ones. However, the second and third level semesters validate decisions are less frequent than the first and the fourth one. This means that there are alternative ways to get the qualification. That also means that efforts should be made on students learning process in these two semesters. We can also observe the most frequent failing paths and that the students mainly fail after first or second semesters. Assistance should be provided by the Computer Science Department to help weak students from the first semester.

Furthermore, our method automatically warns the student and his teachers if fail path is detected. And the method recommends the closest success path towards the qualification.

CONCLUSION

We have introduced a process-based assistance method to help learners in their academic achievement. The developed method provides learners a progression sequence to follow in order to reach the academic overall objective. Our method uses the process mining on previous learners' results in order to build the process model that serves to guide current learners. The method identifies the sequences performed by the learners in the raw traces through a trace modeling. Then, builds the process model based on the scheduling of identified activities extracted from the modeled traces. This model is used to determine the sequence that describes a chaining of activities the learner should follow by applying a path-finding algorithm. We have made some experimentation to show the applicability and the relevance of our method on the La Rochelle Institute of Technology case study.

The short-term perspectives are twofold. On the presented case study, we seek to improve the efficiency of our method by rising the granularity of our data and consider correlating of the overall semester results with student's lectures results. For instance, we want to analyze student's academic failures to find to which extent a bad result in maths or programming course impacts the overall jury decision. And use this analysis to recommend an appropriate remediation to the learner. The second perspective is to check how our method can be generalized to be used on applications based on enterprise information system. It is also possible to improve our method by finding some other sources of knowledge to enrich the mined model.

  E = A × L × O the overall sets of the above example are: A = {A,B,C,D,E,F}, L = {Case1,...,Case5} and O = {{2,1},{2,2},{2,3},{1,4},{1,1},{1,2}}

  wFy} denotes the set of directed arcs;  s = [x] denotes a marking s over M that has a token on the place x but not on y. A place is in a marking if it has at least one token in the marking;  x ∈ s denotes the fact that x has at least one token on marking s. Otherwise, it is denoted by x∉ s,  s(x) = 1 and s(y) = 0 denote the number of token in a place;  If all places before a transition are marked then the transition can be fired and (M,s)[w⟩(M,[y]) denotes the firing of w. Let us add to M one transition w′, one place z and two arcs yFw′ and w'F z . Then let denote:  (M,[x])[w,w′⟩(M,[z]) the fact that firing w and w′ or (M,[x])[σ⟩(M,[z]) if we consider a sequence σ = ⟨ w,w′⟩;  [z] ∈ [M,[x]⟩ the fact that the marking [z] is reachable from the marking [x] in the marking M.

Figure 2 .

 2 Figure 2. Process model corresponding to the modeled traces of Table 1

  [i])[σx⟩(M,s)[σz⟩(M,[u]). The final candidate sequences list is kept for the next query. Example 3: Let us consider the process model obtained in the previous section from the modeled data of Table1. Let us also consider a query with sequence σ[i], the starting empty sequence with no activity inside, the marking s = [i]. First iterations of the algorithm are: Iteration 1 the candidate sequences' list contains only the empty sequence σ[i]. The firable transitions are A and E. The resulting sequences are σA containing only the activity A and σE containing only the activity E.

Figure 3 .

 3 Figure 3. Chaining of Jury decision for each semester 2

Table 1 .

 1 Modeled traces

Comma Separated Values text format.

Obtained by the software Disco (https://fluxicon.com/disco/)

Obtained by using IM algorithm from the ProM process mining software (http://www.promtools.org)


Iuri D Nogueira
email: iuri.deolindonogueira@univ-lyon2.fr

Maram Romdhane
email: maram.romdhane@univ-lyon2.fr

Jérôme Darmont
email: jerome.darmont@univ-lyon2.fr

Modeling Data Lake Metadata with a Data Vault

Keywords: Big data, Data lake, Metadata management, Ensemble modeling, Data vault Topics: Information systems, Information storage systems, Cloud based storage

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Introduction

Born with big data in the 2010's, data lakes propose a way to store in their native format voluminous and diversely structured data, in an evolutionary storage place allowing later analyses (reporting, visualization, data mining...) [START_REF] Dixon | Pentaho, Hadoop and Data Lakes[END_REF]. The concept of data lake opposes that 1 of data warehousing, which outputs an integrated, highly structured, decision-oriented and subject-oriented database, but has the disadvantage of dividing data into silos [START_REF] Stein | The enterprise data lake: Better integration and deeper analytics[END_REF].

Yet, everyone agrees that a data lake must be well designed. Otherwise, it is doomed to quickly become an inoperable data swamp [START_REF] Alrehamy | Personal Data Lake With Data Gravity Pull[END_REF]9]. That is, a data lake must allow querying data (selection/restriction) with good response times, and not only storing data and handling a "key-value" access. However, actual solutions are more or less non-existent in the literature and pertain to undisclosed industrial practices. This is why [START_REF] Pathirana | Modeling territorial knowledge from web data about natural and cultural heritage[END_REF] proposed a conceptual metadata model that allows indexing and efficiently querying an industrial heritage data lake constituted of XML data, texts, floorplans and pictures. This multidimensional model is similar to snowflake models used in data warehouses or datamarts, but only stores metadata, not the document corpus itself.

This metadata model has been instantiated physically in several NoSQL database management systems (DBMSs) to enable scaling. However, such a data warehouse-like schema cannot evolve easily when data sources evolve themselves, or when new sources pop up, whereas this is a crucial point in the management of a data lake.

Consequently, we propose in this paper:

1. to replace the multidimensional model of [START_REF] Pathirana | Modeling territorial knowledge from web data about natural and cultural heritage[END_REF] by an ensemble model, more precisely a data vault [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF]8,[START_REF] Eshetu | Data Vault Modelling: An Introductory Guide[END_REF][START_REF] Linstedt | Building a Scalable Data Warehouse with Data Vault 2[END_REF], which is a data model allowing easy schema evolutions and has, to the best of our knowledge, never been used in the context of metadata management; 2. to evaluate, the feasibility, on one hand, and the effectiveness of this model in terms of metadata query response (as an index), on the other hand, because it induces many joints. For this sake, we translate our conceptual metadata vault into different logical (i.e., relational and document-oriented) and physical (i.e., PostgreSQL1 and MongoDB2 ) models, which also helps compare the respective efficiency of the two physical models.

The remainder of this paper is organized as follows. Section 2 is devoted to a state of the art concerning data lakes and metadata management, on one hand, and ensemble modeling and data vaults in particular, on the other hand. Section 3 presents our conceptual metadata vault model, as well as its logical and physical translations. Section 4 details the experiments we conducted to validate the feasibility of our approach and compare the PostgreSQL and MongoDB physical models in terms of storage and metadata query response time. Finally, Section 5 concludes this paper and hints at research perspectives.

Related Work

Data Lakes and Metadata

Data lakes aim at quickly integrate very large volumes of mixed types data, i.e., from structured to unstructured data [START_REF] Dixon | Pentaho, Hadoop and Data Lakes[END_REF][START_REF] O'leary | Embedding AI and Crowdsourcing in the Big Data Lake[END_REF]9]. However, they are not only a storage technology, i.e., mostly the Hadoop Distributed File System (HDFS), but offer a new data ecosystem that allows cross-analyzing data on demand [START_REF] Ganore | [END_REF], without needing costly preprocessing tasks as in data warehousing processes. Data are immediately accessible through the schema-on-read (or late binding) approach [START_REF] Fang | Managing Data Lakes in Big Data Era: What's a data lake and why has it became popular in data management ecosystem[END_REF], unlike, again, in data warehouses that are periodically refreshed through an Extraction, Transformation and Loading (ETL) phase (schema-on-write) that may be expensive [START_REF] Miloslavskaya | Big Data, Fast Data and Data Lake Concepts[END_REF].

In summary, data lakes manage data with variety for on-demand, ad-hoc analyses; while data warehouses manage structured data for recurring, industrialized analyses. Data lakes are typically subdivided into three components [START_REF] Stein | The enterprise data lake: Better integration and deeper analytics[END_REF][START_REF] Alrehamy | Personal Data Lake With Data Gravity Pull[END_REF]:

1. a storage system: very often HDFS, though NoSQL DBMSs are also an option [9, 14]; 2. a metadata system, which we focus on below;

3. an access and analysis system generally relying on MapReduce or Spark [10].

By contrast, [9] proposes an architecture with respect to data types, made of so-called data ponds for raw data, analog (stream) data, application data (i.e., a data warehouse), textual data and archived data, respectively. In such a context, database research on querying multistore systems [START_REF] Bondiombouy | Query Processing in Multistore Systems: an overview[END_REF][START_REF] Tan | Enabling Query Processing across Heterogeneous Data Models: A Survey[END_REF] looks highly relevant. Data lakes mostly bear a "flat" architecture, where each data element has a unique identifier and a set of characterizing tags [START_REF] Miloslavskaya | Big Data, Fast Data and Data Lake Concepts[END_REF]. Such tags are actually essential metadata to help comprehend data and access data [START_REF] Alrehamy | Personal Data Lake With Data Gravity Pull[END_REF], not to mention query effectiveness.

The advantage of data tagging is that new data and new sources can be inserted on the fly. Once data are tagged, they just need to be connected to already stored data. This feature allows users to formulate queries directly, without needing the help of a business intelligence expert. Yet, this feature requires that the metadata system can manage this evolutive data structure.

Ensemble Modeling and Data Vaults

Ensemble modeling is an approach dating back from the early 2010's, which aims to renormalize data warehouses to bring them closer to the business concepts they model; and to allow better evolutivity, both in terms of data and schema [START_REF] Rönnbäck | Comparing Anchor Modeling with Data Vault Modeling[END_REF].

The two prominent approaches in ensemble modeling are data vaults [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF]8,[START_REF] Eshetu | Data Vault Modelling: An Introductory Guide[END_REF][START_REF] Linstedt | Building a Scalable Data Warehouse with Data Vault 2[END_REF] and anchor modeling [START_REF] Regardt | Anchor Modeling. In 28 th International Conference on Conceptual Modeling (ER 2009)[END_REF][START_REF] Rönnbäck | Anchor modeling -Agile information modeling in evolving data environments[END_REF]. Both are actually very close [START_REF] Rönnbäck | Comparing Anchor Modeling with Data Vault Modeling[END_REF], with a somewhat easier evolutivity and a non-destructive schema evolution for anchor modeling, but a larger number of objects to manage because of a sixth normal form (6NF) model, as well as non-automated maintenance procedures for timestamps. Data vaults are closer to traditional multidimensional models (they adopt the third normal form -3NF) and are supported by a greater number of tools, which made us select data vaults in this work. However, this choice is not definitively settled. Data vaults were invented to meet industrial needs [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF]. A data vault is defined at the relational, logical level as a linked set of normalized, detail-oriented and history-tracking tables that support one or more functional domains in an organization. It is a hybrid approach encompassing 3NF and the star schema [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF]8,[START_REF] Eshetu | Data Vault Modelling: An Introductory Guide[END_REF][START_REF] Linstedt | Building a Scalable Data Warehouse with Data Vault 2[END_REF]. This architecture allows incremental low-cost schema construction (making easy to modify business rules), seamless integration of unstructured data and loading in near real time. Data vaults also allow petabyte-scale big data management [START_REF] Linstedt | Building a Scalable Data Warehouse with Data Vault 2[END_REF]. Finally, artificial intelligence and data mining methods can easily and directly be applied to a data vault [START_REF] Linstedt | Data Vault Basics[END_REF].

More concretely, a data vault consists of the following main elements [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF]8,[START_REF] Eshetu | Data Vault Modelling: An Introductory Guide[END_REF][START_REF] Linstedt | Building a Scalable Data Warehouse with Data Vault 2[END_REF].

• A hub is a basic entity that represents a business concept (a dimension hierarchy level in a classical data warehouse, e.g., customer or product). A hub mainly contains a business key.

• A link materializes an association between two or more hubs. It would correspond to a fact entity in a classical data warehouse.

• A satellite contains the various descriptive data related to a hub or link.

Finally, note that, although they are defined at the logical level by [START_REF] Linstedt | Super Charge your Data Warehouse: Invaluable Data Modeling Rules to Implement Your Data Vault[END_REF], these concepts can easily be transposed to the conceptual [11] and physical [START_REF] Krneta | A direct approach to physical Data Vault design[END_REF] levels. An example of conceptual data vault model is shown in Figure 1.

Metadata Vault Model

Data Corpus

To illustrate our proposal with a use case that can serve as a proof of concept, we exploit the data corpus constituted by the TECTONIQ project, which aims to highlight the textile industrial heritage of the Lille Metropolis in northern France [START_REF] Kergosien | Vers l'interopérabilité des données hétérogènes liées au patrimoine industriel textile[END_REF][START_REF] Kergosien | TEchnologies de l'information et de la communication au Coeur du Ter-ritOire NumérIQue pour la valorisation du patrimoine[END_REF]. This corpus gathers heterogeneous data, supplied by different sources (Table 1) and must allow various types of analyses. Thence, the corpus is stored in a data lake whose metadata are multidimensionally modeled [START_REF] Pathirana | Modeling territorial knowledge from web data about natural and cultural heritage[END_REF]. We propose in this paper to make these metadata evolutive when new data sources pop up.

Conceptual Model

Although the multidimensional metadata model by [START_REF] Pathirana | Modeling territorial knowledge from web data about natural and cultural heritage[END_REF] is too large to be reproduced here, let us describe it briefly. It is designed around a set of dimensions with hierarchies: Date/Epoch, Figure 1 illustrates our conceptual metadata vault model, which exploits the conceptual modeling of data vaults' logical, relational concepts [11]. Blue rounded rectangles represent hubs, gray rectangles satellites and the green hexagon a link. Associations between hubs and links are of cardinality "many to many" to ensure the greatest generality, while associations betweens hubs or links and satellites are of cardinality "one to many".

To identify hubs, which are the most important and most used entities in queries, we target the metadata related to the characteristics of each input document, which are most susceptible to constitute keys. Thus, we select title (Hub Title), location (Hub Location), date (Hub Date)

and document category (Hub Category).

Then, we associate with each of these hubs a satellite that contains the hub's descriptive attributes. For example, the satellite connected to Hub Title, Sat Title, contains the Title, Authors, Description and Keywords attributes.

Hub Category is associated with four satellites that form a classification corresponding to each of the data sources we have. The descriptive attributes of these satellites are specific to each source.

Link Document allows to associate all hubs.

Finally, since our model concerns only metadata, each entity (hub, link, satellite) is described by a direct reference (Source) to a document (physical file) in the data lake. All data access are made through this reference.

Thanks to ensemble modeling, any new data source or schema evolution within the data corpus can be supported by adding satellites, in the simplest cases, or even hubs and links.

In addition, entities that would become obsolete are simply identified by their timestamp

Logical and Physical Models

To show that our conceptual model can adapt to different contexts, and to compare them, we translate it into two types of logical and physical models: a relational model with PostgreSQL and a document-oriented NoSQL model with MongoDB.

The relational metadata model (Table 2)3 is classically translated from the conceptual model (Figure 1). Let us only note that, in Table 2, the elements of the attributes column that are postfixed by id are foreign keys, and that satellite primary keys are also foreign keys that reference the corresponding hub's primary key. Eventually, the Datetime and Source attributes featured in all tables are not repeated for clarity. The document-oriented metadata model (Table 3) exploits the notion of collection. Each hub, link and satellite is translated into a collection comprising various documents, each having an identifier (ObjectID). In the MongoDB physical model, this identifier is generated automatically when the document is created. As in the relational case, the Datetime and Source fields present in all collections are not repeated for clarity.

Each hub is associated with both Link Document and its satellite(s) through its ObjectID.

For example, Hub Title is associated with Link Document and Sat Title through Title id.

Finally, Figure 2 presents an example of translation from the document-oriented logical model into the MongoDB physical model in JavaScript Object Notation (JSON) format.

{ "Sat_Book": { "00000C842_001": { "dc:relation": "http://www.sudoc.fr/122661389", "dc:creator": [ "Petit, Jules", "Chambre de commerce et d'industrie (Boulogne-sur-Mer, Pas-de-Calais).", "Commission du projet de chemin de fer direct de Calais a Marseille" ], "dc:subject": "Calais-Marseille, Chemin de fer (France).", "dc:publisher": "Villeneuve d'Ascq : SCD Lille 3", "dc:date": "[2008]", "dc:format": "application/pdf", "dc:language": "fre", "dc:rights": "domaine public", "dc:title": "Projet de chemin de fer de Calais a Marseille rapport fait a la Chambre de commerce de Boulogne, le 25 novembre 1881", "dc:type": "text", "dc:source": "Bibliotheque Georges Lefebvre" } } }

Experimental Validation

The objective of this section is to show the feasibility of our metadata vault model and to compare the physical models of Section 3.3 in terms of storage space and query response time.

We conduct our experiments on an Intel Core i5-5300U 2.30 GHz PC with 8 GB of memory, running Windows 64-bit. The DBMSs we use are PostgreSQL 9.6.2-1 and MongoDB ssl 3.4.3.

The data corpus in this test set is the one presented in Table 1.

Storage Volume

After inserting metadata in the chosen DBMSs' native format, we measure the storage volume required by PostgreSQL and MongoDB (Table 4). Our measurements take into account indexes automatically created by the DBMSs (e.g., on primary keys in PostgreSQL; no other index is created), unused memory space, and the space that is released when deleting or moving data.

5. Retrieve all titles containing the word "factory", and then the corresponding documents, whatever their category (data sources: Hub Title, Sat Title, Hub Category, Sat IHRIS and/or Sat VoixDuNord and/or Sat Inventory and/or Sat Book, Link Document).

The translation of all queries in SQL and MongoDB's query language are provided in Appendices A and B, respectively. Figure 3 features the average execution time of queries #1 to #4 under PostgreSQL and MongoDB, respectively. We execute each query 100 times (in the order indicated above) to compensate for any variation in execution time. Figure 3 shows tremendously low response times for MongoDB, while those obtained with PostgreSQL seem to evolve exponentially.

Conclusion

From the modeling of data lake metadata as a multidimensional schema, noticing that schema evolution is not guaranteed, we instead propose in this paper an ensemble model, more precisely a metadata vault.

The translation of our conceptual metadata model into logical and physical models, as well as experiments carried out on the TECTONIQ corpus, help demonstrate the feasibility of our modeling choice in terms of metadata storage volume and response time to queries formulated on the metadata.

The comparison of two physical models (PostgreSQL and MongoDB) also reveals the superiority of document-based models for storing this type of metadata.

The perspectives that this preliminary work is opening are numerous. In particular, it would be necessary to test the robustness of the metadata model when source data scale up, add data sources to verify the relevance of data vault modeling and test the model with queries more complex than projections/restrictions. Moreover, although the supporters of anchor modeling argue that 6NF modeling allows good response times thanks to the join eliminating technique used in modern optimizers [START_REF] Paulley | Exploiting Functional Dependence in Query Optimization[END_REF], it is also important to compare query efficiency over data vault and anchor models vs. classical star-like schemas, with a benchmark that allows significant database scale-up.

Finally, various alternative metadata models, independently from the modeling techniques used, could be considered and compared. Schemas of the TECTONIQ documents could also be automatically extracted to enrich the metadata. Introduction To The Concept Of Data Lake And Its Benefits. https://www.esds.co.in/blog/ introduction-to-the-concept-of-data-lake-and-its-benefits/, February 2015.

[7] H. Giménez. PostgreSQL Performance Considerations. https://robots.thoughtbot.

com/postgresql-performance-considerations, January 2011.

[8] H. Hultgren. Data vault modelling guide -Introductory guide to data vault modelling. Genesee Academy. https://hanshultgren.files.wordpress.com/2012/09/ data-vault-modeling-guide.pdf, 2012.

[9] B. Inmon. Data Lake Architecture: Designing the Data Lake and avoiding the garbage dump. Technics Publications, 2016.

[10] T. John and P. Misra. Data Lake for Enterprises: Lambda Architecture for building enterprise data systems. Packt Publishing, May 2017.

[11] V.

Figure 1 :

 1 Figure 1: Metadata vault conceptual model

Figure 2 :

 2 Figure 2: JSON excerpt from the Sat Book collection of the MongoDB physical model

Figure 3 : 4 Figure 4

 344 Figure 3: Average response times of queries #1 to #4

Figure 4 :

 4 Figure 4: Average response time of query #5

  Link_Document LD, Hub_Title HT, Sat_Title ST, Hub_Location HL, Sat_Location SL WHERE LD.Title_id = HT.Title_id AND LD.Location_id = HL.Location_id AND HT.Title_id = ST.Title_id AND HL.Location_id = SL.Location_id AND Title LIKE '%factory%' AND Address = 'Tourcoing' --3 SELECT * FROM Link_Document LD, Hub_Title HT, Sat_Title ST, Hub_Location HL, Sat_Location SL, Hub_Date HD, Sat_Date SD WHERE LD.Title_id = HT.Title_id AND LD.Location_id = HL.Location_id AND LD.Date_id = HD.Date_id AND HT.Title_id = ST.Title_id AND HL.Location_id = SL.Location_id AND HD.Date_id = SD.Date_id AND Title LIKE '%factory%' AND Address = 'Tourcoing' AND DATE_TRUNC('year', DepositDate) = 2010 --4 SELECT * FROM Link_Document LD, Hub_Title HT, Sat_Title ST, Hub_Location HL, Sat_Location SL, Hub_Date HD, Sat_Date SD, AND DATE_TRUNC('year', DepositDate) = 2010 AND SB.Category_id = 'book' Link_Document LD, Hub_Title HT, Sat_Title ST WHERE LD.Title_id = HT.Title_id AND HT.Title_id = ST.Title_id AND Title LIKE '%factory% LOOP FOR cat IN EXECUTE "SELECT * FROM Hub_Category HC, Sat_" || doc.category_id || " SL WHERE HC.Category_id = SL.Category_id" LOOP --Tuples doc and cat together provide full document info. id", as : "sat_location" }}, {$unwind : "$hub_location"}, {$match : {'hub_location.location': /Tourcoing/}}, sat_date" }}, {$unwind : "$hub_date"}, {$match : {'hub_date.depositdate': /2010id", as : "satellite" }}, { $lookup : {

Table 1 :

 1 TECTONIQ corpus features

	Source	Inventory	La Voix du Nord
	Description	Industrial building	Press articles related to the
		descriptions	textile industry
	Number of documents	49	1
	Number of instances	49	30
	Overall size	120 KB	92 KB
	Format	XML (data)	XML (documents)
	Source	IHRIS Pictures	Books
	Description	Photos and plans of buildings	Public domain French history
		and monuments related to the	books
		textile industry
	Number of documents	30	165
	Number of instances	30	165
	Overall size	2.78 MB	1011.25 MB
	Format	JPEG	PDF

Keyword, Location/District/City, Source, Reference/Author; on which "fact" entities (without measures) that correspond to the data sources from Table

1

plug in.

Table 2 :

 2 Metadata vault relational logical model

	Table	Primary key	Attributes
			Hubs
	Hub Title	Title id
	Hub Date	Date id
	Hub Location	Location id
	Hub Category	Category id
			Link
	Link Document	Document id	Title id, Location id, Date id, Category id
			Satellites
	Sat Title	Title id, Datetime	Title, Authors, Description, Keywords
	Sat Date	Date id, Datetime	Epoch, DepositDate, UpdateDate
	Sat Location	Location id, Datetime Address, AdditionalInfo, Reference
	Sat IRHIS	Category id, Datetime CodePhoto, Provenance
	Sat VoixDuNord Category id, Datetime Language, Note
	Sat Inventory	Category id, Datetime Property, Link
	Sat Book	Category id, Datetime Rights, Publisher

Table 3 :

 3 Metadata vault document-oriented logical model

	Collection	ObjectID	Fields
			Hubs
	Hub Title	Title id
	Hub Date	Date id
	Hub Location	Location id
	Hub Category	Category id
			Link
	Link Document	Document id
		Satellites
	Sat Title	Title id	Title, Authors, Description, Keywords
	Sat Date	Date id	Epoch, DepositDate, UpdateDate
	Sat Location	Location id	Address, AdditionalInfo, Reference
	Sat IRHIS	Category id	CodePhoto, Provenance
	Sat VoixDuNord Category id	Language, Note
	Sat Inventory	Category id	Property, Link
	Sat Book	Category id	Rights, Publisher

https://www.postgresql.org

https://www.mongodb.com

We adopt this unusual table presentation to have a uniform representation with the document-oriented model (Table3) and facilitate the comparison of the two logical models.

Acknowledgments

The authors would like to thank Éric Kergosien, leader of the TECTONIQ project, for making the data corpus available.

We first note that the volume of metadata generated for 245 files is small (less than 1 MB) in both cases. In addition, MongoDB systematically requires less space than PostgreSQL. This is explained by the use of the JSON format, which is very light, in MongoDB. In contrast, in PostgreSQL, each table is stored as a page vector of predetermined size (8 KB), resulting in pages that are not fully filled.

Response Time

To measure the performance of the proposed metadata model, we formulate five queries of increasing complexity with respect to the number of hubs involved (and, therefore, to joins via Link Document), which we apply on both physical models.

1. Retrieve all documents whose title contains the word "factory" (data sources: Hub Title, Sat Title).

2. Retrieve all documents whose title contains the word "factory" and whose address is "Tourcoing" (data sources: Hub Title, Sat Title, Hub Location, Sat Location, Link Document).

3. Retrieve all documents whose title contains the word "factory", whose address is "Tourcoing" and whose deposit date is in 2010 (data sources: Hub Title, Sat Title, Hub Location, Sat Location, Hub Date, Sat Date, Link Document).

4. Retrieve all documents whose title contains the word "factory", whose address is "Tourcoing", whose deposit date is in 2010 and that belong to the "book" category (data sources:


Esmaeil Seraj
email: esmaeil.seraj09@gmail.com

Electrophysiological Toolbox (OSET)

Keywords: Instantaneous Phase Estimation, Phase Extraction, Robust Phase Estimation, Statistical framework for EEG Phase Analysis, Transfer Function Perturbation, TFP, EEG Phase, Phase Quantities, Instantaneous Frequency, Phase Difference, Phase Shift Events, Phase Lock Events, Phase Resetting, MATLAB Functions, Free Toolbox, User Guide

This document is meant to help individuals use the Cerebral Signal Instantaneous Parameters Estimation MATLAB Toolbox which implements different methods for estimating the instantaneous parameters of cerebral signals (i.e. EEG, MEG and etc. ) such as phase, frequency and envelope of a signal and calculating some related well-known quantities in a variety of applications. The toolbox -which is distributed under the terms of the GNU GENERAL PUBLIC LICENSE as a set of MATLAB R routines -can be downloaded directly at the address: http://oset.ir/category.php?dir=Tools .

or from the public repository on GitHub, at address below:

https://github.com/EsiSeraj/EEG-PhaseFreq-Analysis . The purpose of this toolbox is to calculate the instantaneous phase, frequency and envelope sequences of cerebral signals (EEG, MEG, etc.) and some related popular features and quantities in brain studies and Neuroscience such as Phase Synchronization, Frequency Shift, Phase Resetting, Phase Locking Value (PLV), Phase Difference and more, to help researchers in these fields.

Getting Started

This document is meant to help individuals use the Cerebral Signal Instantaneous Parameters Estimation MATLAB Toolbox which implements different methods, including recently proposed Transfer Function Perturbation (TFP) framework through both procedures introduced in [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF] and [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF], for estimating the instantaneous parameters of cerebral signals (i.e. EEG, MEG and etc. ) such as phase, frequency and envelope of a signal and calculating some related well-known quantities in a variety of applications, as introduced and utilized in different studies such as [START_REF] Karimzadeh | A distributed classification procedure for automatic sleep stage scoring based on instantaneous electroencephalogram phase and envelope features[END_REF][START_REF] Seraj | An Investigation on the Utility and Reliability of Electroencephalogram Phase Signal upon Interpreting Cognitive Responses in the Brain: A Critical Discussion[END_REF][START_REF] Seraj | Improved Detection Rate in Motor Imagery Based BCI Systems Using Combination of Robust Analytic Phase and Envelope Features[END_REF] and [START_REF] Seraj | Cerebral Synchrony Assessment: A General Review on Cerebral Signals' Synchronization Estimation Concepts and Methods[END_REF]. The references and utilized test data are introduced later.

License -No Warranty

Citation

Within the limits of the GNU GENERAL PUBLIC LICENSE, you can use the toolbox as you please.

If you use the toolbox in a work of your own that you wish to publish, please make sure to cite this user manual [START_REF] Seraj | Cerebral Signal Phase Analysis Toolbox -User Guide Version 2[END_REF], the original studies [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF][START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] and the OSET [START_REF] Sameni | The Open-Source Electrophysiological Toolbox (OSET)[END_REF] properly, as shown below. This way you will contribute to helping other scholars find these items. 2 User Guide

Context

The purpose of this toolbox is to calculate the instantaneous phase and frequency sequences of cerebral signals (EEG, MEG, etc.) and some related popular features and quantities in brain studies and Neuroscience such as Phase Shift, Phase Resetting, Phase Locking Value (PLV), Phase Difference and more, to help researchers in these fields. The original research papers introducing the estimation methods and discussing the underlaying mathematical logics are [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] and [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF]. For proof of concept, these methods and feature estimation functions have been used and tested in different applications such as BCI [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF][START_REF] Seraj | Improved Detection Rate in Motor Imagery Based BCI Systems Using Combination of Robust Analytic Phase and Envelope Features[END_REF], sleep stage scoring [START_REF] Karimzadeh | A distributed classification procedure for automatic sleep stage scoring based on instantaneous electroencephalogram phase and envelope features[END_REF] and general brain synchrony and connectivity [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF][START_REF] Seraj | An Investigation on the Utility and Reliability of Electroencephalogram Phase Signal upon Interpreting Cognitive Responses in the Brain: A Critical Discussion[END_REF][START_REF] Seraj | Cerebral Synchrony Assessment: A General Review on Cerebral Signals' Synchronization Estimation Concepts and Methods[END_REF].

Fundamentals

Conventional Instantaneous Phase Estimation Procedure

The most common definition of the instantaneous phase is based on the analytic representation of a signal [START_REF] Chavez | Towards a Proper Estimation of Phase Synchronization From Time Series[END_REF]. Unless the signal has a very narrow-band spectral support, the extracted phase signal might be meaningless [START_REF] Chavez | Towards a Proper Estimation of Phase Synchronization From Time Series[END_REF]. Accordingly, for the signal x(t), the first step is the frequency filtering and make the signal narrow-band x f (t). Thereby, the analytical form of filtered signal is defined as follows [START_REF] Picinbono | On the Instantaneous Amplitude and Phase of Signals[END_REF]:

z x (t) = x f (t) + jH{x f (t)} (1)
where H{x f (t)} is the Hilbert transform of filtered signal. Using the analytical form, the instantaneous amplitude and phase pair are uniquely defined as follows:

a x (t) = |z x (t)| = x f (t) 2 + H{x f (t)} 2 (2)
φ x (t) = arctan H{x f (t)} x f (t) (3)
In traditional phase estimation procedure, linear-phase filters, i.e. FIR filters, are widely used through the Hilbert Transform to have the minimum distortion on the phase of signal. In this toolbox, the function Phase Ex Trad.m is provided for this purpose. where the inputs and outputs are described later.

Robust Monte Carlo Phase Estimation Approach (Random Perturbations in Filters Response)

Zero-pole Perturbation Phase estimation procedure (Z-PPP) is a new robust method presented for extracting the instantaneous phase of a signal [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF]. This method is based on using the IIR filters in a zero-phase filtering process with absolutely no phase distortion for making the signal narrow-band and then perturbing the frequency response of the utilized filter to reduce the side-effects of the procedure. A complete description of the Z-PPP method and confronting problems and side-effects in phase estimation process is presented in [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF]. In fact, in Z-PPP method, the procedure described in 2.2.1 is modified in way that the estimated instantaneous phase signal is more reliable and meaningful.

In this toolbox, the function Phase Ex ZPPP.m is provided for this purpose. To operate this function you can either use the test m-file Test Phase Ex ZPPP.m or just simply type:

[phase, inst freq, amp] = Phase Ex ZPPP(x1, fs, WS, max f, ndft, pertnum)

where the inputs and outputs are described later.

Robust Statistical Framework for Instantaneous EEG Phase and Frequency Analysis

In our recent study [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF], we have presented a statistical framework for EEG phase analysis. Using an additive data model between the so called background (spontaneous) and foreground EEG, probability density functions and other statistical properties of the instantaneous EEG envelope, phase and frequency were derived. It was analytically and numerically shown that in low analytical signal envelopes, the EEG phase is highly noisy and susceptible to the background EEG activity. It was shown that although EEG phase variations convey important information regarding the EEG, some instantaneous phase jumps are systematic side effects of the processing stages used for EEG phase extraction in low analytical envelopes and are not related to the brain [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF].

In this research [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF], using this widely accepted phase calculation approach and well-established methods from statistical signal processing, a stochastic model is proposed for the superposition of narrowband foreground and background EEG activities. Using this model, the probability density functions of the instantaneous envelope (IE) and IP of EEG signals are derived analytically. Based on the findings reported in [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF], we have proposed a Monte Carlo estimation scheme is for the accurate calculation and smoothing of phase related parameters. The impact of this approach on previous studies including time-domain phase synchrony, phase resetting, phase locking value and phase amplitude coupling are also studied in [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] with examples.

In this toolbox, the function Phase Ex TFP.m is provided for this purpose. where the inputs and outputs are described later.

In order to make the results of our recent study "A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis" [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] reproducible, all source codes of this study are also available in this toolbox. For any further details, please refer to the original research [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF]. Utilizing this programs requires four extra filtering functions, namely BPFilter5.m, KFNotch.m, LPFilter.m and KalmanSmoother.m from "General filtering and processing tools" of OSET which for simplicity are included within current toolbox as well. Each m-file is shortly described below.

• The program Test StstclFrmwrk SNRver KalmanSmooth.m implements the presented robust statistical framework for instantaneous EEG phase and frequency analysis, the SNR verification described within the paper [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] and the proposed post-processing step through Kalman Smoothing, all in once.

• The program Test StstclFrmwrk AmpPhase Distributions.m implements and illustrates the probability density functions (PDF) of envelope and phase, introduced in the paper [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF].

• The program Test StstclFrmwrk Example LowAmp.m is the implementation of an example showing the effects of calculating phase and frequency in low-amplitude analytic signal, as represented in [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF].

• The program Test StstclFrmwrk ROCCurves.m calculates and illustrates the probability of signal detectability versus required SNR by using the probability of false alarm (as represented in [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] and Ch.6 of [START_REF] Richards | Fundamentals of radar signal processing[END_REF]).

Phase Related Quantities

The [START_REF] Karimzadeh | A distributed classification procedure for automatic sleep stage scoring based on instantaneous electroencephalogram phase and envelope features[END_REF][START_REF] Seraj | An Investigation on the Utility and Reliability of Electroencephalogram Phase Signal upon Interpreting Cognitive Responses in the Brain: A Critical Discussion[END_REF][START_REF] Seraj | Improved Detection Rate in Motor Imagery Based BCI Systems Using Combination of Robust Analytic Phase and Envelope Features[END_REF]] and [START_REF] Seraj | Cerebral Synchrony Assessment: A General Review on Cerebral Signals' Synchronization Estimation Concepts and Methods[END_REF].

Phase Derivative (PD) and Instantaneous Frequency (IF):

The PD is one of most common and well-known phase related quantities used in analyzing the phase of signals. In this toolbox, it can be calculated both in single and multi-channel modes through the functions Phase Features SingleCh.m or Phase Features MultiCh.m. In single channel case, for a signal x(t), the P D s is computed as first order time derivative of the phase sequence, which is equal to the instantaneous frequency (IF) of the signal [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF].

P D s (t) = dφ x (t) dt (4)
where the φ x (t) is the instantaneous phase sequence of x(t) captured at frequency f . In multi-channel case, P D m is calculated as the phase difference between two signals x(t) and y(t) as below [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF]:

P D m (t) = φ x (t) -φ y (t) (5)
Phase Shift (PS), Phase Lock (PL) and Phase Resetting (PR) Events: Calculating the PS events consists of, first detecting the phase-displacements or phase-jumps, and then choosing the most significant ones as the PS events [12,[START_REF] Freeman | Aperiodic phase-resetting in scalp EEG of beta-gamma-oscillations by state transitions at alpha-thetarates[END_REF]. In other words, for computing the phase shift, the first step is to calculate the d(t) as,

d(t) = d(P D(t)) dt (6)
and then the PS can be obtained as follows [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF]:

∀t : P S = d(t) | d(t) ≥ T h (7)
where T h is the threshold used to discriminate between significant and nonsignificant displacements or jumps.

On the contrary, In the case of spontaneous or ongoing cerebral signals where there is no evoking stimulus, a near zero first derivative of PD demonstrates phase lock [12,[START_REF] Freeman | Aperiodic phase-resetting in scalp EEG of beta-gamma-oscillations by state transitions at alpha-thetarates[END_REF]. In other words, PL has an opposite definition to PS. Therefore, after calculating the d(t) as represented in equation 6, the PL can be computed as follows:

∀t : P L = d(t) | d(t) ≤ T h (8)
Basically, phase resetting is made up of a phase shift followed by a phase difference stability, i.e. phase lock [START_REF] Pikovsky | Synchronization: A universal concept in nonlinear sciences[END_REF]. Thus, each pair of PS and PL, starting from the beginning of the PS and finishing by the end of PL (beginning of the next PS), is called a phase reset.

For Phase-locking Value (PLV): PLV is a measure for quantifying how constant the phase difference between two signals is. In order to calculate the PLV for two signals (or channels) x(t) and y(t), the following steps are required [START_REF] Lachaux | Measuring Phase Synchrony in Brain Signals[END_REF]:

• Using narrow-band filters centered at f , calculate the instantaneous frequency-specific phase values φ x (t, f ) and φ y (t, f ).

• Calculate the instantaneous phase-difference between x(t) and y(t) and quantify the local stability of this phase-difference over time:

P LV (f ) = 1 T T t=1 exp (j[φ y (t, f ) -φ x (t, f )]) ( 9
)
where T is the signal length and the summation is over all temporal samples of the instantaneous phases.

PLV varies between 0 and 1, corresponding to completely non-synchronized signals and complete synchronization, respectively [START_REF] Lachaux | Measuring Phase Synchrony in Brain Signals[END_REF]. In this toolbox, provided functions calculate the pairwise PLV which is the calculated PLV value between each possible pair of signal channels in a desired frequency f .

In the current toolbox, the functions PLV RawSig.m and PLV PhaseSeq.m are provided for this purpose. To operate these functions, you can either use the test m-files Test PLV RawSig.m and Test PLV PhaseSeq.m, or just simply type:

PLV = PLV RawSig(meth, sig1, fs, f0, WS, ndft, pertnum, sig2)

for calculating PLV from raw signals (i.e. EEG signal) and type: PLV = PLV PhaseSeq(phase sig1, phase sig2, phase sig3, ...)

for measuring the pairwise PLV from phase sequences, where the last case can also be used in another form as:

PLV = PLV PhaseSeq(phase sig)
where in first case phase sig1, phase sig2, phase sig3, ... are phase vectors; however phase sig in last case is a phase matrix with each row stating a phase sequence.

3 Reference Manual • The bandwidth BW in utilized FIR filter is approximately equal to WS 2 . • The outputs are calculated as matrices for the frequency interval [1 max f] where the rows include phase information regarding the corresponding frequency components (for example 10th row in output phase matrix includes instantaneous phase of 10(Hz) estimated from input signal).

• While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required.

• The m-file Test Phase Ex Trad.m is a demo program to operate this function.

Phase Ex ZPPP.m

Phase Ex ZPPP.m

Purpose: Instantaneous Phase (IP) estimation using the Zer-pole Perturbation Phase estimation method (Z-PPP) [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF] through analytic representation IIR filters and forward-backward filtering. Refer to [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF] for detailed description.

Synopsis (global mode):

[phase, inst freq, amp] = Phase Ex ZPPP(x1, fs) • The bandwidth BW in utilized IIR filter is equal to WS 2 .

Synopsis
• The outputs are calculated as matrices for the frequency interval [1 max f] where the rows include phase information regarding the corresponding frequency components (for example 10th row in output phase matrix includes instantaneous phase of 10(Hz) estimated from input signal).

• While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required.

• The m-file Test Phase Ex ZPPP.m is a demo program to operate this function.

Phase Ex TFP.m Phase Ex TFP.m

Purpose: Instantaneous Phase estimation using the Transfer-Function Perturbation Phase estimation method (TFP) [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] through analytic representation, IIR filters and forward-backward filtering. Refer to the [START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF] for detailed description.

Synopsis (global mode):

[phase, inst freq, amp] = Phase Ex TFP(x1, fs)

Synopsis (local mode):

[phase, inst freq, amp] = Phase Ex TFP(x1, fs, f0, bw base, f0 dev, bw base dev, dither std, pertnum) • By default, without specifying the frequency band of interest for phase estimation through TFP method, this function calculates the instantaneous parameters, i.e. IP, IF and IE, for the alpha rhythms (8-12Hz) of input EEG signal.

Inputs
• While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required.

• The m-file Test Phase Ex TFP.m is a demo program to operate this function.

Phase Features.m Phase Features.m

Purpose: Calculating popular phase related quantities, i.e. Phase Shift (PS), Phase Lock (PL), Phase Reset (PR), Phase Difference (PD) and Instantaneous Frequency (IF) in SINGLE or MULTI-Channel modes using phase sequences.

Synopsis (Multi-channel):

[PR, PS, PL, PDV, PD] = Phase Features(phase sig1, fs, Th)

[PR, PS, PL, PDV, PD] = Phase Features(phase sig1, fs, Th, phase sig2)

Synopsis (Single-channel):

[IF, PR, PS, PL] = Phase Features(phase sig1, fs, Th)

Inputs:

Input Description phase sig1 instantaneous phase vector or matrix fs sampling frequency (Hz) Th threshold value used to detect phase shift events (Radians) phase sig2 instantaneous phase vector

Outputs:

Output Description PR Phase Resetting events vector PS Phase Shift events vector PL Phase Lock events vector IF Instantaneous Frequency vector PD Phase Difference vector PDV Phase Difference Variations (first order time derivative) vector

Notes:

• The option phase sig2 is provided in case that someone needs to calculate the phase features between two separate signals; however, the recommended option is to use the input phase sig1 as a phase matrix (with size 2*N) for calculating phase quantities in multi-channel case.

• In single-channel mode, the input phase sig1 have to be a vector and in multi-channel mode, it could be a vector or a matrix, as stated above.

• The m-file Test Phase Features.m is a demo program to operate this function. • While using the first case, the phase sig have to be a matrix with at least two rows where each row represents a phase signal. In second case, each of the phase sig1...phase sign are row vectors of phase sequences. This option is provided in case that someone needs to calculate the PLV matrix between separate phase signals. • The bandwidth BW in utilized filter, i.e. IIR or FIR, is equal to WS 2 .

3.5

• The available values for the input meth are either 'ZPPP' or 'Trad' where the first uses the Phase Ex ZPPP and the other one uses the Phase Ex Trad for estimating initial phase sequence.

• While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required.

• In case that you need a single PLV value between signals (and not a pairwise PLV matrix), you can just simply use the non-diagonal values in output matrix.

• The option sig2 is provided in case that someone needs to calculate the PLV value between separate raw signals. • While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required.

• The m-file Test Synth EEG.m is a demo program to operate this function.

Outcomes

Below are presented some example figures generated by the test m-files provided within the toolbox.

The following figures are generated using the Z-PPP and TFP phase estimation methods [START_REF] Seraj | Robust Electroencephalogram Phase Estimation with Applications in Brain-computer Interface Systems[END_REF][START_REF] Sameni | A Robust Statistical Framework for Instantaneous Electroencephalogram Phase and Frequency Analysis[END_REF]. Similar forms of outcomes can be observed using the traditional method.

Contents 1 Getting Started 1 . 1

 11 License -No Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 The Open-Source Electrophysiological Toolbox (OSET) . . . . . . . . . . . . . 1.2 Citation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Download and Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3. 7

 7 PLV PhaseSeq.m PLV PhaseSeq.m Purpose: Calculating Phase Locking Value (PLV) matrix (Pairwise PLV) using phase sequences. Synopsis: PLV = PLV PhaseSeq(phase sig) PLV = PLV PhaseSeq(phase sig1, phase sig2, phase sig3, ...)Inputs:Input Description phase sig input phase matrix phase sig1 input phase vector #1 phase sig2 input phase vector #2

Figure 1 :

 1 Figure 1: Instantaneous Phase (IP) sequences of [1 30]Hz (left panel). IP and IF of 8Hz, (right panel, top and bottom figures respectively).

Figure 2 :

 2 Figure 2: Instantaneous Frequency (IF) and Instantaneous Amplitude (IA) sequences of [1 30]Hz, left and right side panels respectively.

Figure 4 :

 4 Figure 4: Phase related quantities, MULTI-channel mode.

Figure 5 :

 5 Figure 5: Phase related quantities, SINGLE-channel mode.

2

  User Guide 2.1 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Conventional Instantaneous Phase Estimation Procedure . . . . . . . . . . . . 2.2.2 Robust Monte Carlo Phase Estimation Approach (Random Perturbations in Filters Response) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Robust Statistical Framework for Instantaneous EEG Phase and Frequency Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.4 Phase Related Quantities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	4 Outcomes
	5 References

3 Reference Manual 3.1 Phase Ex Trad.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Phase Ex ZPPP.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Phase Ex TFP.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Phase Features.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Phase Features MultiCh.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Phase Features SingleCh.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 PLV PhaseSeq.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 PLV RawSig.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Synth EEG.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  This program is free software; you can redistribute it and/or modify it under the terms of the

GNU GENERAL PUBLIC LICENSE as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GENERAL PUBLIC LICENSE for more details. You should have received a copy of the GNU GENERAL PUBLIC LICENSE along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 1.1.1 The Open-Source Electrophysiological Toolbox (OSET) Open Source Electrophysiological Toolbox (OSET) is a collection of electrophysiological data and open source codes for biosignal generation, modeling, processing, and filtering. OSET, version 3.1, 2014 Released under the GNU GENERAL PUBLIC LICENSE. Copyright c 2012. Reza Sameni (reza.sameni@gmail.com), Department of Computer Science & Information Technology, School of Electrical and Computer Engineering, Shiraz University, Shiraz, Iran.

  The functions and m-files can be downloaded separately as you need or all together in a compressed file named Phase Analysis Toolbox. Once you have downloaded and uncompressed the toolbox, 36 files represented in following Tables shall be appeared. Additionally, you might add the path of the directory in which you stored the toolbox to your MATLAB in order to easily use and apply the functions for your own dataset.The file User Guide Ver2.3.pdf, is similar to current document and contains the latest version of the cerebral signal phase analysis toolbox user manual. The rest of the files are categorized into three groups according to the tables. The main data files Z001, Z002 and Z003 presented in Table 1.3 are ongoing EEG signals employed from the dataset introduced in[START_REF] Andrzejak | Indications of nonlinear deterministic and finite dimensional structures in time series of brain electrical activity: Dependence on recording region and brain state[END_REF] and their corresponding instantaneous phase signals are extracted using the functions in current toolbox.

	• Reza Sameni, The Open-Source Electrophysiological Toolbox (OSET), [Online] version 3.1
	(2014). URL http://www.oset.ir
	1.3 Download and Utilization
	1.4 Getting Help
	The latest version of the toolbox can be downloaded at:
	http://oset.ir/category.php?dir=Tools If you have added the toolbox directory to the MATLAB R path you can simply type:
			<doc	function name>	or	<help	function name>
	in command window to get online help for the function you are using. Furthermore, you can also
	contact the providers 1 directly to ask any related questions or discuss possible difficulties or errors
	you might encounter. Please feel free to contact in either cases.
					Table 1: Sample Data and User Manual
				row	name	row	name
				1	LICENSE.txt	6	User Guide Ver2.3.pdf
				2	EEG.m	7	Z phase.mat
				3	Z001 phase.mat	8	Z001.txt
				4	Z002 phase.mat	9	Z002.txt
				5	Z003 phase.mat 10	Z003.txt
	Table 2: Conventional, Robust Phase Calculation [1] and [2] Methods Alongside with Phase Feature
	Estimators From [4, 5, 6] and [7]
	row		name (function)	row	name (test m-files)
		1		Phase Ex TFP.m	10	Test Phase Ex TFP.m
		2		Phase Ex ZPPP.m	11	Test Phase Ex ZPPP.m
		3		Phase Ex Trad.m	12	Test Phase Ex Trad.m
	.	4 5	Phase Features MultiCh.m Phase Features SingleCh.m 14 Test Phase Features SingleCh.m 13 Test Phase Features MultiCh.m
		6		Phase Features.m	15	Test Phase Features.m
		7		PLV PhaseSeq.m	16	Test PLV PhaseSeq.m
		8		PLV RawSig.m	17	Test PLV RawSig.m
		9		Synth EEG.m	18	Test Synth EEG.m
	Table 3: Source Codes of Statistical Framework for EEG Phase and Frequency Analysis Represented
	in [2] and Required Extra Filtering Functions from OSET [8]
	row				name	row	name
	1		Test StstclFrmwrk SNRver KalmanSmooth.m	5	BPFilter5.m
	2	Test StstclFrmwrk AmpPhase Distributions.m	6	LPFilter.m
	3		Test StstclFrmwrk Example LowAmp.m	7	KFNotch.m
	4			Test StstclFrmwrk ROCCurves.m	8	KalmanSmoother.m

  To operate this function you can either use the test m-file Test Phase Ex Trad.m or just simply type:

[phase, inst freq, amp] = Phase Ex Trad(x1, fs, WS, max f, ndft)

  [phase, inst freq, amp] = Phase Ex TFP(x1, fs, f0, bw base, bw base dev, f0 dev, dither std, pertnum)

To operate this function you can either use the test m-file Test Phase Ex TFP.m or just simply type:

  Phase Features SingleCh.m and Phase Features MultiCh.m are provided to calculate the first five features in single or multi-channel signals and the functions PLV RawSig.m and PLV PhaseSeq.m are generated to measure the PLV in multi-channel signals (multi-channel EEG records) or between separate signals. The underlying principals are stated in the followings. These scripts are the main software utilized for research studies presented in

most popular phase related quantities, particularly used in brain-studies and neuroscience, are: Phase Derivative (PD), Phase Shift (PS), Phase Lock (PL), Phase Resetting (PR), Instantaneous Frequency and Phase-locking Value (PLV). In this toolbox, functions Phase Features.m,

  Esmaeil Serajfor signle-channel case. The difference between function Phase Features.m and functions Phase Features Mul or Phase Features SingleCh.m is that function Phase Features.m takes phase sequences as input and calculates the quantities; however, functions Phase Features MultiCh.m and Phase Features SingleCh. take raw signals (i.e. EEG) as inputs, compute the instantaneous phase sequences of input signals and then measure required phase features.

	Test Phase Features.m
	Test Phase Features SingleCh.m
	Test Phase Features MultiCh.m
	or simply type:
	[PR, PS, PL, PDV, PD] = Phase Features(phase sig1, fs, Th, phase sig2)
	or
	[PR, PS, PL, PDV, PD] = Phase Features MultiCh(meth, sig1, sig2, fs, f0, WS, ndft,
	pertnum)
	for multi-channel PS and type:

calculating the PD, IF, PS, PL or PR, based on single or multi-channel phase features, you can either use the test m-files of the introduced functions, namely, [IF, PR, PS, PL] = Phase Features(phase sig1, fs, Th) or [IF, PR, PS, PL] = Phase Features SingleCh(meth, sig, fs, f0, WS, ndft, pertnum)

  :

	Defaults:
	Input	Default Values
	f0	10 (Hz) *** for EEG alpha rhythms
	bw base	4 (Hz) *** for EEG alpha rhythms
	f0 dev	1e-6 (Hz)
	bw base dev	1e-1 (Hz)
	dither std	1e-4
	pertnum	100
	Outputs:
		Output	Description
		phase	Instantaneous Phase matrix
		inst freq Instantaneous Frequency matrix
		amp	Instantaneous Amplitude matrix
	Notes:
	Input	Description
	x1	input signal
	fs	sampling frequency (Hz)
	f0	center frequency of the frequency filter (Hz)
	bw base	bandwidth of the frequency filter (Hz)
	f0 dev	center frequency deviation range (Hz)
	bw base dev bandwidth deviation range (Hz)
	dither std dither noise level
	pertnum	number of attempts for perturbing filter's transfer function

  The bandwidth BW in utilized filter, i.e. IIR or FIR, is equal to WS 2 .• The available values for the input meth are either 'ZPPP' or 'Trad' where the first uses the Phase Ex ZPPP and the other one uses the Phase Ex Trad for estimating initial phase sequence.• While specifying a value to one of the parameters having default values, an empty bracket [] must be used for non-specified parameters. If you're using the global synopsis, empty bracket is not required. • The m-file Test Phase Features MultiCh.m is a demo program to operate this function. Calculating popular phase related quantities, i.e. Phase Shift (PS), Phase Lock (PL), Phase Reset (PR) and Instantaneous Frequency (IF) in SINGLE-Channel mode. The bandwidth BW in utilized filter, i.e. IIR or FIR, is equal to WS 2 . • The available values for the input meth are either 'ZPPP' or 'Trad' where the first uses the Phase Ex ZPPP and the other one uses the Phase Ex Trad for estimating initial phase sequence.

	Inputs: Synopsis (global mode):
		Input [IF, PR, PS, PL] = Phase Features SingleCh(meth, sig, fs, f0) Description
		meth		character specifying utilized method for phase estimation
	sig1 sig2 Synopsis (local mode):	input raw signal #1 vector input raw signal #2 vector
	fs [IF, PR, PS, PL] = Phase Features SingleCh(meth, sig, fs, f0, WS, ndft, pertnum) sampling frequency (Hz)
		f0		frequency of interest (Hz)
	Inputs:	WS ndft		utilized filter's stop-band frequency (Hz) number of frequency bins
		pertnum number of attempts for perturbing filter's zeros and poles Input Description
		meth		character specifying utilized method for phase estimation
	Defaults:	sig fs f0 WS ndft pertnum number of attempts for perturbing filter's zeros and poles input raw signal vector Input sampling frequency (Hz) Default Values WS frequency of interest (Hz) 1(Hz) ndft utilized filter's stop-band frequency (Hz) 100 pertnum number of frequency bins 100
	Outputs: Defaults:
		Output Description	Input	Default Values
		PR	Phase Resetting events vector WS 1(Hz)
		PS	Phase Shift events vector ndft	100
		PL	Phase Lock events vector pertnum	100
		PD	Phase Difference vector
	Outputs:	PDV	Phase Difference Variations (first order time derivative) vector
	Phase Features MultiCh.m Output Description Notes: PR Phase Resetting events vector
	Phase Features MultiCh.m Purpose: Calculating popular phase related quantities, i.e. Phase Shift (PS), Phase Lock (PL), Phase Reset (PR), Phase Difference (PD) and Phase Difference Derivatives (PDV) in MULTI-Channel mode. Synopsis (global mode): [PR, PS, PL, PDV, PD] = Phase Features MultiCh(meth, sig1, sig2, fs, f0) PS Phase Shift events vector PL Phase Lock events vector IF Instantaneous Frequency vector Notes: • 3.6 Phase Features SingleCh.m • • While specifying a value to one of the parameters having default values, an empty bracket []
	must be used for non-specified parameters. If you're using the global synopsis, empty bracket Synopsis (local mode): Phase Features SingleCh.m is not required.
	[PR, PS, PL, PDV, PD] = Phase Features MultiCh(meth, sig1, sig2, fs, f0, WS, ndft,
				pertnum)

Purpose:

• The m-file Test Phase Features SingleCh.m is a demo program to operate this function.

•

  In case that you need a single PLV value between signals (and not a pairwise PLV matrix), you can just simply use the non-diagonal values in output matrix.• The m-file Test PLV PhaseSeq.m is a demo program to operate this function.

	Synopsis (local mode):
	PLV = PLV RawSig(meth, sig1, fs, f0, WS, ndft, pertnum, sig2)
	Inputs:
	Input	Description
	meth	character specifying utilized method for phase estimation
	sig1	input raw signal #1 vector
	fs	sampling frequency (Hz)
	f0	frequency of interest (Hz)
	WS	utilized filter's stop-band frequency (Hz)
	ndft	number of frequency bins
	pertnum number of attempts for perturbing filter's zeros and poles
	sig2	input raw signal #2 vector
	Defaults:
		Input	Default Values
		WS	1(Hz)
		ndft	100
		pertnum	100
	Outputs:
		Output Description
		PLV	Pairwise PLV matrix
	Notes:
	3.8 PLV RawSig.m
	PLV RawSig.m
	Synopsis (global mode):
		PLV = PLV RawSig(meth, sig1, fs, f0)

Purpose: Calculating Phase Locking Value (PLV) matrix (Pairwise) using raw signals.

  To have the PLV value, you can just simply use one of the non-diagonal values in output 2 * 2 matrix.• The m-file Test PLV RawSig.m is a demo program to operate this function.Purpose: Generating synthetic EEG signal with spectral characteristics similar to a real EEG, using Autoregressive (AR) model and innovation filter. Could be used in cross-validations with real EEG signal.

	3.9 Synth EEG.m
	Synth EEG.m
	Synopsis (global mode):
		eeg synth = Synth EEG(sig, fs)
	Synopsis (local mode):
	eeg synth = Synth EEG(sig, fs, duration, win, AR ord)
	Inputs:
	Input	Description
	sig	input raw EEG signal vector
	fs	sampling frequency of input signal (Hz)
	duration total required signal duration (Seconds)
	win	temporal window length to have a stationary signal (Seconds)
	AR ord	order of AR model
	Defaults:
	Input	Default Values
	duration	length of input raw EEG signal
	win	3 or 4 or 5 sec (depends on input EEG signal)
	AR ord	20
	Outputs:
		Output	Description
		eeg synth Synthetic EEG signal
	Notes:

Esmaeil Seraj: (esmaeil.seraj09@gmail.com) or Reza Sameni: (reza.sameni@gmail.com)