Welcome
Guest
, you are in:
<root>
Elements
•
Login
EventIDE Wiki
Navigation
¶
Main Page
Random Page
Create a new Page
All Pages
Categories
Navigation Paths
Administration
File Management
Create Account
Search the wiki
Back
PSD Analyzer Element
Modified on 2018/08/03 22:07
by
Administrator
Categorized as
Elements
,
Signal Processing
<div style="margin-right: 10px; margin-left: 16px; margin-bottom:10px; float: right; width: 500px; overflow: hidden; height: auto; padding: 0px; background: #fafafa; background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));background: -moz-linear-gradient(top, #fbfbfb, #fafafa);border: 1px dashed #ddd;box-shadow: 0 0 0 3px #fff, 0 0 0 5px #ddd, 0 0 0 10px #fff, 0 0 2px 10px #eee;"> == Summary == {s:Element Info Panel | title=PSD Analyzer | category=Signal Processing | icon=[image|Element Icon|{UP(PSD-Analyzer-Element)}PSD-Analyzer-Element-Icon.png] | author= OkazoLab | addin= Signal Processing | scope= Parent event | usage= Snippets | ownsnippets= None } == Properties == {| |- ! Name ! Description ! Constraints ! Type ! On<br/>runtime<br/>change |- | colspan="5" bgcolor="#AADDDDD" | Signal Source |- | Selected Signal | Defines the signal for processing by the element. The signals are provided by the data acquisition elements. | {s:atDesign} | Int32 | |- | Sampling Rate | Defines the sampling rate of the original signal, in Hz | {s:atDesign} | Double | |- | colspan="5" bgcolor="#AADDDDD" | FFT Settings |- | Analysis Window Size | Defines the size (in samples) of the moving window for processing in this element. | {s:atDesign} | Int32 | |- | Range Of Interest | Defines the 'range of interest' across all signal frequencies for analysis, such that the dominant frequency is searched within the range only. The range also restrains X-bounds on the generated plot. | {s:atDesign} | clRange | |- | Bin Size | Defines the bin size for the frequency dimension in statistics and plotting | {s:atDesign} | Double | |- | Power Normalization | Defines the normalization procedure applied to for estimated power values | {s:atNormal} | enPowe.. | |- | Fourier Options | Defines the computation options for the FFT | {s:atNormal} | Fourie.. | |- | colspan="5" bgcolor="#AADDDDD" | Runtime Status |- | Is Running | Defines whether online processing and plotting is going on. You can turn off them at any runtime moment for a sake of performance. | {s:atNormal} | Boolean | |- | Dominant ROI Frequency | Returns the dominant FFT frequency in the signal power spectrum within the range of interest, in Hz | {s:atStatus} | Double | |- | Dominant ROI Power | Returns the power of the dominant FFT frequency in the signal power spectrum within the range of interest, in Hz | {s:atStatus} | Double | |- | Dominant Binned Power | Returns the power of the dominant binned frequency in the signal power spectrum within the range of interest, in Hz | {s:atStatus} | Double | |- | ROI Bin Powers | Returns a double array containing freq. powers (grouped in bins) from the range of interest | {s:atStatus} | Double.. | |- | XAML PSD Plot | Returns a live XAML control that can be used for direct binding to the Content property of the XAML ContentControl element, e.g. <ContentControl Content='{Binding OnlineChart}'/> ContentControl with a generated staircase plot can be added to the status screen or to the XAML Layout element. | {s:atNormal} | UIElem.. | |- | Frequency Spectrum | Returns an double array of the instant frequency spectrum estimated by FFT. The length of the array is equal to the size of the analysis window. The spectrum is updated every Control Loop cycle of the parent event, if new signal samples are available. | {s:atNormal} | Double.. | |- | colspan="5" bgcolor="#AADDDDD" | Plotting |- | PSD Plot Type | Defines the type of the PSD plot. The heatmap plot can be slower in rendering but it allows a signal overview over time | {s:atDesign} | enPSDP.. | |- | Plot Title | Defines the title of the generated plot | {s:atNormal} | String | |- | Plot Theme | Defines a visual theme of the generated plot | {s:atNormal} | Int32 | |- | Bar Color | Defines the color of power bars on the generated plot | {s:atNormal} | stColor | |- | Bar Width | Defines the relative width of the bars on on the generated plot. | {s:atNormal} | Int32 | |- | 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 chart is saved into a file. | {s:atDesign} | clSize | |- | Font Size | Defines the font size for plot labels | {s:atNormal} | Double | |- | Show Axis Bands | Defines whether the axis bands are shown on the plot area | {s:atNormal} | Boolean | |- | colspan="5" bgcolor="#AADDDDD" | Control |- | Is Enabled | If set to false the element is completely omitted when the experiment is run | {s:atDesign} | Boolean | |- | Title | Title of the element | {s:atDesign} | String | |- |} == == </div> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> <!--*****************************************************************************************************************************************************************************--> '''PSD Analyzer Element''' performs real-time the power spectrum density (PSD) analysis of an arbitrary signal.<br><br> {TOC} == Description == The [c:signal acquisition] elements, e.g. [OpenViBE-Signal-Element|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 [http://en.wikipedia.org/wiki/Fast_Fourier_transform|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 a subset of 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 == {| | [imageleft|Status Screen with the PSD plot, frequency statistics <br/> and selected powers |{UP(PSD-Analyzer-Element)}PSDPlot-sm.png|{UP(PSD-Analyzer-Element)}PSDPlot.png] |} == 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 '''Range Of Interest''' for statistics and plotting. # 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: @@ xml <ContentControl Content='{Binding XAMLPSDPlot}'/> @@ === 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: @@ csharp // estimating the spectrum sum double Sum=0; for (int i=0;i,FrequencySpectrum.Length;i++) { Sum=Sum+FrequencySpectrum[i]; } @@ == Notes == * The '''Frequency Spectrum''' values are raw, so you may need to make a conversion to Hz based on the size of analysis window and sampling rate. In contrast, element's statistics and plot automatically scale the FFT results to Hz. * The dominant frequency and power are searched only inside of the chosen range of interest. * The frequency spectrum is returned for the entire analysis window, irrelative to the chosen range of interest. * 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 for a 1000 sample window 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.
Meta Keywords:
Meta Description:
Change Comment:
ScrewTurn Wiki
version 5.2.0.8. Some of the icons created by
FamFamFam
.