How to find the threshold of a matrix?

2 views (last 30 days)
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

Accepted Answer

Greg Heath
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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!