Welcome Guest, you are in: Login

EventIDE Wiki

RSSRSS

Navigation




Search the wiki


PoweredBy

Page History: Signal Analyzer Element

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2014/12/27 06:21




Element Icon Signal Analyzer Element
Info
Category: Signal Analysis AddIn: Signal Processing
Creator: OkazoLab Team Scope: Parent Event
Owns Snippets: no Usage: Status Screen, Code snippets



Element' actions aligned with epochs of the parent event

EpochActions
After OnsetThe element starts analyzing the selected signal
Control Loop stepLatest signal samples is analyzed within the selected analysis window and the signal plot gets updated.
Before OffsetThe element stops analyzing the selected signal



Properties

Generic Properties

NameProperty DescriptionConstraintsTypeUpon change
Signal Source
Selected SignalDefines the signal for processing by the element. The signals are provided by the data acquisition elements.String
Sampling RateDefines the sampling rate of the original signal, in HzInt32
Analysis Window SizeDefines the size (in samples) of the moving analysis window for signal processing.Int32
Signal NormalizationDefines the normalization procedure that is automatically applied to the signal before the analysisenumerationThe selected procedure is applied on the next analysis cycle
Bandpass Filter
Is FilteringDefines whether the Butterworth bandpass filter is applied in signal plotting. This filter does not affect the signal analysis.Boolean
Filter OrderDefines the order of the Butterworth bandpass filterInt32
Low CutOffDefines the low cutoff of the Butterworth bandpass filter, in HzDouble
High CutOffDefines the high cut-off of the Butterworth bandpass filter, in HzDouble
Runtime Status
Is RunningDefines 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 PlotReturns 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 SamplesReturns 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 TitleDefines the title of the generated signal plotStringThe signal plot is updated
Plot ThemeDefines a visual theme of the generated signal plotenumThe signal plot is updated
Line ThicknessDefines the thickness of the data line on the generated signal plotDoubleThe signal plot is updated
Line ColorDefines the color of the data line on the generated signal plotstColorThe signal plot is updated
Max Y-AxisDefines the range of the Y-axis (power) on the generated signal plot. Zero value denotes the auto-range.DoubleThe signal plot is updated
Rendering SizeDefines 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
MeanReturns the means of the signal values within the analysis windowdouble
MinimumReturns the minimum of the signal values within the analysis windowdouble
MaximumReturns the maximum of the signal values within the analysis windowdouble
Standard DeviationReturns the standard deviations of the signal values within the analysis windowdouble



+=== Properties inherited from clElement === Inherited properties of clElement
NameDescriptionConstraintsValue TypeUpon Change
Control
Is EnabledIf set to false the element is completely omitted when the experiment is run.Boolean
TitleTitle of the element.String




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

Snapshot 1


Practical Use

Preparing the element

  1. Make sure that your experiment contains one of the data acquisition elements, e.g. OpenViBE Signal element
  2. Prepare the data acquisition element such that it is set to collect at least one signal channel.
  3. Add new Signal Analyzer element to the event, where you plan to process the signal (the element operates only within the parent event).
  4. Select the added element to browse its properties in the Property panel.
  5. Define a signal for processing, via the 'Selected Signal' property.
  6. Adjust the 'Sampling Rate' property such that the value matches to a real sampling rate of the selected signal.
  7. Choose the size of the analysis window via the corresponding property.
  8. Select the 'signal normalization' procedure, if required.
  9. 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

  1. Create a proxy variable linked to the 'XAML Signal Plot' property
  2. Check the visual plot settings in the 'Plot Settings' group
  3. Add a content control with data binding to the Status Screen code:
     
    
    <ContentControl Content='{Binding OnlineChart}'/>


Accessing the descriptive statistics of the signal samples

  1. Create proxy variables linked to the 'Mean','Maximum','Minimum' and 'Standard Deviation' properties of the element
  2. 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;
  3. 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

  1. Create a proxy variable linked to the 'Signal Samples' property
  2. Use the Control Loop snippet of the parent event to monitor all signal updates
  3. 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.
  • If you are in time-critical section of your experiment, you can temporally cease the signal processing done of the element by setting the 'Is Running' property to false.

ScrewTurn Wiki version 5.2.0.8. Some of the icons created by FamFamFam.