本文整理汇总了C++中SignalProperties::SamplingRate方法的典型用法代码示例。如果您正苦于以下问题:C++ SignalProperties::SamplingRate方法的具体用法?C++ SignalProperties::SamplingRate怎么用?C++ SignalProperties::SamplingRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SignalProperties
的用法示例。
在下文中一共展示了SignalProperties::SamplingRate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parameter
void
ARThread::OnInitialize( const SignalProperties& Input, const SignalProperties& Output )
{
mMEMPredictor.SetModelOrder( Parameter( "ModelOrder" ) );
mOutputType = Parameter( "OutputType" );
if( mOutputType != Coefficients )
{
mTransferSpectrum.SetFirstBinCenter( Parameter( "FirstBinCenter" ).InHertz() / Input.SamplingRate() );
mTransferSpectrum.SetBinWidth( Parameter( "BinWidth" ).InHertz() / Input.SamplingRate() );
mTransferSpectrum.SetNumBins( Output.Elements() );
mTransferSpectrum.SetEvaluationsPerBin( Parameter( "EvaluationsPerBin" ) );
mSpectrum.resize( Output.Elements() );
}
mInput.resize( Input.Elements() );
}
示例2: std_logic_error
void
FFTFilter::DetermineSignalProperties( SignalProperties& ioProperties, int inFFTType ) const
{
int numChannels = Parameter( "FFTInputChannels" )->NumValues(),
fftWindowLength = static_cast<int>( ioProperties.Elements() * Parameter( "FFTWindowLength" ).InSampleBlocks() );
if( numChannels > 0 && fftWindowLength == 0 )
bcierr << "FFTWindowLength must exceed a single sample's duration" << endl;
double freqRange = ioProperties.SamplingRate() / 2.0;
switch( inFFTType )
{
case eInput:
break;
case ePower:
{
ioProperties.SetName( "FFT Power Spectrum" )
.SetChannels( numChannels )
.SetElements( fftWindowLength / 2 + 1 );
ioProperties.ElementUnit().SetOffset( 0.0 )
.SetGain( freqRange / ( ioProperties.Elements() - 1 ) )
.SetSymbol( "Hz" );
double amplitude = ioProperties.ValueUnit().RawMax() - ioProperties.ValueUnit().RawMin();
ioProperties.ValueUnit().SetRawMin( 0 )
.SetRawMax( amplitude * amplitude );
ioProperties.ElementUnit().SetRawMin( 0 )
.SetRawMax( ioProperties.Elements() - 1 );
} break;
case eHalfcomplex:
ioProperties.SetName( "FFT Coefficients" )
.SetChannels( numChannels )
.SetElements( fftWindowLength );
ioProperties.ElementUnit().SetRawMin( 0 )
.SetRawMax( fftWindowLength - 1 )
.SetOffset( 0 )
.SetGain( 1 )
.SetSymbol( "" );
break;
default:
throw std_logic_error( "Unknown value of FFT type" );
}
}