예제 #1
0
파일: Form1.cs 프로젝트: gareththegeek/ndaw
        private void BuildAudioInChain(WaveFormat monoFormat)
        {
            filter = new ComplexFilter(
                monoFormat,
                new BlackmanHarrisWindowFunction(),
                new FirFilter());

            filter.Filters.Add(new DigitalFilter
            {
                FilterFunction = new LowPassFilterFunction(),
                LowerCutOffFrequency = 10000f
            });

            filterNode = new MonoSignalNode(monoFormat, filter.FilterImplementation);

            fourier = new FourierTransform(
                new FastFourierTransformProvider(),
                new BlackmanHarrisWindowFunction(),
                2048);
            fourierNode = new MonoSignalNode(monoFormat, fourier);
            fourier.DataReady += fourierControl.fourier_DataReady;

            flanger = new Flanger(new SineWave());
            flangerNode = new MonoSignalNode(monoFormat, flanger);

            flangerNode.CentreIn.Source = asioInput.Sources.First();
            //flangerNode.CentreIn.Source = waveCard.Inputs.First();
            filterNode.CentreIn.Source = flangerNode.CentreOut;
            fourierNode.CentreIn.Source = filterNode.CentreOut;
            asioOutput.Sinks.ElementAt(0).Source = filterNode.CentreOut;
            asioOutput.Sinks.ElementAt(1).Source = filterNode.CentreOut;
            //waveCard.Outputs.ElementAt(0).Source = filterNode.CentreOut;
            //waveCard.Outputs.ElementAt(1).Source = filterNode.CentreOut;
        }
예제 #2
0
파일: Form1.cs 프로젝트: gareththegeek/ndaw
        private void BuildSineWaveChain(WaveFormat stereoFormat)
        {
            sineWave = new SineWave();
            sineWaveNode = new StereoSignalNode(stereoFormat, sineWave);

            sineWaveNode.LeftIn.Source = asioInput.Sources.ElementAt(0);
            sineWaveNode.RightIn.Source = asioInput.Sources.ElementAt(0);

            filter = new ComplexFilter(
                stereoFormat,
                new BlackmanHarrisWindowFunction(),
                new FirFilter());

            filter.Filters.Add(new DigitalFilter
            {
                FilterFunction = new BandStopFilterFunction(),
                LowerCutOffFrequency = 10000f,
                UpperCutOffFrequency = 12000f
            });

            stereoFilterNode = new StereoSignalNode(stereoFormat, filter.FilterImplementation);

            stereoFilterNode.LeftIn.Source = sineWaveNode.LeftOut;
            stereoFilterNode.RightIn.Source = sineWaveNode.RightOut;

            fourier = new FourierTransform(
                new FastFourierTransformProvider(),
                new BlackmanHarrisWindowFunction(),
                2048);
            fourierNode = new MonoSignalNode(stereoFormat, fourier);
            fourier.DataReady += fourierControl.fourier_DataReady;

            fourierNode.CentreIn.Source = stereoFilterNode.LeftOut;

            asioOutput.Sinks.ElementAt(0).Source = stereoFilterNode.LeftOut;
            asioOutput.Sinks.ElementAt(1).Source = stereoFilterNode.RightOut;
        }