private void DoMagnitude() { int blocksize = s.DSPBlockSize; for (int i = 0; i < blocksize; i++) { float magn = d.GetMagnitude(i); pll_internal_state.dc = 0.999f * pll_internal_state.dc + 0.001f * magn; pll_internal_state.smooth = 0.70f * pll_internal_state.smooth + 0.30f * (magn - pll_internal_state.dc); d.cpx[i].real = pll_internal_state.smooth; d.cpx[i].imaginary = pll_internal_state.smooth; } }
public void Process() { for (int i = 0; i < s.DSPBlockSize; i++) { float magnitude = d.GetMagnitude(i); this.delay_line[this.sigindex] = d.cpx[i]; this.average_magnitude = 0.999F * (this.average_magnitude) + 0.001F * magnitude; if ((this.hangtime == 0) && (magnitude > (this.BlockNBThreshold * this.average_magnitude))) { this.hangtime = 7; } if (this.hangtime > 0) { d.cpx[i].real = 0.0f; d.cpx[i].imag = 0.0f; this.hangtime--; } else { d.cpx[i] = this.delay_line[this.delayindex]; } this.sigindex = (this.sigindex + 7) & 7; this.delayindex = (this.delayindex + 7) & 7; } }
public void Process() { for (int i = 0; i < s.DSPBlockSize; i++) { float magnitude = d.GetMagnitude(i); this.average_signal_real = (this.average_signal_real * 0.75f) + (d.cpx[i].real * 0.25f); this.average_signal_imag = (this.average_signal_imag * 0.75f) + (d.cpx[i].imaginary * 0.25f); this.average_magnitude = 0.999f * (this.average_magnitude) + 0.001f * magnitude; if (magnitude > (this.AveNBThreshold * this.average_magnitude)) { d.cpx[i].real = this.average_signal_real; d.cpx[i].imaginary = this.average_signal_imag; } } }