splitting up a timeseries into separate components

6 次查看(过去 30 天)
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