Dealing with NaN values in FFT

조회 수: 209 (최근 30일)
noam edelshtein
noam edelshtein 2020년 7월 25일
댓글: Star Strider 2022년 2월 9일
Hi, I'm working with a large data set of voxel information from MRI scans of multiple subjects, and as part of the analysis I use FFT. Prior to this, the data already goes through some modifications, removing specific values deemed too low (insignificant data) and replacing it with NaN values. After checking the results I realized there is an issue with FFT and NaN values. Is there some solution or workaround that someone perhaps knows that might help resolve this issue?

채택된 답변

Star Strider
Star Strider 2020년 7월 25일
If you have R2016b or later, the fillmissing function is an option.
  댓글 수: 8
Jon
Jon 2022년 2월 9일
Done, thanks for the reminder, I had forgotten about the upvoting feature.
Star Strider
Star Strider 2022년 2월 9일
Thank you!

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

추가 답변 (1개)

Sugar Daddy
Sugar Daddy 2020년 7월 25일
what if you remove NaNs from dataset
Suppose
X = [1 2 3 NaN 3 2 1];
X(isnan(X)) = []
X =
1 2 3 3 2 1
  댓글 수: 2
noam edelshtein
noam edelshtein 2020년 7월 25일
That would cause a change in dimensions of the matrix, and there is more analysis to come after this stage, so I would need to know precisely where the nan values were to reinsert them in the right places following the fft analysis.
I considered replacing with 0 but I think that will cause some form of change in the results of the analysis.
Maya Eyal
Maya Eyal 2021년 2월 22일
I think this solution is not good, since it destroys the pattern in the data, and the whole reason we use the fft is to find the pattern.
I'm not an expert, just another one with the same NaN problem.
Unfortunatly, I use matlab 2019 so I don't have nufft function.
I'm not sure that interpulating the missing data will give me the pattern I want to find, but it seems I have no choice.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by