当前位置: 首页>>代码示例>>C++>>正文


C++ SignalProperties::SetChannels方法代码示例

本文整理汇总了C++中SignalProperties::SetChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ SignalProperties::SetChannels方法的具体用法?C++ SignalProperties::SetChannels怎么用?C++ SignalProperties::SetChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SignalProperties的用法示例。


在下文中一共展示了SignalProperties::SetChannels方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: startRunExpression

void
ExpressionFilter::Preflight( const SignalProperties& Input,
                                   SignalProperties& Output ) const
{
  // Test whether configuration can be loaded.
  LCRandomGenerator rg;
  Expr startRunExpression( rg, Parameter( "StartRunExpression" ) ),
       stopRunExpression( rg, Parameter( "StopRunExpression" ) );
  ExpressionMatrix expressions;
  LoadExpressions( Parameter( "Expressions" ), expressions, rg );
  VariableContainer variables;
  // Request output signal properties:
  Output = Input;
  size_t numRows = expressions.size(),
         numCols = numRows ? expressions[0].size() : 0;
  if( numCols != 0 )
    Output.SetChannels( numRows )
          .SetElements( numCols )
          .ElementUnit().SetGain( 1.0 ).SetOffset( 0.0 ).SetSymbol( "" );
  // Try evaluating expressions.
  startRunExpression.Compile( variables );
  startRunExpression.Evaluate();
  GenericSignal preflightInput( Input ), preflightOutput( Output );
  CompileExpressions( expressions, variables );
  EvaluateExpressions( expressions, &preflightInput, &preflightOutput );
  stopRunExpression.Compile( variables );
  stopRunExpression.Evaluate();
}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:28,代码来源:ExpressionFilter.cpp

示例2: Parameter

void
SpatialFilter::Preflight( const SignalProperties& Input,
                                SignalProperties& Output ) const
{
  // Parameter/Input consistency.
  if( Input.Channels() != Parameter( "SpatialFilter" )->NumColumns() )
    bcierr << "The input signal's number of channels must match "
           << "the number of columns in the SpatialFilter parameter"
           << endl;

  // Output signal description.
  Output = Input;
  Output.SetChannels( 0 ).SetChannels( Parameter( "SpatialFilter" )->NumRows() );
  if( !Parameter( "SpatialFilter" )->RowLabels().IsTrivial() )
    for( int i = 0; i < Parameter( "SpatialFilter" )->NumRows(); ++i )
      Output.ChannelLabels()[ i ] = Parameter( "SpatialFilter" )->RowLabels()[ i ];
}
开发者ID:el-fran,项目名称:weka-bci2000,代码行数:17,代码来源:SpatialFilter.cpp

示例3: State

void
P3TemporalFilter::Preflight( const SignalProperties& Input,
                             SignalProperties& Output ) const
{
    // Required states.
    State( "Running" );
    State( "StimulusCode" );
    State( "StimulusType" );
    OptionalState( "StimulusBegin" );

    float outputSamples = MeasurementUnits::ReadAsTime( Parameter( "EpochLength" ) );
    outputSamples *= Input.Elements();
    outputSamples = ::ceil( outputSamples );
    // Requested output signal properties.
    Output = Input;
    Output.SetChannels( Input.Channels() )
    .SetElements( outputSamples )
    .SetType( SignalType::float32 )
    .ElementUnit().SetRawMin( 0 )
    .SetRawMax( outputSamples - 1 );
}
开发者ID:el-fran,项目名称:weka-bci2000,代码行数:21,代码来源:P3TemporalFilter.cpp

示例4: Parameter

void
P3TemporalFilter::Initialize( const SignalProperties& /*Input*/,
                              const SignalProperties& Output )
{
    mEpochs.clear();
    mEpochSums.clear();

    mOutputProperties = Output;
    mEpochsToAverage = Parameter( "EpochsToAverage" );

    mVisualize = int( Parameter( "VisualizeP3TemporalFiltering" ) );
    if( mVisualize )
    {
        mTargetERPChannel = Parameter( "TargetERPChannel" );
        SignalProperties visProperties = Output;
        visProperties.SetChannels( 12 );
        mVisSignal = GenericSignal( visProperties );

        mVis.Send( CfgID::WindowTitle, "ERP" )
        .Send( mVisSignal.Properties() )
        .Send( mVisSignal );
    }
}
开发者ID:el-fran,项目名称:weka-bci2000,代码行数:23,代码来源:P3TemporalFilter.cpp

示例5: if

void
BufferedADC::Preflight( const SignalProperties&,
                        SignalProperties& Output ) const
{
    if( Parameter( "SourceBufferSize" ).InSampleBlocks() < 2 )
        bcierr << "The SourceBufferSize parameter must be greater or"
               << " equal 2 sample blocks."
               << endl;
    State( "SourceTime" );
    State( "Running" );
    mAcquisitionProperties = Output;
    this->OnPreflight( mAcquisitionProperties );
    Output = mAcquisitionProperties;
    int numStateChannels = 0;
    for( int ch = 0; ch < Output.Channels(); ++ch )
    {
        bool isStateChannel = ( *Output.ChannelLabels()[ch].c_str() == StateMark );
        if( numStateChannels && !isStateChannel )
            bcierr_ << "State channels must be located at the end of the channel list";
        else if( isStateChannel )
            ++numStateChannels;
    }
    Output.SetChannels( Output.Channels() - numStateChannels );
}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:24,代码来源:BufferedADC.cpp


注:本文中的SignalProperties::SetChannels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。