public float[][] CreateLogSpectrogram(
            float[] samples, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
        {
            NormalizeInPlace(samples);
            int width = (samples.Length - configuration.WdftSize) / configuration.Overlap; /*width of the image*/
            float[][] frames = new float[width][];
            float[] complexSignal = new float[2 * configuration.WdftSize]; /*even - Re, odd - Img*/
            double[] window = windowFunction.GetWindow(configuration.WdftSize);
            int[] logFrequenciesIndexes = GenerateLogFrequencies(configuration);
            for (int i = 0; i < width; i++)
            {
                // take 371 ms each 11.6 ms (2048 samples each 64 samples)
                for (int j = 0; j < configuration.WdftSize /*2048*/; j++)
                {
                    complexSignal[(2 * j)] = (float)(window[j] * samples[(i * configuration.Overlap) + j]);
                    /*Weight by Hann Window*/
                    complexSignal[(2 * j) + 1] = 0;
                }

                // FFT transform for gathering the spectrum
                Fourier.FFT(complexSignal, configuration.WdftSize, FourierDirection.Forward);
                frames[i] = ExtractLogBins(complexSignal, logFrequenciesIndexes, configuration.LogBins);
            }

            return frames;
        }
Esempio n. 2
0
    /// <summary>
    /// Draw GUI elements
    /// </summary>
    void OnGUI()
    {
        // set skin object
        GUI.skin = _skin;
        winId    = 1;
        // set toolbar size and position
        rect = new Rect(Screen.width - width, 0, width, Screen.height);
        // display toolbar window
        rect = GUILayout.Window(winId++, rect, ToolbarWindow, Strings.projectTitle + "-" + Strings.projectVersion);

        // display any additional windows
        for (int i = 0; i < additionalWindows.Count; i++)
        {
            IWindowFunction w = additionalWindows[i];
            if (w.windowFunction == null)
            {
                Debug.LogWarning("Null window removed.");
                additionalWindows.Remove(w);
            }
            else
            {
                w.windowRect = GUILayout.Window(winId++, w.windowRect, w.windowFunction, w.windowTitle);
            }
        }
    }
Esempio n. 3
0
        /// <summary>
        /// Applies the given window function to each window. The window function is called for each evaluation of the window for each key individually. The output of the window function is interpreted as a regular non-windowed stream.
        /// Arriving data is incrementally aggregated using the given reducer.
        /// </summary>
        /// <typeparam name="TOutput"></typeparam>
        /// <param name="reduceFunction">The reduce function that is used for incremental aggregation.</param>
        /// <param name="function">The window function.</param>
        /// <param name="resultType">Type information for the result type of the window function.</param>
        /// <returns>The data stream that is the result of applying the window function to the window.</returns>
        public SingleOutputStreamOperator <TOutput> Reduce <TOutput>(
            IReduceFunction <TElement> reduceFunction,
            IWindowFunction <TElement, TOutput, TKey, TWindow> function,
            TypeInformation <TOutput> resultType)
        {
            if (reduceFunction is IRichFunction)
            {
                throw new InvalidOperationException("ReduceFunction of reduce can not be a RichFunction.");
            }

            var env    = _input.ExecutionEnvironment;
            var config = env.ExecutionConfig;

            function       = env.Clean(function);
            reduceFunction = env.Clean(reduceFunction);

            var operatorName = GenerateOperatorName(_assigner, _trigger, _evictor, reduceFunction, function);
            var keySelector  = _input.KeySelector;

            IOneInputStreamOperator <TElement, TOutput> @operator = default;

            if (_evictor != null)
            {
            }
            else
            {
                var stateDesc = new ReducingStateDescriptor <TElement>("window-contents", reduceFunction, _input.Type.CreateSerializer(config));
            }

            return(_input.Transform(operatorName, resultType, @operator));
        }
Esempio n. 4
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();
        }
Esempio n. 5
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();
        }
Esempio n. 6
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);
        }
