How to find the threshold of a matrix?
2 views (last 30 days)
Show older comments
Iam working on FFT algorithm.The FFT is applied to an image and it resulted in complex number matrix.Now I have to find threshold of the FFT resulted matrix and set the values of matrix to zero which are below threshold.Then apply IFFT to reconstruct.But Iam not able to find threshold of matrix.Any help appreciated.Thanks in advance
0 Comments
Accepted Answer
Greg Heath
on 27 Dec 2012
rng(0)
x = randn(1,32);
X = fft(x);
absX = abs(X);
M = max(absX);
absX(absX < M/100) = 0;
z = ifft(absX.*exp(i*angle(X)));
err = max(abs(z-x))
err =
4.4419e-016
Thank you for formally accepting my answer
Greg
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!