# Reconstruct Phase Space

Reconstruct phase space of a uniformly sampled signal in the Live Editor

## Description

The **Reconstruct Phase Space** task lets you
interactively reconstruct phase space of a uniformly sampled signal. The task automatically
generates MATLAB^{®} code for your live script. For more information about Live Editor tasks
generally, see Add Interactive Tasks to a Live Script.

Phase space reconstruction is useful to verify the system order and reconstruct all
dynamic system variables, while preserving system properties. Reconstructing the phase space
is performed when limited data is available, or when the phase space dimension and lag values
are unknown. Also, the nonlinear features `approximateEntropy`

, `correlationDimension`

, and `lyapunovExponent`

use phase space reconstruction as the first step of the
computation. For more information about phase space reconstruction, see `phaseSpaceReconstruction`

.

## Open the Task

To add the **Reconstruct Phase Space** task to a live script
in the MATLAB Editor:

On the

**Live Editor**tab, select**Task**>**Reconstruct Phase Space**.In a code block in your script, type a relevant keyword, such as

`phase`

or`phase space`

. Select`Reconstruct Phase Space`

from the suggested command completions.

## Examples

### Related Examples

## Parameters

**Select Signal**

`Signal`

— Uniformly sampled time-domain signal

array | timetable

Select a uniformly sampled time-domain signal in array or timetable format.

**Specify Phase Space Parameters**

`Time Lag`

— Check to use Average Mutual Information (AMI) algorithm to compute time lag

on (default) | off

Check to use Average Mutual Information (AMI) algorithm to compute time lag. Clear
to try your own value of **Maximum Lag** and
**Histogram Bins**. If the time delay is too small, random
noise is introduced in the states. In contrast, if the lag is too large, the
reconstructed dynamics do not represent the true dynamics of the time series.

`Maximum Lag`

— Maximum value of lags used in the lag estimation

positive scalar

Maximum value of lag used to estimate the time delay using the Average Mutual Information (AMI) algorithm.

`Histogram Bins`

— Number of bins for discretization when computing the average mutual information

positive scalar

Number of bins for discretization to compute lag using the AMI algorithm. Set the
value of **Histogram Bins** based on the length of your
signal.

`Embedding Dimension`

— Check to use Percent False Neighbors (PFN) algorithm to compute embedding dimension

on (default) | off

Check to use Percent False Neighbors (PFN) algorithm to automatically compute embedding dimension.

`Maximum Dimension`

— Maximum value of embedding dimension used in the dimension estimation

positive scalar

Maximum value of embedding dimension used in the dimension estimation with Percent False Neighbors (PFN) algorithm.

`Distance Threshold`

— Distance ratio threshold for determining two points as false neighbors

scalar

Distance ratio threshold for determining two points as false neighbors using Percent
False Neighbors (PFN) algorithm. For more information, see `phaseSpaceReconstruction`

.

`Percent False Neighbors`

— Percent false neighbors threshold for detecting embedding dimension

scalar

Percent false neighbors threshold for detecting embedding dimension using PFN
algorithm. To specify percent false neighbors, check the **Embedding
Dimension** check box. For more information, see `phaseSpaceReconstruction`

.

**Visualize Results**

`Output Plot`

— Number of output plots to display

`Individual`

(default) | `All`

| `None`

Number of output plots to display. To toggle between the reconstructed plot and the
histogram plot, and to go through each plot, select
`Individual`

. To display both plots in the Live Editor,
select `All`

. To hide plots, select
`None`

.

## Version History

**Introduced in R2019b**