Esempio n. 7
0
 private static TypeInformation <OUT> getWindowFunctionReturnType <IN, OUT, KEY, TW>(
     IWindowFunction <IN, OUT, KEY, TW> function,
     TypeInformation <IN> inType) where TW : Window
 => TypeExtractor.GetUnaryOperatorReturnType <IN, OUT>(
     function,
     typeof(IWindowFunction <IN, OUT, KEY, TW>),
     0,
     1,
     new int[] { 3, 0 },
     inType,
     null,
     false);
Esempio n. 8
0
        public double[][] CreateSpectrogram(string pathToFilename, IWindowFunction windowFunction, int sampleRate, int overlap, int wdftSize)
        {
            // read 5512 Hz, Mono, PCM, with a specific proxy
            float[] samples = ReadMonoFromFile(pathToFilename, sampleRate, 0, 0);

            NormalizeInPlace(samples);

            int width = (samples.Length - wdftSize) / overlap;             /*width of the image*/

            double[][] frames        = new double[width][];
            double[]   complexSignal = new double[2 * wdftSize];           /*even - Re, odd - Img, thats how Exocortex works*/
            double[]   window        = windowFunction.GetWindow();
            for (int i = 0; i < width; i++)
            {
                // take 371 ms each 11.6 ms (2048 samples each 64 samples)
                for (int j = 0; j < wdftSize; j++)
                {
                    // Weight by Hann Window
                    complexSignal[2 * j] = window[j] * samples[(i * overlap) + j];

                    // need to clear out as fft modifies buffer (phase)
                    complexSignal[(2 * j) + 1] = 0;
                }

                lomonFFT.TableFFT(complexSignal, true);

                // When the input is purely real, its transform is Hermitian,
                // i.e., the component at frequency f_k is the complex conjugate of the component
                // at frequency -f_k, which means that for real inputs there is no information
                // in the negative frequency components that is not already available from the
                // positive frequency components.
                // Thus, n input points produce n/2+1 complex output points.
                // The inverses of this family assumes the same symmetry of its input,
                // and for an output of n points uses n/2+1 input points.

                // Transform output contains, for a transform of size N,
                // N/2+1 complex numbers, i.e. 2*(N/2+1) real numbers
                // our transform is of size N+1, because the histogram has n+1 bins
                double[] band = new double[(wdftSize / 2)];                 // Don't add te last band, i.e. + 1 is removed
                for (int j = 0; j < (wdftSize / 2); j++)                    // Don't add te last band, i.e. + 1 is removed
                {
                    double re  = complexSignal[2 * j];
                    double img = complexSignal[(2 * j) + 1];

                    band[j] = Math.Sqrt(((re * re) + (img * img)) * wdftSize);
                }

                frames[i] = band;
            }

            return(frames);
        }
Esempio n. 9
0
		public double[][] CreateSpectrogram(string pathToFilename, IWindowFunction windowFunction, int sampleRate, int overlap, int wdftSize)
		{
			// read 5512 Hz, Mono, PCM, with a specific proxy
			float[] samples = ReadMonoFromFile(pathToFilename, sampleRate, 0, 0);
			
			NormalizeInPlace(samples);

			int width = (samples.Length - wdftSize) / overlap; /*width of the image*/
			double[][] frames = new double[width][];
			double[] complexSignal = new double[2 * wdftSize]; /*even - Re, odd - Img, thats how Exocortex works*/
			double[] window = windowFunction.GetWindow();
			for (int i = 0; i < width; i++)
			{
				// take 371 ms each 11.6 ms (2048 samples each 64 samples)
				for (int j = 0; j < wdftSize; j++)
				{
					// Weight by Hann Window
					complexSignal[2 * j] = window[j] * samples[(i * overlap) + j];

					// need to clear out as fft modifies buffer (phase)
					complexSignal[(2 * j) + 1] = 0;
				}

				lomonFFT.TableFFT(complexSignal, true);

				// When the input is purely real, its transform is Hermitian,
				// i.e., the component at frequency f_k is the complex conjugate of the component
				// at frequency -f_k, which means that for real inputs there is no information
				// in the negative frequency components that is not already available from the
				// positive frequency components.
				// Thus, n input points produce n/2+1 complex output points.
				// The inverses of this family assumes the same symmetry of its input,
				// and for an output of n points uses n/2+1 input points.
				
				// Transform output contains, for a transform of size N,
				// N/2+1 complex numbers, i.e. 2*(N/2+1) real numbers
				// our transform is of size N+1, because the histogram has n+1 bins
				double[] band = new double[(wdftSize / 2)]; // Don't add te last band, i.e. + 1 is removed
				for (int j = 0; j < (wdftSize / 2); j++)	// Don't add te last band, i.e. + 1 is removed
				{
					double re = complexSignal[2 * j];
					double img = complexSignal[(2 * j) + 1];

					band[j] = Math.Sqrt( ((re * re) + (img * img)) * wdftSize);
				}

				frames[i] = band;
			}

			return frames;
		}
