コード例 #1
0
ファイル: FmDetector.cs プロジェクト: yi520520/SDRSharp-1
 public unsafe void Demodulate(Complex *iq, float *audio, int length)
 {
     for (int i = 0; i < length; i++)
     {
         Complex a   = iq[i] * this._iqState.Conjugate();
         float   num = a.Modulus();
         if (num > 0f)
         {
             a /= num;
         }
         float num2 = a.Argument();
         if (!float.IsNaN(num2))
         {
             audio[i] = num2 * 1E-05f;
         }
         else
         {
             audio[i] = 0f;
         }
         this._iqState = iq[i];
     }
     if (this._mode == FmMode.Narrow)
     {
         this.ProcessSquelch(audio, length);
         for (int j = 0; j < length; j++)
         {
             audio[j] *= 0.5f;
         }
     }
 }