Filter löschen
Filter löschen

How to split time series array into subarrays according to sampling rate?

2 Ansichten (letzte 30 Tage)
Phoenix98
Phoenix98 am 24 Jul. 2018
Kommentiert: Krithika A am 25 Jul. 2018
Hi, I have a data acquired from ECG sensor sampled at 128 sps I want to make subarrays each contains 256 sample?

Antworten (1)

Krithika A
Krithika A am 24 Jul. 2018
Bearbeitet: Krithika A am 24 Jul. 2018
sps = 128;
n = 768; % 128*6 = 768, so a 6s long signal with 128 sps
x = randn(1,n);
y = reshape(x, [], sps*2);
  9 Kommentare
Guillaume
Guillaume am 25 Jul. 2018
It should be indeed
reshape(x, [], 50)
to divide the data into 50 columns or even better:
reshape(x, 256, [])
to split the data into columns of 256 elements. In each case, each subarray ends up as a column.
Krithika A
Krithika A am 25 Jul. 2018
Yes, Guillaume is 100% correct.
Glad you sorted it out.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Christmas / Winter finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by