Esempio n. 10
0
        public Fft(int winsize, IWindowFunction window)
        {
            this.winsize = winsize;
            this.fftsize = 2 * winsize;

            fftwData = fftwf_malloc(fftsize * sizeof(float));
            fftwPlan = fftwf_plan_r2r_1d(fftsize, fftwData, fftwData, FFTW_R2HC,
                                         FFTW_ESTIMATE | FFTW_DESTROY_INPUT);

            fft = new float[fftsize];
            window.Initialize(winsize);
            win  = window;
            data = new float[fftsize];

            lomonFFT = new Lomont.LomontFFT();
        }
Esempio n. 11
0
		public Fft(int winsize, IWindowFunction window)
		{
			this.winsize = winsize;
			this.fftsize = 2 * winsize;
			
			fftwData = fftwf_malloc(fftsize * sizeof(float));
			fftwPlan = fftwf_plan_r2r_1d(fftsize, fftwData, fftwData, FFTW_R2HC,
			                             FFTW_ESTIMATE | FFTW_DESTROY_INPUT);

			fft = new float[fftsize];
			window.Initialize(winsize);
			win = window;
			data = new float[fftsize];
			
			lomonFFT = new Lomont.LomontFFT();
		}
Esempio n. 12
0
        public void TestInitialise()
        {
            var ones = new float[100];

            for (int i = 0; i < 100; i++)
            {
                ones[i] = 1f;
            }

            transformProvider = Substitute.For <IFastFourierTransformProvider>();
            windowFunction    = Substitute.For <IWindowFunction>();
            windowFunction.CalculateCoefficients(Arg.Any <int>()).Returns(ones);

            target = new FourierTransform(transformProvider, windowFunction, 1);

            target.Format = new WaveFormat(44100, 1);
        }
