示例#1
0
 public bool AddFilter(int nFreq, double dGain, double dBandwidth, double dSRate)
 {
     this.LockFilter();
     if (!this.m_lstFilterBank.ContainsKey(nFreq))
     {
         Biquad biquad = new Biquad();
         biquad.RefreshFilter(dGain, (double)nFreq, dSRate, dBandwidth);
         this.m_lstFilterBank.Add(nFreq, biquad);
     }
     this.UnlockFilter();
     return(false);
 }
示例#2
0
 public void ModifyFilter(int nOldFreq, int nNewFreq, double dGain, double dBandwidth, double dSRate)
 {
     this.LockFilter();
     if (nOldFreq == nNewFreq)
     {
         if (this.m_lstFilterBank.ContainsKey(nOldFreq))
         {
             this.m_lstFilterBank[nOldFreq].RefreshFilter(dGain, (double)nNewFreq, dSRate, dBandwidth);
         }
     }
     else if (this.m_lstFilterBank.ContainsKey(nOldFreq) && !this.m_lstFilterBank.ContainsKey(nNewFreq))
     {
         this.m_lstFilterBank.Remove(nOldFreq);
         Biquad biquad = new Biquad();
         biquad.RefreshFilter(dGain, (double)nNewFreq, dSRate, dBandwidth);
         this.m_lstFilterBank.Add(nNewFreq, biquad);
     }
     this.UnlockFilter();
 }