The answer i give is probably partly help full.
What you can do is when you have a STD and a MEAN. Than during the real time proces update the saved MEAN (Array of you mean value) by adding every time a sample to your array and remove the oldest one you create a circular pattern. After N samples your MEAN is only the MEAN from your data.
Do the same with the STD.
Maybe you can create a different MEAN and STD from different types of data so the error is less worse
Good Luck