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