필터 지우기
필터 지우기

specifying frequencies in pwelch not working

조회 수: 7 (최근 30일)
Karen Konkoly
Karen Konkoly 2022년 7월 28일
댓글: Chunru 2022년 7월 30일
Last year, I could input the following into pwelch and it would give me a nice output with the mean alpha power in that piece of data
data = EEG.data; %assume this is 1 row of my EEG data of interest
analysisWinSize = 1000; % in data points
Overlap = 500; % in data points. overlap of windows.
FreqOfInterest = 8 : .5 : 12.5;
sr = 1000; %Sampling rate in Hz
freqOverTime = pwelch(data, analysisWinSize, Overlap, FreqOfInterest, sr);
windows.AlphaPowerF3(i) = mean(freqOverTime,'all');
I But now when I try to run it, it first gives the error,
"Error using pwelch (line 503)
pwelch: arg 3 (overlap) must be real from 0 to 0.950000"
If I change the overlap to "[]" (the default is 50% anyways), then I get the error:
Error using pwelch (line 511)
pwelch: arg 4 (Nfft) must be integer >=0
And I can't figure out how to change it. I don't want it to be an integer or Nfft, it is supposed to be an array that specifies the frequencies I want to do the analysis on. The documentation made it seem like the function would interpret the input differently depending on whether it was an integer or array, but I can't figure out a way around this error. Did the pwelch function change? Can anyone help?

답변 (1개)

Chunru
Chunru 2022년 7월 29일
No problem for on-line matlab.
data = randn(20000,1); %assume this is 1 row of my EEG data of interest
analysisWinSize = 1000; % in data points
Overlap = 500; % in data points. overlap of windows.
FreqOfInterest = 8 : .5 : 12.5;
sr = 1000; %Sampling rate in Hz
freqOverTime = pwelch(data, analysisWinSize, Overlap, FreqOfInterest, sr);
plot(FreqOfInterest, freqOverTime)
%windows.AlphaPowerF3(i) = mean(freqOverTime,'all');
  댓글 수: 2
Karen Konkoly
Karen Konkoly 2022년 7월 29일
I just tried updating my matlab but that didn't work...
Chunru
Chunru 2022년 7월 30일
Could you be more specific?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by