FloatData (real samples)

  Object FloatData {
     constructor FloatData( string name );

     getSamples( int start, array ); //- where array : a = new Float32Array(size)
     setSamples( int start, array );

     number getLength() ;
     number getSampleRate();
     setSampleRate( number );
     number getDuration() ;
     number mean() ; 
     number std() ; 

     IQData toIQ();
  }

.getLength

  • Returns samples number
.getLength();

.setLength

  • Define samples number
.setLength(num);

.getSampleRate

  • Returns samplerate
.getSampleRate();

.mean

  • Returns mean (average) value for this object
.mean();

.std

.std();

.setSampleRate

  • Define samplerate
.setSampleRate(num);

.getDuration

Provide the duration of object.

:!: You have to define the samplerate '' .setSampleRate(SR_Hz)'' first.

.getDuration();
  • Example:

.getSamples

  • Get samples starting from 'index' position, place the values in the Float32Array passed as argument.
.getSamples(index,Float32Array array);

Example :

var datas = DSP.rmsprofile( a_IQ_block, 1000);
var L = datas.getLength();
// alloc a destination array
var rmsvalues = new Float32Array(L); 
// transfer values from VM Ram to JS
datas.getSamples(0,rmsvalues);
for( var i=0 ; i < L ; i++ ) {
    var x = rmsvalues[i] ;
    ...
}

.setSamples

  • Create samples starting from 'index' offset
.setSamples(index,array);

.toIQ()

  • Returns a IQData object, with the following parameters:
  • sample sample rate,
  • same length,
  • real part = imaginary part
Last update: December 4, 2023