Synchronizing experimental data with different timescales
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Oleg Komarov
am 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).'
Kategorien
Mehr zu Time Series Events finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!