Submitted by ouluoba111 on Thu, 08/15/2013 - 11:42 严老师您好, 我现在有之前处理好的时间序列,我想请问老师如何用REST直接计算时间序列的ALFF? 谢谢 Log in or register to post comments 5716 reads Submitted by YAN Chao-Gan on Sat, 08/17/2013 - 12:23 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 请参考alff函数。 先去线性漂移,假定AllVolume是一条你要计算的时间序列: AllVolume(:,1) = detrend(AllVolume(:,1)); 补0到2的n次方,以进行FFT AllVolume = [AllVolume;zeros(paddedLength -sampleLength,size(AllVolume,2))]; 进行FFT AllVolume(:,1) = 2*abs(fft(AllVolume(:,1)))/sampleLength; 确定所需频段对应的index: if (LowCutoff >= sampleFreq/2) % All high included idx_LowCutoff = paddedLength/2 + 1; else % high cut off, such as freq > 0.01 Hz idx_LowCutoff = ceil(LowCutoff * paddedLength * ASamplePeriod + 1); % Change from round to ceil: idx_LowCutoff = round(LowCutoff *paddedLength *ASamplePeriod + 1); end if (HighCutoff>=sampleFreq/2)||(HighCutoff==0) % All low pass idx_HighCutoff = paddedLength/2 + 1; else % Low pass, such as freq < 0.08 Hz idx_HighCutoff = fix(HighCutoff *paddedLength *ASamplePeriod + 1); % Change from round to fix: idx_HighCutoff =round(HighCutoff *paddedLength *ASamplePeriod + 1); end 计算ALFF ALFF= mean(AllVolume(idx_LowCutoff:idx_HighCutoff,:)); Log in or register to post comments Submitted by ouluoba111 on Sun, 08/25/2013 - 01:40 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 谢谢老师的解答。我懂了~~~ Log in or register to post comments Submitted by ouluoba111 on Sun, 08/25/2013 - 01:41 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 谢谢老师的解答。我懂了~~~ Log in or register to post comments
Submitted by YAN Chao-Gan on Sat, 08/17/2013 - 12:23 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 请参考alff函数。 先去线性漂移,假定AllVolume是一条你要计算的时间序列: AllVolume(:,1) = detrend(AllVolume(:,1)); 补0到2的n次方,以进行FFT AllVolume = [AllVolume;zeros(paddedLength -sampleLength,size(AllVolume,2))]; 进行FFT AllVolume(:,1) = 2*abs(fft(AllVolume(:,1)))/sampleLength; 确定所需频段对应的index: if (LowCutoff >= sampleFreq/2) % All high included idx_LowCutoff = paddedLength/2 + 1; else % high cut off, such as freq > 0.01 Hz idx_LowCutoff = ceil(LowCutoff * paddedLength * ASamplePeriod + 1); % Change from round to ceil: idx_LowCutoff = round(LowCutoff *paddedLength *ASamplePeriod + 1); end if (HighCutoff>=sampleFreq/2)||(HighCutoff==0) % All low pass idx_HighCutoff = paddedLength/2 + 1; else % Low pass, such as freq < 0.08 Hz idx_HighCutoff = fix(HighCutoff *paddedLength *ASamplePeriod + 1); % Change from round to fix: idx_HighCutoff =round(HighCutoff *paddedLength *ASamplePeriod + 1); end 计算ALFF ALFF= mean(AllVolume(idx_LowCutoff:idx_HighCutoff,:)); Log in or register to post comments
Submitted by ouluoba111 on Sun, 08/25/2013 - 01:40 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 谢谢老师的解答。我懂了~~~ Log in or register to post comments
Submitted by ouluoba111 on Sun, 08/25/2013 - 01:41 Permalink Re: 使用REST通过.1D或.txt文件计算ALFF问题。 谢谢老师的解答。我懂了~~~ Log in or register to post comments
Submitted by YAN Chao-Gan on Sat, 08/17/2013 - 12:23 Permalink
Re: 使用REST通过.1D或.txt文件计算ALFF问题。
请参考alff函数。
先去线性漂移,假定AllVolume是一条你要计算的时间序列:
AllVolume(:,1) = detrend(AllVolume(:,1));
补0到2的n次方,以进行FFT
AllVolume = [AllVolume;zeros(paddedLength -sampleLength,size(AllVolume,2))];
进行FFT
AllVolume(:,1) = 2*abs(fft(AllVolume(:,1)))/sampleLength;
确定所需频段对应的index:
if (LowCutoff >= sampleFreq/2) % All high included
idx_LowCutoff = paddedLength/2 + 1;
else % high cut off, such as freq > 0.01 Hz
idx_LowCutoff = ceil(LowCutoff * paddedLength * ASamplePeriod + 1);
% Change from round to ceil: idx_LowCutoff = round(LowCutoff *paddedLength *ASamplePeriod + 1);
end
if (HighCutoff>=sampleFreq/2)||(HighCutoff==0) % All low pass
idx_HighCutoff = paddedLength/2 + 1;
else % Low pass, such as freq < 0.08 Hz
idx_HighCutoff = fix(HighCutoff *paddedLength *ASamplePeriod + 1);
% Change from round to fix: idx_HighCutoff =round(HighCutoff *paddedLength *ASamplePeriod + 1);
end
计算ALFF
ALFF= mean(AllVolume(idx_LowCutoff:idx_HighCutoff,:));
Submitted by ouluoba111 on Sun, 08/25/2013 - 01:40 Permalink
Re: 使用REST通过.1D或.txt文件计算ALFF问题。
谢谢老师的解答。我懂了~~~
Submitted by ouluoba111 on Sun, 08/25/2013 - 01:41 Permalink
Re: 使用REST通过.1D或.txt文件计算ALFF问题。
谢谢老师的解答。我懂了~~~