Esempio n. 13
0
        public double[][] CreateLogSpectrogram(
            float[] samples, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
        {
            DbgTimer t = new DbgTimer();

            t.Start();

            if (configuration.NormalizeSignal)
            {
                NormalizeInPlace(samples);
            }

            int width = (samples.Length - configuration.WindowSize) / configuration.Overlap;             /*width of the image*/

            double[][] frames = new double[width][];
            int[]      logFrequenciesIndexes = GenerateLogFrequencies(configuration);
            double[]   window = windowFunction.GetWindow();
            for (int i = 0; i < width; i++)
            {
                double[] complexSignal = new double[2 * configuration.WindowSize];                 /*even - Re, odd - Img, thats how Exocortex works*/

                // take 371 ms each 11.6 ms (2048 samples each 64 samples, samplerate 5512)
                // or 256 ms each 16 ms (8192 samples each 512 samples, samplerate 32000)
                for (int j = 0; j < configuration.WindowSize; j++)
                {
                    // Weight by Hann Window
                    complexSignal[2 * j] = window[j] * samples[(i * configuration.Overlap) + j];

                    // need to clear out as fft modifies buffer (phase)
                    complexSignal[(2 * j) + 1] = 0;
                }

                lomonFFT.TableFFT(complexSignal, true);

                frames[i] = ExtractLogBins(complexSignal, logFrequenciesIndexes, configuration.LogBins);
            }

            Dbg.WriteLine("Create Log Spectrogram - Execution Time: {0} ms", t.Stop().TotalMilliseconds);
            return(frames);
        }
Esempio n. 14
0
        public double[][] CreateLogSpectrogram(
			float[] samples, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
        {
            // Explode samples to the range of 16 bit shorts (–32,768 to 32,767)
            // Matlab multiplies with 2^15 (32768)
            // e.g. if( max(abs(speech))<=1 ), speech = speech * 2^15; end;
            //MathUtils.Multiply(ref samples, Analyzer.AUDIO_MULTIPLIER); // 65536

            if (configuration.NormalizeSignal)
            {
                NormalizeInPlace(samples);
            }

            int width = (samples.Length - configuration.WdftSize) / configuration.Overlap; /*width of the image*/
            double[][] frames = new double[width][];
            int[] logFrequenciesIndexes = GenerateLogFrequencies(configuration);
            //double[] window = windowFunction.GetWindow(configuration.WdftSize);
            double[] window = windowFunction.GetWindow();
            for (int i = 0; i < width; i++)
            {
                double[] complexSignal = new double[2 * configuration.WdftSize]; /*even - Re, odd - Img, thats how Exocortex works*/

                // take 371 ms each 11.6 ms (2048 samples each 64 samples)
                for (int j = 0; j < configuration.WdftSize; j++)
                {
                    // Weight by Hann Window
                    complexSignal[2 * j] = window[j] * samples[(i * configuration.Overlap) + j];

                    // need to clear out as fft modifies buffer (phase)
                    complexSignal[(2 * j) + 1] = 0;
                }

                lomonFFT.TableFFT(complexSignal, true);

                frames[i] = ExtractLogBins(complexSignal, logFrequenciesIndexes, configuration.LogBins);
            }

            return frames;
        }
        public float[][] CreateSpectrogram(string pathToFilename, IWindowFunction windowFunction, int sampleRate, int overlap, int wdftSize)
        {
            // read 5512 Hz, Mono, PCM, with a specific proxy
            float[] samples = ReadMonoFromFile(pathToFilename, sampleRate, 0, 0);

            NormalizeInPlace(samples);

            int width = (samples.Length - wdftSize) / overlap; /*width of the image*/
            float[][] frames = new float[width][];
            float[] complexSignal = new float[2 * wdftSize]; /*even - Re, odd - Img*/
            double[] window = windowFunction.GetWindow(wdftSize);
            for (int i = 0; i < width; i++)
            {
                // take 371 ms each 11.6 ms (2048 samples each 64 samples)
                for (int j = 0; j < wdftSize; j++)
                {
                    complexSignal[2 * j] = (float)(window[j] * samples[(i * overlap) + j]);
                    /*Weight by Hann Window*/
                    complexSignal[(2 * j) + 1] = 0;
                }

                Fourier.FFT(complexSignal, wdftSize, FourierDirection.Forward);

                float[] band = new float[(wdftSize / 2) + 1];
                for (int j = 0; j < (wdftSize / 2) + 1; j++)
                {
                    double re = complexSignal[2 * j];
                    double img = complexSignal[(2 * j) + 1];
                    re /= (float)wdftSize / 2;
                    img /= (float)wdftSize / 2;
                    band[j] = (float)Math.Sqrt((re * re) + (img * img));
                }

                frames[i] = band;
            }

            return frames;
        }
Esempio n. 16
0
        public FourierTransform(
            IFastFourierTransformProvider transformProvider, 
            IWindowFunction windowFunction,
            int transformLength)
        {
            if (!IsPowerOfTwo(transformLength))
            {
                throw new ArgumentException("Transform length must be a power of two", "transformLength");
            }
            if (transformProvider == null)
            {
                throw new ArgumentNullException("transformProvider", "Transform provider cannot be null");
            }
            if (windowFunction == null)
            {
                throw new ArgumentNullException("windowFunction", "Window function cannot be null");
            }

            this.transformProvider = transformProvider;
            this.window = windowFunction.CalculateCoefficients(transformLength);
            this.transformLength = transformLength;
            this.m = (int)Math.Log(transformLength, 2d);
        }
Esempio n. 17
0
        public FourierTransform(
            IFastFourierTransformProvider transformProvider,
            IWindowFunction windowFunction,
            int transformLength)
        {
            if (!IsPowerOfTwo(transformLength))
            {
                throw new ArgumentException("Transform length must be a power of two", "transformLength");
            }
            if (transformProvider == null)
            {
                throw new ArgumentNullException("transformProvider", "Transform provider cannot be null");
            }
            if (windowFunction == null)
            {
                throw new ArgumentNullException("windowFunction", "Window function cannot be null");
            }

            this.transformProvider = transformProvider;
            this.window            = windowFunction.CalculateCoefficients(transformLength);
            this.transformLength   = transformLength;
            this.m = (int)Math.Log(transformLength, 2d);
        }
Esempio n. 18
0
		/// <summary>
		/// Instantiate a new Stft Class
		/// </summary>
		/// <param name="winsize">FFT window size</param>
		/// <param name="hopsize">Value to hop on to the next window (50% overlap is when hopsize is half of the window size)</param>
		/// <param name="window">Window function to apply to every window processed</param>
		public Stft(int winsize, int hopsize, IWindowFunction window)
		{
			this.winsize = winsize;
			this.hopsize = hopsize;
			fft = new Fft(winsize, window);
		}
Esempio n. 19
0
 public void SetUp()
 {
     windowFunction = new HanningWindow();
 }
Esempio n. 20
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);
        }
