Statistics on the fly

I have 200 + channels to settle permanently, at a rate of 10 Hz.

The client requires an AVERAGE value of each channel, between a START time and a STOP time, perhaps several minutes apart.

What I do is put a COUNT to 0 and clear a buffer [] SUM of 200-chan at the START time.

For each sample, if the average is now underway, I add the [current] sample to buffer [] SUM and increment the counter.

Some time after the STOP time, the average is required.

If I take the MONEY [] divide by N, and it is the average of 200 channels.

The only memory required is 200 channels, regardless of duration.  I have to keep the sample of breads.

Which works very well.

The customer now wants to add MIN, MAX, StdDev, and Variance to the list of the necessary statistics.

MIN and MAX are easy: I just compared each [example] MAX [] matrices and an existing MIN [] and keep the young and old.

But the definition of the variance is SUM (Xi - mean) ^ 2 / N.   (StdDev is the square root of that).

That does not mean that I have all only one sample in hand when it's time to calculate it?

I can't treat starters - medium until I know what the AVERAGE, but I don't know that until the end...

A way to avoid storing each unique sample?

Here is another algorithm for the mean and the variance that does not retain the history of any sample.  This is the algorithm of Knuth (from Welford) of https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.

-Jim

Tags: NI Software

Similar Questions

  • In the latest versions of FireFox, there's a display option which allowed a change in the size of the fonts and objects on the screen temporarily on the fly. This seems to be missing from version 6.

    In the latest versions of FireFox, there's a display option which allowed a change in the size of the fonts and objects on the screen temporarily on the fly. This seems to be missing from version 6. It was very useful and should be added to version 6.

    https://support.Mozilla.com/en-us/KB/how-do-i-customize-toolbars

    If you mean the - and + Zoom control so it is always there in Firefox 6.0

    or
    View-> Zoom

    Edit: I see that you are using Windows 7 where the menu bar is hidden as a Firefox orange button by default. Some menus objects much may not be visible in the menu of the Firefox button. Show the Menu bar or use the - and + Zoom controls buttons.

  • Punch on the fly do not work since 10.2.1

    Since the logic 10.2.1. Punch (el Cap 10.11.3) old good on the fly recoding (overlap - replace) Don t work more. Punch in an existing part is cutting one behind the PunchOut! Although the audio is not lost and it is possible to reach the part carried out by hand, but not really an acceptable workflow! Does anyone have the same problem?

    Can't replace my point of view using Autopunch

  • Header does not get changed when on the fly optione activated.

    I tired to change the header of the report using a reminder & it was working fine when I generate the report by keeping the option "on the fly report' disabled. When I try to execute the same sequence with "on the fly report option" on I do not see header information that I could see when "on the fly" option is disabled. I did find the cause and found the following link http://digital.ni.com/public.nsf/allkb/05F43468942BE32E86256D980074E200 but it did not work very well. I was not able to understand the reason of not revealing the header information when "on the fly" option is enabled.

    kpraveen,

    I looked at the files attached to this knowledge base and saw that they were modified versions of files delivered with TestStand 3.0.  Because we have made some changes to these files from this version, there is no guarantee that they will work with the latest version of TestStand.

    If you need this behavior in a newer version, you can change yourself the sequence reportgen_ files.  You will need create sequences modifyheader and modifyfooter in the sequence thost files, then call these the result of OTF process sequence sequences.  We are currently working on a set of more detailed guidelines, and I'll post here when they are available.

  • on the fly of statement

    Hello

    I have a question about using the option 'on the fly' and ' "retain the memory and displays most recent result" "option. As I undertood the support of NEITHER and Teststand documentation, the option 'on the fly' allow you to present your results during the execution of your test. It also allows the RAM used remain constant because after each step, the ResultList should be released.

    So. It is the theory. In practice, I increased my RAM used regardless of the settings I use. Because I use tests which are conducted for several days, the collection of results makes the RAM increases so much that Teststand cling or works really very slowly, if it is not crashing...

    I did a few tests (see attachment). By setting different options, I run my test why SequencialModel for 1 minute and measure the RAM before and after execution. (the first time just before I have that on the "OK" button of the dialog information of the object to be measured, the second time just after I put an end to the hand in the execution of the test). Between each test, I restart Teststand. I measure the RAM using Windows Task Manager.

    My PC is a Win XP SP2 and I use Teststand 4.1.1 (but the problem still exists Teststand 3.5...)

    Test 1:

    'on the fly of statement' option NOT selected

    the "keep memory and only the last results display" option is NOT selected

    Report type is ASCII and all results must be reported

    Task Manager:

    Used RAM at the beginning: 651 MB

    Used RAM after a minut: 716 MB (+ 65 MB!)

    #Results: 31420

    ==> + 2, 12 MB/result

    Test 2:

    'on the fly of statement' option selected

    the "keep memory and only the last results display" option is NOT selected

    Report type is ASCII and all results must be reported

    Used RAM at the beginning: 646 MB

    Used RAM after a minut: 681 MB (+ 35 MB!)

    #Results: 4969

    ==> + 7, 21Mo/result

    Test 3:

    'on the fly of statement' option selected

    the "keep the memory and display only the most recent results" option selected

    Report type is ASCII and all results must be reported

    Used RAM at the beginning: 662 MB

    Used RAM after a minut: 681 MB (+ 19 MB!)

    #Results: 4969

    ==> + 3, 24MO/result

    Conclusion:

    Selected by the "on the fly report" with or without the option "Maintain the memory and display only the most recent results", the RAM used by each result is greater than if you do not select the option "on the fly report." Also probably Teststand generates the report at run time, but independent more important on the parameters of the RAM option is ALWAYS increasing.

    So is this a bug or is this a feature?

    Does anyone have experience with the "on the fly report?

    Bye,.

    Risotto

    Hi Norbert,.

    Thanks, thanks and thanks again! It was the solution!

    If you set "on the fly report" + "keep memory and only display last results" AND activate 'Throw results or disable results when not required by model' then the behavior of the RAM used is as you explained: it begins to increase, but after some time remain constant.

    With her so I have a solution, very well!

    Only comments in support OR in general this option seems to be implemented in Teststand for several years (Teststand 2.0 can be?) and I spent weeks already on the search for a solution to this problem of memory. OK, maybe I was really long to understand how do, but on the other side I spend so much time reading of the documentation, speaking with the support of NOR and the support OR so past time send me examples and documentation. I think for a question like how to manage reports and the memory of test which are lasting several days, support should be able to give me an answer and it must be clear in the documentation how to make the adjustment.

    In any case, I'm happy you could have help me. Thank you once again!

    Risotto

  • 4462 PCI gain is editable on the fly in VB 2005 express?

    Hello

    My current setup of chanil comes from shape:
    myTask.AIChannels.CreateVoltageChannel (physicalChannelComboBox.Text, "", _)
    AITerminalConfiguration.Differential, Convert.ToDouble (minimumValueNumeric.Value) _
    Convert.ToDouble (maximumValueNumeric.Value), AIVoltageUnits.Volts)

    Where 'physicalChannelComboBox.Text' = ' Dev1 / AI0:3.

    This creats all channels at the same time, but I need to have different voltages, Min and Max.

    This is a MAX 4462 configuration.

    I'm doing this configuration in VB

    MajorVersion, MinorVersion DAQmx]

            8       6       [DAQmxChannel]          AI.Coupling     AI.Max  AI.MeasType     AI.Min  AI.TermCfg      I.Voltage.Units ChanType        PhysicalChanName        PPI2/PrimaryVolts       DC              42      Voltage -42             Differential    Volts            Analog         Input   Dev1/ai0        PPI2/PrimaryCurrent     DC              0.316   Voltage -0.316          Differential    Volts            Analog         Input   Dev1/ai1        PPI2/SecondaryVolts     DC              31.6    Voltage -31.6           Differential    Volts            Analog         Input   Dev1/ai2        PPI2/SecondaryCurrent   DC              0.316   Voltage -0.316          Differential    Volts            Analog         Input   Dev1/ai3        [DAQmxTask]     Channels        SampClk.ActiveEdge      SampClk.Rate    SampClk.Src                     SampQuant.SampMode      SampQuant.SampPerChan   SampTimingType                                  Rising                  195000          Continuous Samples      2000                            ""                              Sample Clock    PPI2    PPI2/PrimaryVolts, PPI2/PrimaryCurrent, PPI2/SecondaryVolts, PPI2/SecondaryCurrent[DAQmxDevice]   BusType DevSerialNum    PCI.BusNum      PCI.DevNum      ProductNum      ProductType     Dev1                    PCI             0x127B518               0x5             0x6             0x7170  PCI-4462
    

    I wish I could watch the values of data in time and change the gain/rainge of each channel while he was still recording data. How can I change the gain on the fly.

    Thank you.
    John

    Yes, it will work.
    Remember that you cannot change AI Min and Max during execution of the task.
    Well well... unless you will not see a difference when running

    Gavin Goodrich
    Software engineer
    National Instruments

  • Is it possible to filter design on FPGA reconfigurable on the fly?

    Hello world

    I wonder if it is possible to design multi-channel filters on the FPGA reconfigurable on the fly? For example, it is possible to have X bandpass filters in an iteration, and Bandpass Filters Y with different specifications in the iteration following without having to recompile the FPGA code? Is there a simple way to achieve such a purpose?

    I have built such flexibility in the OTR (where each iteration has different filter settings) but hope to implement on the FPGA so.

    If someone could provide ideas as to whether or not such a conception is possible, it would be greatly appreciated.

    Thank you in advance for your help!

    Steven

    Hi Steven,

    How do you try to generate the FPGA code for this filter, you are using the IP generator?

    If so, this knowledge base article describes fixing the coefficients for multichannel to change on the fly filters.  There is also a nice example in there also.

    Also, if you use this IP generator, this help document describes the more Options box that has the ability to change the coefficients to be 'rechargeable' so that you can change these on the fly it too.

  • DAQ trigger on-the-fly reconfiguration

    Hello

    What is the correct way to reconfigure a data acquisition on the fly?

    Every 100 s I'm doing a 2000 point 4-channel triggered acquisition (sampling rate 50000)

    As a function of household, that I also want to monitor the voltage of one of the channels so that every 2 s, I do a single-point acquisition no trigger.

    Since I don't have access to a piece of the DAQ hardware, that I have to share channels between the two tasks of reconfiguration on the fly.

    (the program is too big / complex to post sorry)

    Initialize channels and relaxation (happens once at the beginning of the program):

    Get data every 100 s:

    Each 2 s get one sample of multichannel without triggering then restore the trigger:

    Please could someone explain when I have to use the 'task to start', 'stop task' and 'commit' aid is rather vague and unfortunately I find myself 'hacking' until it works, which is not the way I like to work! I use a USB-6211.

    The above program works OK, but has an intermittent (approx. every 10mins) error on the 'shutdown task"before returning to the trigger. (memory, the description was 'Task not over data acquisition')

    Thank you

    Al

    Al1234 wrote:
    ... Then this job is stopped and the original task is reconfigured...

    Al

    Simply set up once and just start and stop the job.

    I'm a guy sorta visual images will help us to help you.

    Ben

  • PXI-5421 generating an arbitrary signals on the fly

    I have a card PXI-5421. I need to generate an arbitrary waveform with different frequencies. I need to have a trigger to switch between Forms of waves of different frequencies. I use the script to do this. I'm not able to update the frequency of the next wave on the fly without stopping the program. In other words, can I download signals in real time? The code is attached.

    Hey Kakrott,

    You should be able to achieve this with your PXI-5421. The example of 'switch between the waveforms FGEN"in the examples of LabVIEW makes something similar to what you're trying to do. As explained in the documentation: "this example shows how to switch between two different wave forms while generating, using updated data every time." This example uses a trigger to change what waveform is generated.

  • Injection containers QML on the fly?

    Hello, I'm quite new to the Blackberry development, so far, I can say that I love it. I'm working on an application that requires me to be able to change the QML that is inside a container on the fly. For example:

            // MAIN CONTAINER PLACEHOLDER
            Container {
                id: mainContainer
                // Any way to inject fully built qml files right here, and swap them out on the fly?
            }
    

    I have a menu on the left in the form of a ListView when you press a button at the top left, the current view moves to the right and allows you to use the navigation. When you select a new navigation item, I want to replace what is in the "key container" with the QML file that is appropriate for what the user has selected.

    Thanks in advance for any help!

    You're better off using a delegate control for your particular problem.

    Take a look at the example of Cookbook qml stunts to see how it is easy to do.

    http://developer.BlackBerry.com/Cascades/sampleapps/

  • Tables on the fly in the ATG

    Hello

    I want to know if you can edit or create tables on the fly on GTA?

    For example, newspapers accuse missing table in a repository, and then we create the table, but the server only "sees" the table created without rebooting.

    Nunes, do not need to restart, the ATG must already recognize the table after creation.

  • Collect statistics of the table in windows

    Hello

    Could you please help me to collect statistics for the tables below in Windows. I tried collection using dbms_scheduler job for a table, but it is not the collection of statistics for tables.

    TABLE_NAME OWNERNUM_ROWS BLOCKSSize

    MQRDW DWREFERENCETRACE GO 2891985937 26372904, 17.86

    TRAY PON_SERIAL 563722072 5135734 GB 8,12

    TRAY PON_PSN2358851732009064 2.67 GB

    TRAY PON_BOM_LOG 37199475 212936 601 MB

    TRAY UNIQUE_ITEM_LOTS 6633907 79710 160 MB

    TRAY PON_BOM5921377 41717328 MB

    SQL > start

    (2 dbms_scheduler.create_job)

    job_name 3 = > "SCOTT_JOB_SCHEDULE"

    job_type 4 = > "EXECUTABLE."

    5 job_action = > ' begin dbms_stats.gather_table_stats (ownname = > "TRACE3")

    6 tabname = > 'PON_PSN ',.

    estimate_percent 7 = > 30,

    Cascade 8 = > true,

    method_opt 9 = > 'for all THE COLUMNS of SIZE 1.

    10 degrees = > 5,

    11 options = > "BRINGING OUTDATED"); end;',

    12 repeat_interval = > ' freq = daily; byhour = 04; byminute = 0; bysecond = 0; »,

    13 active = > TRUE,

    14 comments = > ' custom stats collection for engine risk ");

    15 end;

    17 N

    PL/SQL procedure successfully completed .


    Total number of CPU available on this server is 8

    Oracle - 10.2.0.4.0

    OS - windows

    Kind regards

    Bala

    52 million lines?

    and how to change every day or be inserted?

    It is possible that you can never bring his stats again

    and everything will probably continue to work as expected

    read the guide to setting performance to understand why you need to collect statistics and when

    https://docs.Oracle.com/CD/E11882_01/server.112/e41573/stats.htm#PFGRF94714

    After reading this guide, you'll be ready for any question, you get all that against this team

    Sometimes you need to say 'no' and why the answer is 'no '.

  • [ADF, JDev 12.1.3] To run a query on the fly is always necessary to define a VO? How to get the Id of the last line inserted in a VO...

    Hallo,

    Sometimes, in the code for my application, I need to run smaller queries to retrieve data from the database.

    I wonder if for these queries, it is necessary to define a View object or if I can avoid this for example creation and execution of a VO on the fly.

    In this case I would not define a VO, given that queries will be never used to display data, but only for the internal logic.

    A use case, I want to solve it next.

    I would like to create a function to be used after validation for last inserted record by a user in a TableVO.

    For example

    Select the Id of the Table where UserId =? and Type =?

    The query should be run in a managed bean...

    public String okButton_action() {}

    OperationBinding operationBinding is BindingsUtils.getBindings () .getOperationBinding ("Commit");.

    Object result = operationBinding.execute ();

    If (! operationBinding.getErrors () .isEmpty ()) {}

    Error handling

    return;

    }

    Here, I need to:

    1. run the query to get the Id of the last inserted record

    2 call the setCurrentRowWithKey on the TableVO to update the display

    and get the Id (identity/auto-increment) than the database

    assigned to the field

    return "return";

    }

    If I can create a function that creates / runs the VO on the fly and return the value ID... It is best to create it in a class of public services or in the implementation class TableVO?

    I need to get the Id of the last line inserted since the ADF is not able to manage MS SQL Server identity fields (it seems that REFRESH AFTER INSERT cannot be used with non - Oracle DB).

    Any notice will be welocome.

    Thank you

    Federico

    The query should be run in a managed bean...

    Much better to execute the query in the template project.

    Example query: http://amit-adf-work.blogspot.com/2013/09/how-to-execute-sql-using-adf-application.html

    If I can create a function that creates / runs the VO on the fly and return the value ID... It is best to create it in a class of public services or in the implementation class TableVO?

    If you have the function that accepts the SQL as a parameter, then this should go to class util.

    Dario

  • collect statistics for the tablespace

    Friends...

    OS: Linux

    DB: 11 GR 2

    Data size: 1 TB

    I spend monthly multiple partitioned table spaces and bring together in a single annual partition. (for example tbs_2014_01, tbs_2014_02 - tbs_2014_12... all combine them into tbs_2014 as a tablespace)

    Over the weekend, work of database gets executed that collects statistics that are obsolete, it collects all the segments that have been moved from the storage.

    Given that the collection of statistics at the end of the week takes too long, I tried to find a smart way to collect statistics after each tablespace move rather than waiting for job to weekend which will take two or three days to complete.

    1. is there a way to gather statistics at the tablespace level and collect statistics for all objects in this table space?

    2. how to determine the overall stats of collection of statistics part?

    That is, suppose I have move the tbs_2014_01 tablespace and collect statistics with global stats that could take 2 hours but it will be difficult to spend 2 hours for each stats global tablespace which in my opinion is not good and we should be collecting global stats only once.

    3. any other advice?

    977272 wrote:

    @sol.beach... Thanks for your comments...

    I've not been asked to collect statistics to the tablespace but level to collect statistics after that finish objects move in storage.

    Given the size of the data, it is difficult to gather all the statistics at the weekend so trying to understand another method to collect the statistics the weekend load will be less.

    You can collect statistics object on an object by object basis level after that each object has been moved.

  • What is advised to collect statistics for the huge tables?

    We have a staging database, some tables are huge, hundreds GB in size.  Auto stats tasks are performed, but sometimes it will miss deadlines.

    We would like to know the best practices or tips.

    Thank you.

    Improvement of the efficiency of the collection of statistics can be achieved with:

    1. Parallelism using
    2. Additional statistics

    Parallelism using

    Parallelism can be used in many ways for the collection of statistics

    1. Parallelism object intra
    2. Internal parallelism of the object
    3. Inner and Intra object jointly parallelism

    Parallelism object intra

    The DBMS_STATS package contains the DEGREE parameter. This setting controls the intra parallelism, it controls the number of parallel processes to gather statistics. By default, this parameter has the value is equal to 1. You can increase it by using the DBMS_STATS.SET_PARAM procedure. If you do not set this number, you can allow oracle to determine the optimal number of parallel processes that will be used to collect the statistics. It can be achieved if you set the DEGREE with the DBMS_STATS. Value AUTO_DEGREE.

    Internal parallelism of the object

    If you have the 11.2.0.2 version of Oracle database you can set SIMULTANEOUS preferences that are responsible for the collection of statistics, preferably. When there is TRUE value at the same TIME, Oracle uses the Scheduler and Advanced Queuing to simultaneously manage several jobs statistics. The number of parallel jobs is controlled by the JOB_QUEUE_PROCESSES parameter. This parameter must be equal to two times a number of your processor cores (if you have two CPU with 8 cores of each, then the JOB_QUEUE_PROCESSES parameter must be equal to 2 (CPU) x 8 (cores) x 2 = 32). You must set this parameter at the level of the system (ALTER SYSTEM SET...).

    Additional statistics

    This best option corresponds to a partitioned table. If the INCREMENTAL for a partitioned table parameter is set to TRUE and the DBMS_STATS. GATHER_TABLE_STATS GRANULARITY setting is set to GLOBAL and the parameter of DBMS_STATS ESTIMATE_PERCENT. GATHER_TABLE_STATS is set to AUTO_SAMPLE_SIZE, Oracle will scan only the partitions that have changes.

    For more information, read this document and DBMS_STATS

Maybe you are looking for