Exemplo n.º 1
0
        public void DAQ_TaskFunction()
        {
            float[] data = acquisitionUnit.ReadData(numValuesAtOnce);

            if (data.Length > 0)
            {
                for (int i = 0; i < data.Length; ++i)
                {
                    f[i % numChannels][(i / numChannels)] = f[i % numChannels][(i / numChannels) + (data.Length / numChannels)];                                    //left shift of the values
                    f[i % numChannels][(i / numChannels) + (data.Length / numChannels)]     = f[i % numChannels][(i / numChannels) + (2 * data.Length / numChannels)];
                    f[i % numChannels][(i / numChannels) + (2 * data.Length / numChannels)] = f[i % numChannels][(i / numChannels) + (3 * data.Length / numChannels)];
                    f[i % numChannels][(i / numChannels) + (3 * data.Length / numChannels)] = f[i % numChannels][(i / numChannels) + (4 * data.Length / numChannels)];
                    f[i % numChannels][(i / numChannels) + (4 * data.Length / numChannels)] = data[i];
                }

                FFT_isRunning    = true;
                Filter_isRunning = true; // Make sure there are data to filter before filtering them
            }
            //


            if (t2 > (120 * 1000 / DAQ_hThread_PERIOD))     //refresh the buffer to avoid overflow : introduce artefact every 2minutes, but doesn't really bother the detection
            {
                acquisitionUnit.StopAcquisition();
                acquisitionUnit.StartAcquisition(devices);
                t2 = 0;
            }
            ++t2;
        }
Exemplo n.º 2
0
        public void DAQ_TaskFunction()
        {
            float[] data = acquisitionUnit.ReadData(numValuesAtOnce);

            if (data.Length > 0)
            {
                for (int i = 0; i < data.Length; ++i)
                {
                    //int chan = i % numChannels;
                    f[i % numChannels][(i / numChannels) + x] = data[i];
                }
                x = (data.Length / numChannels) % (numScans * NumSecondsRunning);
            }
        }