Welcome Guest, you are in: Login

EventIDE Wiki

RSSRSS

Navigation




Search the wiki


PoweredBy

Summary

Element Icon Signal Analyzer
Info
Category: Signal Processing AddIn: Signal Processing
Creator: OkazoLab Scope: Parent event
Owns Snippets: None Usage: Snippets

Properties

NameDescription                              ConstraintsTypeOn
runtime
change
Signal Source
Selected Signal        Defines the signal for processing by the element. The signals are provided by the data acquisition elements.                Int32         
Sampling Rate        Defines the sampling rate of the original signal, in Hz                Double         
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                enSign..         
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.                UIElem..         
All Samples        Returns all samples in the analysis window as a double array. The array length is equal to the size of the analysis window. The values are updated every Control Loop cycle of the parent event. The last item in the array corresponds to the most recent signal sample.                Double..         
New Samples Count        Returns a number of new samples that were recorded during the last Control Loop cycle                Int32         
Newest Sample        Returns the most recent sample in the analysis window as a double value. The value is updated every Control Loop cycle of the parent event, given that new signal data is recorded.                Double         
Newest Samples        Returns an double array of the newest samples, which were recorded during the last Control Loop cycle. The array is a rightmost segment of the analysis window                Double..         
Add Marker Now        Assign 'true' in snippets at runtime, in order to add a synchronized marker (vertical line) at the zero-time point on the signal plot.                Boolean         
Plotting
Plot Title        Defines the title of the generated signal plot                String         
Plot Theme        Defines a visual theme of the generated signal plot                Int32         
Line Thickness        Defines the thickness of the data line on the generated signal plot                Int32         
Line Color        Defines the color of the data line on the generated signal plot                stColor         
Font Size        Defines the font size for plot labels                Double         
Show Axis Bands        Defines whether the axis bands are shown on the plot area                Boolean         
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         
Sync Marker Color        Defines a color of the custom synchronization markers                stColor         
Sync Marker Width        Defines the width of the custom synchronization markers on the X axis                Double         
Show Threshold Slider                        Boolean         
Threshold Value                        Double         
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         
Control
Is Enabled        If set to false the element is completely omitted when the experiment is run                Boolean         
Title        Title of the element                String         

Signal Analyzer 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 recording 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 a analysis window that embraces the selected number of recent samples. The analysis returns the descriptive statistics over the signal window; mean, min, max and standard deviation. Other statistics can be done manually, hence the element delivers the signal samples as an 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

The status screen showing the signal plot,  statistics and the recent signal samples

The status screen showing the signal plot,
statistics and the recent signal samples


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 parameters.

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 XAML content control with data binding to the Status Screen code:
    
    
    <ContentControl Content='{Binding XAMLSignalPlot}'/>


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

  • Although the size of the analysis window is defined in samples, the signal plot draws the signal over a time taking in the account the sampling rate.
  • The bandpass filtering affects only signal plotting, not the signal analysis.
  • You can measure a time of one cycle 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 by setting the Is Running property to false.
  Name Size
- Analyzer.png 2.90 KB
- Plot-sm.png 33.89 KB
- Plot.png 73.15 KB
- Signal-Analyzer-Element-Icon.png 4.92 KB

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