Synchronizing experimental data with different timescales
Show older comments
Hi all,
I am still concerned about the same project as yesterday. I have recorded experimental data of one experiment with several devices (GC (gas sample), GC-SCD (liquid sample), UVVIS (liquid sample), Volume flow measurement). These devices produce data at different frequencies, which leaves me with some trouble when it comes to calculating molar flows of components and reaction rates. The following (simple-sorry for the excel look) figure should help clarify what I mean: http://tinypic.com/r/900vm8/7
How can I extend the matrices of the devices with a slower sampling rate? I think I want to sample all data up to the same, highest frequency. I actually don't think about interpolation but just repeating the same value of one device until the the next measured value is there. Are there possibly already matlab functions out there which meet my needs, or how can I implement something myself? The dates are already in number format.
Best regards,
bearli
Accepted Answer
More Answers (1)
Oleg Komarov
on 5 Aug 2011
You can use run-length decoding to expand the low-frequency data to match the high-frequency:
% Generate random dates (sorted in ascending order)
hf = now + sort(rand(10,1)/100);
lf = now + sort(rand(10,1)/30);
datestr(hf)
datestr(lf)
% Now bin/(count) the high-freq into the low-freq according to [...) edges
len = histc(hf,lf);
% Use the counts to replicate the low-freq
rude(len,lf).'
Categories
Find more on Time Series Events in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!