Logo Search packages:      
Sourcecode: hamfax version File versions  Download package

void FaxModulator::modulate ( double *  buffer,
int  n 
) [slot]

Parameters:
buffer is an array of the length
n and holds the signal to be modulated. After that the signal data is emitted.

Definition at line 44 of file FaxModulator.cpp.

References data().

{
      short sample[number];
      for(size_t i=0; i<static_cast<size_t>(number); i++) {
            if(fm) {
                  int f=static_cast<int>(carrier+2.*(buffer[i]-0.5)*dev);
                  sine.setIncrement(sine.size()*f/sampleRate);
                  sample[i]=sine.nextValue();
            } else {
                  sample[i]=static_cast<short>(sine.nextValue()*buffer[i]);
            }
      }
      emit data(sample,number);
}


Generated by  Doxygen 1.6.0   Back to index