I am interpolating the signal by fourier transform. For this purpose, I have to fft on the signal, and the zero pad the center of the fourier transformed data (eg. if there are 32 data points, 32 zeros are to be added after the 16th data point (consisting of both real and imaginary number). Afterwards, this signal is inverse fourier transformed to get 2xinterpolation.
Please tell me which code can I use to zero-pad the center of the fourier transformed data.
Thanks,

 채택된 답변

Star Strider
Star Strider 2020년 3월 8일

0 개 추천

There is already a function to do this. See interpft for details.

댓글 수: 7

Laiba Qadeer
Laiba Qadeer 2020년 3월 8일
편집: Laiba Qadeer 2020년 3월 8일
Hi,
I am a beginer. So, it would be nice if you guide me a bit more. To apply this function, I have to carry out fft of the signal, followed by the interpft of the fourier transformed signal. Then I apply ifft on the on the interpolated signal. Is this Right?
I am getting bad result by doing this.
Thanks.
Star Strider
Star Strider 2020년 3월 8일
Not exactly. The interpft function does all that for you. Please see the documentation page I linked to in my original Answer.
Image Analyst
Image Analyst 2020년 3월 9일
Did you use fftshift()? What do you mean by "center"? If you're padding/appending to the end of the fft signals, why do you call that the center?
Laiba Qadeer
Laiba Qadeer 2020년 3월 9일
I do not pad at the end. I add zeros in the center of the sigal, so the signal is symmetrical. I am trying to do what is described on page 5 of the attached PDF
Image Analyst
Image Analyst 2020년 3월 9일
I don't think they are adding zeros. They are interpolating the signal to make it the length they want. They call this "resolution enhancement" but we all know that is a deceptive term. You can't just increase the resolution by resampling at a higher number of points. Sure you get more elements in the array, but the physical resolution in terms of how much distance or time (i.e. real world units) the signal can resolve stays the same. To illustrate, imagine you have a 1 megapixel (1000x1000) image with a spatial resolution of 1 millimeter. You can see that two points of light separated by 2 pixels (center to center) are different. Now let's say you upsample it by 10 to 10,000 by 10,000. Can you resolve two points of light separated by 0.1 mm now? Of course not. You have more pixels but the physical resolution is the same -- it's still 1 mm.
Anyway, you can resample the signal to a higher number of elements using interp1d().
Star Strider
Star Strider 2020년 3월 9일
It is straightforward to increase the frequency resolution of a Fourier transform (or time resulution of an inverse Fourier transform) by zero-padding it. In the fft or ifft functions, just specify a value for ‘n’ greater than the original signal length. The functions themselves take care of the rest. (Note that the ifft function allows the specification of the argument array to be conjugate symmetric.) The only absolute requirement is that the sampling times (or sampling frequencies) be regularly-spaced.
Laiba Qadeer
Laiba Qadeer 2020년 3월 9일
Thank you both for your reply. I get what you are saying. I used these codes and got the result that I wanted.

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

추가 답변 (0개)

제품

릴리스

R2017a

질문:

2020년 3월 8일

댓글:

2020년 3월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by