Esempio n. 21
0
        public void TestInitialise()
        {
            var ones = new float[100];
            for (int i = 0; i < 100; i++)
            {
                ones[i] = 1f;
            }

            transformProvider = Substitute.For<IFastFourierTransformProvider>();
            windowFunction = Substitute.For<IWindowFunction>();
            windowFunction.CalculateCoefficients(Arg.Any<int>()).Returns(ones);

            target = new FourierTransform(transformProvider, windowFunction, 1);

            target.Format = new WaveFormat(44100, 1);
        }
Esempio n. 22
0
        /// <summary>
        /// Applies the given window function to each window. The window function is called for each evaluation of the window for each key individually. The output of the window function is interpreted as a regular non-windowed stream.
        /// Arriving data is incrementally aggregated using the given reducer.
        /// </summary>
        /// <typeparam name="TOutput"></typeparam>
        /// <param name="reduceFunction">The reduce function that is used for incremental aggregation.</param>
        /// <param name="function">The window function.</param>
        /// <returns>The data stream that is the result of applying the window function to the window.</returns>
        public SingleOutputStreamOperator <TOutput> Reduce <TOutput>(IReduceFunction <TElement> reduceFunction, IWindowFunction <TElement, TOutput, TKey, TWindow> function)
        {
            var inType     = _input.Type;
            var resultType = getWindowFunctionReturnType(function, inType);

            return(Reduce(reduceFunction, function, resultType));
        }
 public void SetUp()
 {
     windowFunction = new HanningWindow();
 }
