Пример #1
0
 public FilterProcessor()
 {
     FilterType = FilterType.None;
     BPFilter   = new BandPassFilter();
     HPFilter   = new HighPassFilter();
     LPFilter   = new LowPassFilter();
 }
Пример #2
0
 public static BandPassFilter Clone(this BandPassFilter filter)
 {
     return(new BandPassFilter()
     {
         PassbandAttenuationDB = filter.PassbandAttenuationDB,
         StopbandAttenuationDB = filter.StopbandAttenuationDB,
         BPPassbandFreLow = filter.BPPassbandFreLow,
         BPPassbandFreHigh = filter.BPPassbandFreHigh,
         TransitionBandwidth = filter.TransitionBandwidth,
     });
 }
Пример #3
0
 public static double[] Filter(this BandPassFilter filter, double[] input, int samplePoint, double sampleFre, double rpm = 0)
 {
     if (filter.BPPassbandFreHigh + filter.TransitionBandwidth > sampleFre / 2.56)
     {
         throw new Exception(string.Format("带通高阻带频率必须小于等于采样频率的1/2.56({0})", sampleFre / 2.56));
     }
     return(Algorithm.Instance.BandPassFilter(input, samplePoint, sampleFre,
                                              filter.PassbandAttenuationDB,
                                              filter.StopbandAttenuationDB,
                                              filter.BPStopbandFreLow,
                                              filter.BPPassbandFreLow,
                                              filter.BPPassbandFreHigh,
                                              filter.BPStopBandFreHigh));
 }