Reduce the steps within this code

Hi there!
I've been wondering of a way to cut down the steps of sorting the transform and thresholding which constructs an image based on specific # of coefficicents. f is the image and M=4096:
R = fft2(f);
s = sort(abs(R(:)));
s = s(end:-1:1);
T = s(M+1);
R = R.*(abs(R)>T);
f1 = real(ifft2(R));
Just a thought. What do you suggest?

 採用された回答

Amit
Amit 2014 年 1 月 19 日
編集済み: Amit 2014 年 1 月 19 日

0 投票

R = fft2(f);
s = sort(abs(R(:)),1,'descend');
%s = s(end:-1:1);
T = s(M+1);
%R = R.*(abs(R)>T);
f1 = real(ifft2(R.*(abs(R)>T)));

1 件のコメント

Ayesha
Ayesha 2014 年 1 月 19 日
Thanks a ton!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

タグ

質問済み:

2014 年 1 月 19 日

編集済み:

2014 年 1 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by