示例#1
0
        public ComplexFilter(
            WaveFormat format, 
            IWindowFunction windowFunction, 
            IFilterImplementation filterImplementation)
        {
            if (format == null)
            {
                throw new ArgumentNullException("format", "Format cannot be null");
            }

            if (windowFunction == null)
            {
                throw new ArgumentNullException("windowFunction", "Window function cannot be null");
            }

            if (filterImplementation == null)
            {
                throw new ArgumentNullException("filterImplementation", "Filter implementation cannot be null");
            }

            this.format = format;
            this.filterOrder = 20;
            this.windowFunction = windowFunction;
            this.FilterImplementation = filterImplementation;

            this.filters = new ObservableCollection<IDigitalFilter>();
            this.filters.CollectionChanged += filters_CollectionChanged;

            updateCoefficients();
        }
示例#2
0
        public ComplexFilter(
            WaveFormat format,
            IWindowFunction windowFunction,
            IFilterImplementation filterImplementation)
        {
            if (format == null)
            {
                throw new ArgumentNullException("format", "Format cannot be null");
            }

            if (windowFunction == null)
            {
                throw new ArgumentNullException("windowFunction", "Window function cannot be null");
            }

            if (filterImplementation == null)
            {
                throw new ArgumentNullException("filterImplementation", "Filter implementation cannot be null");
            }

            this.format               = format;
            this.filterOrder          = 20;
            this.windowFunction       = windowFunction;
            this.FilterImplementation = filterImplementation;

            this.filters = new ObservableCollection <IDigitalFilter>();
            this.filters.CollectionChanged += filters_CollectionChanged;

            updateCoefficients();
        }
示例#3
0
        public void TestInitialise()
        {
            format         = new WaveFormat(44100, 2);
            windowFunction = Substitute.For <IWindowFunction>();
            implementation = Substitute.For <IFilterImplementation>();

            windowFunction
            .CalculateCoefficients(Arg.Any <int>())
            .Returns(new float[21]);

            target = new ComplexFilter(format, windowFunction, implementation);
        }
示例#4
0
        public void TestInitialise()
        {
            format = new WaveFormat(44100, 2);
            windowFunction = Substitute.For<IWindowFunction>();
            implementation = Substitute.For<IFilterImplementation>();

            windowFunction
                .CalculateCoefficients(Arg.Any<int>())
                .Returns(new float[21]);

            target = new ComplexFilter(format, windowFunction, implementation);
        }