Page History: Signal Analyzer Element
Compare Page Revisions
Page Revision: 2014/12/27 01:19
|
Signal Analyzer Element
|
Info |
Category: |
Signal Analysis |
|
AddIn: |
Signal Processing |
Creator: |
OkazoLab Team |
|
Scope: |
Parent Event |
Owns Snippets: |
no |
|
Usage: |
Status Screen, Code snippets |
BIG
Element' actions aligned with epochs of the parent event
Epoch | Actions |
---|
After Onset | The element starts analyzing the selected signal |
Control Loop step | Latest signal samples is analyzed within the selected analysis window and the signal plot gets updated. |
Before Offset | The element stops analyzing the selected signal |
Properties
Generic Properties
Name | Property Description | Constraints | Type | Upon change |
---|
Signal Source |
Selected Signal | Defines the signal for processing by the element. The signals are provided by the data acquisition elements. | | String |
Sampling Rate | Defines the sampling rate of the original signal, in Hz | | Int32 |
Analysis Window Size | Defines the size (in samples) of the moving analysis window for signal processing. | | Int32 |
Signal Normalization | Defines the normalization procedure that is automatically applied to the signal before the analysis | | enumeration | The selected procedure is applied on the next analysis cycle |
Bandpass Filter |
Is Filtering | Defines whether the Butterworth bandpass filter is applied in signal plotting. This filter does not affect the signal analysis. | | Boolean |
Filter Order | Defines the order of the Butterworth bandpass filter | | Int32 |
Low CutOff | Defines the low cutoff of the Butterworth bandpass filter, in Hz | | Double |
High CutOff | Defines the high cut-off of the Butterworth bandpass filter, in Hz | | Double |
Runtime Status |
Is Running | Defines whether the analysis and plotting is going on in the present. You can use this property to temporally cease the signal processing for a sake of performance. | | Boolean |
XAML Signal Plot | Returns a live XAML signal plot with the signal data. The plot can be used for direct binding to the Content property of the XAML ContentControl element, e.g. The ContentControl with a generated plot can be shown on the status screen or by the XAML Layout element. | | XAML UIElement |
Signal Samples | Returns an double array of the newest signal samples. The array length is equal to the size of the analysis window. The values are updated on every Control Loop cycle of the parent event. The last item in the array corresponds to the most recent signal sample. | | double[] |
Plotting |
Plot Title | Defines the title of the generated signal plot | | String | The signal plot is updated |
Plot Theme | Defines a visual theme of the generated signal plot | | enum | The signal plot is updated |
Line Thickness | Defines the thickness of the data line on the generated signal plot | | Double | The signal plot is updated |
Line Color | Defines the color of the data line on the generated signal plot | | stColor | The signal plot is updated |
Max Y-Axis | Defines the range of the Y-axis (power) on the generated signal plot. Zero value denotes the auto-range. | | Double | The signal plot is updated |
Rendering Size | Defines the size of the generated plot in pixels. The plot is automatically stretched on rendering, but a larger rendering size improves the chart quality with some cost in performance. The rendering size is also used as the resulting image resolution, when the plot is exported into a file. | | clSize |
Signal Statistics |
Mean | Returns the means of the signal values within the analysis window | | double |
Minimum | Returns the minimum of the signal values within the analysis window | | double |
Maximum | Returns the maximum of the signal values within the analysis window | | double |
Standard Deviation | Returns the standard deviations of the signal values within the analysis window | | double |
+=== Properties inherited from clElement ===
Inherited properties of clElement
Name | Description | Constraints | Value Type | Upon Change |
---|
Control |
Is Enabled | If set to false the element is completely omitted when the experiment is run. | | Boolean |
|
Title | Title of the element. | | String |
|
BIG
Test
The element allows to read, analyze and plot a real-time signal that is provided by the signal acquisition elements in EventIDE.
Description
The signal acquisition elements, e.g.
OpenViBE Signal, communicate with hardware and buffer incoming data samples at the background of the experiment. In order to access the buffered data, you can use Signal Analyzer. The element operates on a single signal and allows to read, analyze and plot the signal data. The analysis is performed cyclically in the control loop of the parent event. The analysis is done within the analysis window that embraces the selected number of recent samples. The analysis returns the descriptive statistics of the 'windowed' signal: mean, min, max and standard deviation. Other estimates should be done manually, hence the element allows reading the signal samples as array of double numbers. When signal monitoring is required, the element generates a live plot, which can be placed on the
Status Screen (see the snapshot below).
Snapshots
Snapshot 1
|
Practical Use
Preparing the element
- Make sure that your experiment contains one of the data acquisition elements, e.g. OpenViBE Signal element
- Prepare the data acquisition element such that it is set to collect at least one signal channel.
- Add new Signal Analyzer element to the event, where you plan to process the signal (the element operates only within the parent event).
- Select the added element to browse its properties in the Property panel.
- Define a signal for processing, via the 'Selected Signal' property.
- Adjust the 'Sampling Rate' property such that the value matches to a real sampling rate of the selected signal.
- Choose the size of the analysis window via the corresponding property.
- Select the 'signal normalization' procedure, if required.
- If you want to filter the signal for plotting, turn on the bandpass filtering in the 'Bandpass Filter' group and adjust the filter parameter
Creating the signal plot
- Create a proxy variable linked to the 'XAML Signal Plot' property
- Check the visual plot settings in the 'Plot Settings' group
- Add a content control with data binding to the Status Screen code:
<ContentControl Content='{Binding OnlineChart}'/>
Accessing the descriptive statistics of the signal samples
- Create proxy variables linked to the 'Mean','Maximum','Minimum' and 'Standard Deviation' properties of the element
- If you want to access the statistics in code, use the Control Loop snippet of the parent event to monitor all signal updates:
// Merging the statistics values into a string
string Statistics="Mean="+Mean+"\n Maximum="+Maximum+" \n Minimum="+Minimum+" \n SD="+StandardDeviation;
- If you want to monitor statistics on the status screen at runtime, you can use the XAML textblocks bound to the proxy variables:
<TextBlock Text='{Binding Mean,StringFormat=Signal Mean: {0:F2}}' Foreground='Orange' FontFamily='Calibri' FontSize='16'/>
Reading the signal samples in code
- Create a proxy variable linked to the 'Signal Samples' property
- Use the Control Loop snippet of the parent event to monitor all signal updates
- Create a loop to read all signal samples
// estimate the sum of the signal samples within the analysis window
double Sum=0;
for (int i=0;i,SignalSamples.Length;i++){
Sum=Sum+SignalSamples[i];}
Notes
- The bandpass filtering affects only signal plotting, not the signal analysis.
- You can measure a time of one step of signal processing with the 'Control Loop Interval' property on the parent event. With plotting on and off, the expected time is ~10 and ~5 ms, correspondingly, given that there are no other processes in the parent event and in the experiment.