Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Synchronize or resample data

Subject: Synchronize or resample data

From: Shahab

Date: 27 Jun, 2010 10:23:04

Message: 1 of 4

Please let me know what is the best way to synchronize the data that I collected from different data acquisition devices with different starting sampling clocks and sampling intervals. I want to compare the results of three different sources and resample them with the same sampling period. I should say that I know the starting clock of each device.
Thank you.

Subject: Synchronize or resample data

From: Faraz Afzal

Date: 27 Jun, 2010 13:21:04

Message: 2 of 4

"Shahab " <shahabteimouri@gmail.com> wrote in message <i078q8$psi$1@fred.mathworks.com>...
> Please let me know what is the best way to synchronize the data that I collected from different data acquisition devices with different starting sampling clocks and sampling intervals. I want to compare the results of three different sources and resample them with the same sampling period. I should say that I know the starting clock of each device.
> Thank you.


Dear Shahab

Your problem seems simple. Let me know if this worked for you..
Suppose u have 3 data matrices for each source.. A, B, C
Suppose each matrix is a 2 column matrix such as
 A= [time1 data1]
B= [time2 data2]
C= [time3 data3]
time for each of them is 20 seconds, sampled at different intervals..
U want suppose 1000 samples between these 20 seconds,
use linspace to give them all same time such as
TIME = linspace(0,20,1000);
or if u are interested in the indices of the time vector at which data is sampled use
Intersect..
I hope it helps..
Doc linspace and Intersect for more clarification,..

Regards,
Faraz

Subject: Synchronize or resample data

From: Shahab

Date: 27 Jun, 2010 17:59:06

Message: 3 of 4

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i07j80$at$1@fred.mathworks.com>...
> "Shahab " <shahabteimouri@gmail.com> wrote in message <i078q8$psi$1@fred.mathworks.com>...
> > Please let me know what is the best way to synchronize the data that I collected from different data acquisition devices with different starting sampling clocks and sampling intervals. I want to compare the results of three different sources and resample them with the same sampling period. I should say that I know the starting clock of each device.
> > Thank you.
>
>
> Dear Shahab
>
> Your problem seems simple. Let me know if this worked for you..
> Suppose u have 3 data matrices for each source.. A, B, C
> Suppose each matrix is a 2 column matrix such as
> A= [time1 data1]
> B= [time2 data2]
> C= [time3 data3]
> time for each of them is 20 seconds, sampled at different intervals..
> U want suppose 1000 samples between these 20 seconds,
> use linspace to give them all same time such as
> TIME = linspace(0,20,1000);
> or if u are interested in the indices of the time vector at which data is sampled use
> Intersect..
> I hope it helps..
> Doc linspace and Intersect for more clarification,..
>
> Regards,
> Faraz

Dear Faraz,

Thank you very much for your attention but I think it is not straight forward like this.
I should clarify that my experiment was temperature measurement. I had three different data acquisition devices such as data logger and a National Instrument device for collecting the data. Each of them has a different sampling frequency but I only know the clock of each device since they started almost simultaneously. Now I want to compare the temperature of different channels and I have to synchronize them together to have the same sampling rate and same vector size. Later, I have to use them in the calibration process and compare them with simulation. I am looking forward to your reply if you have any idea about this.

Best regards,
/Shahab

Subject: Synchronize or resample data

From: dpb

Date: 27 Jun, 2010 18:41:37

Message: 4 of 4

Shahab wrote:
...

> Thank you very much for your attention but I think it is not straight
> forward like this.
> I should clarify that my experiment was temperature measurement. I had
> three different data acquisition devices such as data logger and a
> National Instrument device for collecting the data. Each of them has a
> different sampling frequency but I only know the clock of each device
> since they started almost simultaneously. Now I want to compare the
> temperature of different channels and I have to synchronize them
> together to have the same sampling rate and same vector size. Later, I
> have to use them in the calibration process and compare them with
> simulation. I am looking forward to your reply if you have any idea
> about this.

Depends on what your meaning of "synchronize" is...if the temperature
changes are relatively slow, pick a desired end sample rate and
interpolate each of the individual channels to it.

doc interp1

Alternatively, if you have the Signal Processing Toolbox, the function
resample might be of interest.

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us