splitting up a timeseries into separate components

조회 수: 5 (최근 30일)
nines
nines 2020년 2월 18일
답변: nines 2020년 2월 20일
hi all!
I am trying to seperate chunks of a timeseries into sleep vs. wake components.
I'm having problems with two things:
1) I've figured out how to do it with one section, but I want to be able to do it with multiple sections, e.g. 200-600 seconds and 750-800 seconds.
2) I also want to take these chunks of the timeseries and then calculate the power. When I try to run my script to calculate the power, I get a ton of errors I think because sleep_c (etc) is = 1x1 double times, rather than my normal ts = 1000x1 double
thanks times a million:
I've done this:
%%%%loading
sleep_behavior = 1500:3000
sleep_c = timeseries(d_c_ts_1(sleep_behavior,1), 1500:3000,'name', 'fMRI signal')
sleep_behavior = 1500:3000
sleep_v = timeseries(d_v_ts_1(sleep_behavior,1), 1500:3000,'name', 'fMRI signal')
wake_behavior = 100:200
wake_c = timeseries(d_c_ts_1(wake_behavior,1), 100:200,'name', 'fMRI signal')
wake_behavior = 100:200
wake_v = timeseries(d_v_ts_1(wake_behavior,1), 100:200,'name', 'fMRI signal')
%% calculating power of sleep vs. wake ----- power vs. frequency
for a = 1:1
name = sleep_v
[power_sleep_v, f] = mtspectrumc(name,params) %detrended cortex young person
end

채택된 답변

nines
nines 2020년 2월 20일
hello!
found a good function for anyone in the future:
https://github.com/VincentToups/matlab-utils/blob/master/chronux/documentation/chronux_2_00/spectral_analysis/continuous/mtspectrumtrigc.html

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Behavior and Psychophysics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by