public void fourier_DataReady(object sender, FourierTransformEventArgs e) { if (abortRendering) return; if (e.Channel != 0) return; lock (fourierDataLock) { fourierLength = e.TransformLength; fourierReal = e.Real; fourierImaginary = e.Imaginary; } format = (sender as FourierTransform).Format; //if (InvokeRequired) //{ // if (stopped) return; // this.Invoke(new Action(() => fourier_DataReady(sender, e))); // return; //} }
private void calculateTransform(ChannelData channel) { for (int i = 0; i < transformLength; i++) { channel.Complex[i] = new Complex { X = channel.InputHistory[i] * window[i], Y = 0f }; } transformProvider.FFT(true, m, channel.Complex); var e = new FourierTransformEventArgs( transformLength, channel.Index, channel.Complex); if (DataReady != null) { DataReady.Invoke(this, e); } }