resample function possibly introducing phase shift

8 visualizaciones (últimos 30 días)
Paul
Paul el 21 de Oct. de 2024
Respondida: Star Strider el 21 de Oct. de 2024
Hi,
I am using the resample function on MATLAB to resample data to match the samples of another data. For context I'm dealing with a measurement of power which is measured seperatly by two different measurement devices, although at the same point in the circuit, so they should align.
The target data is sampled much slower (50ms) compared to the data being resampled (50us) so theres a big discrepancy in number of samples for the 10 minute window of interest. The target data has 11775 samples and the data being resampled has over 12.2 million samples. I'm trying to apply the resample function to the data to match the target data and although it succeeds, there is an obvious phase difference that is being introduced as can be seen in the attached photo.
I have data for numerous different operating points of power (each 10 mins long) and for every case, there is a gradual change in phase which leads me to believe that is due to the resample function. Can someone give me any pointers in how to fix this shift?
Thanks!

Respuestas (1)

Star Strider
Star Strider el 21 de Oct. de 2024
If the original data are not regularly sampled, that could account for the distortion. (An easy way tto check this is to calculate the standard deviation of the differences in the time vetor, if is greater than about or so times the mean of the differences, I do not consider the sampling intervals to be equal, or the sampling frequency to be constant.) If the data are not regularly sampled, first calculate the mean sampling freequency for the data that exist (I usually define the mean sampling frequency as ‘1/mean(diff(t))’ where ‘t’ is the time vector), and then initially resample the data to that sampling frequency usiing resample. After that, resample it to your new sampling frequency.
.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by