- Resource Limitations: If the computation runs indefinitely, it might be a resource limitation issue. The multitaper method can be computationally intensive, and including the last data point might be pushing your system to its limits. Check your system's CPU and memory usage during the computation to see if resources are being maxed out.
- Data Type or Corruption: There might be something peculiar about the data type or the integrity of the last data point or surrounding points that is causing the function to hang. Although you mentioned there's no outlier, it's worth checking the data type and ensuring there's no NaN, Inf, or other unexpected values that might cause the function to behave incorrectly.
- Algorithmic Quirk: The MTM algorithm may have an edge case or a quirk that is only triggered by the specific length of your data sequence. This could be a bug or an undocumented behavior of the “pmtm” function.
- Windowing or Padding Issue: The MTM uses windowing and possibly padding. If the length of the data sequence interacts with the window or pad size in an unexpected way, it could potentially cause an issue.
- Frequency Resolution: When you specify the frequency resolution (NW parameter, referred to as “winput” in your code), the function calculates the required FFT length and the number of tapers. An edge case might occur with a specific combination of data length, NW, and sampling frequency.
Stranger behavior with pmtm.m function, with one more data point the result could not show up.
조회 수: 6 (최근 30일)
이전 댓글 표시
I have used pmtm.m function to do the multitaper decomposion of my EEG data. In one channel and only this one, I found as long I include the last data point (# 2050000), the calculation will never finish, while the duration for other channel are super fast. If I just decompose the signal from point 1 to 2049999, everything was fine. I plot the signal in the end. there is no big outlier at the last, at point 2050000. Does anyone could give me a hit about what happen? I could try to copy this one vector of EEG signal to let you try and see this super strange error.
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,:),[],winput,5000); % have to end by myself
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,1:100000),[],winput,5000);
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,1:2045000),[],winput,5000);
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,1:2049000),[],winput,5000);
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,1:2049999),[],winput,5000);
[p_mt(chl, :) f_mt] = pmtm(curr_EEG.data(8,1:2050000),[],winput,5000); % have to end by myself
댓글 수: 0
답변 (1개)
arushi
2024년 1월 24일
Hi Shuo,
The behavior you're describing with the “pmtm” function in MATLAB, where the computation does not finish when including the last data point, is unusual. The “pmtm” function implements the multitaper method (MTM) for spectral analysis and should be able to handle data sequences of various lengths, including your full dataset.
Here are a few potential reasons and troubleshooting steps for the issue you're encountering:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!