how zero padding works?

9 次查看(过去 30 天)
dora
dora 2014-9-25
Hello,
First of all, i would like to inform you that i have a little experience with matlab :( !!!
I want to estimate the spectrum of a part of a signal whick i take of a 1*2624 matrix.i plot it and then with "axis", isolate the part that i want to study.Except for "axis", in which way can i isolate this part? Secondly,i want to zero pad and perform fft to this part of signal and then make its length equal to 1024.
  1 个评论
Image Analyst
Image Analyst 2014-9-26
编辑:Image Analyst 2014-9-26
On Tuesday, Sept. 30, 2014 the Mathworks is giving a free educational webinar on spectral analysis. You might want to sign up. Click here for info on Spectral Analysis webinar.

请先登录,再进行评论。

回答(1 个)

Adam
Adam 2014-9-25
编辑:Adam 2014-9-25
A few ideas though I'm sure others can give a fuller more precise answer. I have done a fair bit of work with the fft, but I don't have a background in it so I have only learned it on a "need to know" basis for my work.
The best option is probably to apply a window function to your data in the area of interest. There are lots of different types of window function depending on what you want.
The crudest of course is just a rectangular window, the equivalent of just doing e.g.
signalPart = fullSignal( 200:1000 );
to do the fft on only the part of the signal between samples 200 and 1000.
This is not what I would recommend though because you will get unwanted edge effects and since you do have signal extending beyond your area of interest you can simply taper that signal down to zero with a less aggressive window function.
Something like a hamming window might work decently.
doc hamming
That help page will also guide you towards other window types too in the See Also section.
To apply that you would do something like, for example:
win = hamming( 801 );
signalPart = win .* fullSignal( 200:1000 );
How much of your signal you choose to include is up to you. If you have a lot of signal either side of your region of interest you can make the window bigger than your section of interest so that the tapered part of the signal is outside of it, otherwise you can just window your region of interest and accept that the amplitudes towards the edges will be diminished.
fft will zero pad by default if you choose a number of points greater than the signal length. Usually I take the next power of 2 up from the signal length for the number of fft points unless I have a very short signal section.
  3 个评论
Adam
Adam 2014-9-26
Your original post seemed to suggest you had a 1d signal, but this looks more like 2d
dora
dora 2014-9-26
yes it's 1d signal.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by