フィルターのクリア

Interpolation in time-domain vs frequnecy domain

7 ビュー (過去 30 日間)
Rene Riha
Rene Riha 2018 年 2 月 11 日
編集済み: Rene Riha 2018 年 2 月 11 日
Hello, could you tell me or explain where is the difference between fft and ifft code when I use fft(x, n) with zero-padding to index n to interpolate frequency domain, but to interpolate time-domain I have to use ifft(ifftshift(padarray((fftshift(X)), [0 n/2]))) (with n/2 zeros on both sides of vector) to get right results? Why ifft(X, n) is not working? Thanks for your answers.

回答 (1 件)

Image Analyst
Image Analyst 2018 年 2 月 11 日
You don't have to. You don't have to use padarray and fftshift at all. Just doing a round trip of fft() and ifft() should get you the original vector x. Shifting is only needed if you want to visualize the zero frequency at the middle of your vector instead of at the first element. If you want, you could keep a separate copy, X_shifted, just for display but do all your computations on the original X.
  1 件のコメント
Rene Riha
Rene Riha 2018 年 2 月 11 日
編集済み: Rene Riha 2018 年 2 月 11 日
But I was interesting rather in interpolation problem. When I use command ifft(X, n) I get this obviously wrong result.
But when I write ifft(ifftshift(padarray((fftshift(X)), [0 n/2]))) the results are what I would expect (a sinusoid).
The principal idea is why I can't pad with n zeros before ifft operation at the end of array as in fft, but I have to pad with n/2 zeros at the both ends after fftshift, again ifftshift padded array and finally perform ifft operation.

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

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by