예제 #1
0
 public RepeatGenerator(int sampleRate, int freqOne, int freqZero, int pauseLen, int[] bits)
 {
     this.silenceGenerator = new SilenceGenerator();
     this.dataGenerator    = new DataGenerator(sampleRate, freqOne, freqZero, true);
     this.samplesPerBit    = sampleRate / 300;
     this.pauseLen         = sampleRate * pauseLen / 1000;
     this.repetitions      = 0;
     this.bits             = bits;
 }
예제 #2
0
 public PrepareForDataGenerator(int sampleRate, int freqOne, int freqZero, bool sendPreamble)
 {
     this.sampleRate = sampleRate;
     this.freqOne    = freqOne;
     this.freqZero   = freqZero;
     if (sendPreamble)
     {
         this.dataGenerator = new DataGenerator(sampleRate, freqOne, freqZero, true);
         this.dataGenerator.EnqueueBits(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
     }
     else
     {
         this.dataGenerator = null;
     }
     this.silenceGenerator = new SilenceGenerator();
     this.pauseLen         = sampleRate * 75 / 1000;
 }