Esempio n. 1
0
 //--Public Methods
 public SincLowPass(int channels, int size, double cornerfrequency)
 {
     this.channels = channels;
     if (size % 2 != 0)
     {
         size++;
     }
     this.buffersize = size;
     double[] filter1 = new double[size];
     filter = new float[size];
     buffer = new float[channels, size];
     for (int x = 0; x < size; x++)
     {
         filter1[x] = SincLowPass.ApplyBlackmanWindow(SincLowPass.Sinc(cornerfrequency, size, x), size, x);
     }
     SincLowPass.Normalize(filter1);
     for (int x = 0; x < filter1.Length; x++)
     {
         filter[x] = (float)filter1[x];
     }
 }
Esempio n. 2
0
 //--Public Methods
 public SincFilter(StreamSynthesizer synth, int filtersize, double cornerfreq)
     : base()
 {
     sfilter = new SincLowPass(synth.Channels, filtersize, cornerfreq);
 }