Esempio n. 24
0
 /// <summary>
 /// Applies the given window function to each window. The window function is called for each evaluation of the window for each key individually.The output of the window function is interpreted as a regular non-windowed stream.
 /// </summary>
 /// <typeparam name="TAccumulator">The type of the AggregateFunction's accumulator</typeparam>
 /// <typeparam name="TValue">The type of AggregateFunction's result, and the WindowFunction's input</typeparam>
 /// <typeparam name="TResult">The type of the elements in the resulting stream, equal to the WindowFunction's result type</typeparam>
 /// <param name="aggFunction">The aggregate function that is used for incremental aggregation.</param>
 /// <param name="windowFunction">The window function.</param>
 /// <returns>The data stream that is the result of applying the window function to the window.</returns>
 public SingleOutputStreamOperator <TResult> Aggregate <TAccumulator, TValue, TResult>(IAggregateFunction <TElement, TAccumulator, TValue> aggFunction, IWindowFunction <TValue, TResult, TKey, TWindow> windowFunction)
 {
     return(null);
 }
 /// <summary>
 ///   Constructor for spark kernel algorithm object
 /// </summary>
 /// <param name = "minFreq">Minimum frequency</param>
 /// <param name = "maxFreq">Maximum frequency</param>
 /// <param name = "bins">Number of bins per octave</param>
 /// <param name = "frequencyRate">Frequency rate</param>
 /// <param name = "threshold">Threshold value for filtering components</param>
 /// <param name = "function">Window function</param>
 public SparKernel(double minFreq, double maxFreq, int bins, double frequencyRate, double threshold, IWindowFunction function)
 {
     _minFreq = minFreq;
     _maxFreq = maxFreq;
     _bins = bins;
     _frequencyRate = frequencyRate;
     _threshold = threshold;
     _window = function;
     Action action = GenerateSparKernel;
     action.BeginInvoke(action.EndInvoke, action);
 }
Esempio n. 26
0
 public double[][] CreateLogSpectrogram(string pathToFile, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
 {
     float[] samples = ReadMonoFromFile(pathToFile, configuration.SampleRate, 0, 0);
     return(CreateLogSpectrogram(samples, windowFunction, configuration));
 }
 public CachingHanningWindow(IWindowFunction decorated)
 {
     this.decorated = decorated;
     cache = new Dictionary<int, double[]>();
 }
Esempio n. 28
0
 public double[][] CreateLogSpectrogram(string pathToFile, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
 {
     float[] samples = ReadMonoFromFile(pathToFile, configuration.SampleRate, 0, 0);
     return CreateLogSpectrogram(samples, windowFunction, configuration);
 }
Esempio n. 29
0
		public double[][] CreateLogSpectrogram(
			float[] samples, IWindowFunction windowFunction, AudioServiceConfiguration configuration)
		{
			DbgTimer t = new DbgTimer();
			t.Start ();

			if (configuration.NormalizeSignal)
			{
				NormalizeInPlace(samples);
			}

			int width = (samples.Length - configuration.WindowSize) / configuration.Overlap; /*width of the image*/
			double[][] frames = new double[width][];
			int[] logFrequenciesIndexes = GenerateLogFrequencies(configuration);
			double[] window = windowFunction.GetWindow();
			for (int i = 0; i < width; i++)
			{
				double[] complexSignal = new double[2 * configuration.WindowSize]; /*even - Re, odd - Img, thats how Exocortex works*/

				// take 371 ms each 11.6 ms (2048 samples each 64 samples, samplerate 5512)
				// or 256 ms each 16 ms (8192 samples each 512 samples, samplerate 32000)
				for (int j = 0; j < configuration.WindowSize; j++)
				{
					// Weight by Hann Window
					complexSignal[2 * j] = window[j] * samples[(i * configuration.Overlap) + j];
					
					// need to clear out as fft modifies buffer (phase)
					complexSignal[(2 * j) + 1] = 0;
				}
				
				lomonFFT.TableFFT(complexSignal, true);
				
				frames[i] = ExtractLogBins(complexSignal, logFrequenciesIndexes, configuration.LogBins);
			}
			
			Dbg.WriteLine ("Create Log Spectrogram - Execution Time: {0} ms", t.Stop().TotalMilliseconds);
			return frames;
		}
Esempio n. 30
0
 /// <summary>
 /// Instantiate a new Stft Class
 /// </summary>
 /// <param name="winsize">FFT window size</param>
 /// <param name="hopsize">Value to hop on to the next window (50% overlap is when hopsize is half of the window size)</param>
 /// <param name="window">Window function to apply to every window processed</param>
 public Stft(int winsize, int hopsize, IWindowFunction window)
 {
     this.winsize = winsize;
     this.hopsize = hopsize;
     fft          = new Fft(winsize, window);
 }