Page History: PSD Analyzer Element
Compare Page Revisions
Page Revision: 2014/12/28 01:38
|
PSD Analysis Element
|
Info |
Category: |
Signal Analysis |
|
AddIn: |
Signal Processing |
Creator: |
OkazoLab Team |
|
Scope: |
Parent Event |
Owns Snippets: |
no |
|
Usage: |
Status Screen, code snippets |
Actions aligned with epochs of the parent event
Epoch | Actions |
---|
After experiment onset | The element ... |
Event rendered |
Before event onset |
After event onset |
Control loop step | The element ... |
Before event offset |
Before experiment offset | The element ... |
Properties
Generic Properties
Name | Property description | Constraints | Type | Upon change |
---|
Settings |
name | description | attributes | type String | |
+=== 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 |
|
The element allows to perform a simple power spectrum (PSD) analysis on 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. If you want to obtain the instant frequency characteristics of a signal, you can use PSD Analyzer. The element operates on a single signal by estimating its power spectrum with the
FFT. The estimation is run cyclically in the control loop of the parent event, within a analysis window that embraces the selected number of recent samples. The results include the descriptive statistics over the signal window: dominant frequency and its power. Other statistics can be done manually, hence the element delivers the FFT output as an array of double numbers. When power spectrum monitoring is required, the element generates a live power/frequency plot, which can be placed on the
Status Screen (see the snapshot below).
Snapshots
Status Screen with the PSD plot, frequency statistics and selected powers |
Practical Use
Preparing the element for analysis
- 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.
- Add new PSD 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 the real sampling rate of the selected signal.
- Choose the size of the analysis window via the corresponding property.
- Select the frequency 'range of interest' the statistics and plotting via Frequency Range property.
- Define the bin size for the frequency dimension in statistics and plotting.
- Choose the Power Normalization procedure (the default is normalization for the total signal maximum).
Creating the signal plot
- Create a proxy variable linked to the XAML PSD Plot property
- Check the plot's visualization settings in the Plot Settings group
- Add a XAML content control with data binding to the Status Screen code:
<ContentControl Content='{Binding OnlineChart}'/>
Reading the FFT results in code
- Create a proxy variable linked to the Frequency Spectrum property
- Use the Control Loop snippet of the parent event to monitor all signal updates
- Create a loop to read all signal samples:
// estimating the spectrum sum
double Sum=0;
for (int i=0;i,FrequencySpectrum.Length;i++)
{
Sum=Sum+FrequencySpectrum[i];
}
Notes
- The dominant frequency and power are searched only inside of the chosen Frequency Range
- The frequency spectrum is returned for the entire analysis window, irrelative to the chosen Frequency Range
- 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.