How to identify datasegments that correlate to a given frequency
Mostrar comentarios más antiguos
I have a dataset collected over time (50 data points per min) and extracted a frequency (0.8 Hz) at which the data pattern repeats. However, sometimes the dataset includes both periodic and non-periodic behavior. Below, I created some data that looks about the way my data does, just with a lot less noise.
data_01 = sin(2*pi*1.25*(0:1/50:15)');
data_02 = sin(2*pi*3*(0:1/50:15)');
data_03 = [mean([data_01(1:250) data_02(1:250)]'), data_01(250:end)']
findpeaks(data_03,'MinPeakDistance',0.79*50); hold on; plot(data_03(1:250))
I would like to use the frequency I identified for my data of interest (0.8 Hz) to identify which parts of my data are best represented by the frequency (blue) and which do not fit the frequency as well (red). In the end, I would like a value for how well the data around each peak correlates to the 0.8 Hz frequency. If I could have a value for each data point that would be better. I need a way to distinguish between the first peaks on the red plot and the last peaks on the blue plot.
Thank you!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Correlation and Convolution en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!