# Advantages/disadvantage of zero padding

I would like to know what are the advantages/disadvantage of zero padding with respect to frequency measurement and amplitude measurement

• zero padding in what scenario? can you be more specific? you mean the circular convolution? – phanitej Mar 13 '15 at 5:03
• Possibly a duplicate of: dsp.stackexchange.com/questions/741/… – hotpaw2 Mar 13 '15 at 12:54

## Advantages of zero padding:

• If length of your sequence doesn't correspond to the size that can be handled efficiently with FFT routine (usually powers of prime numbers) then you might want to add some extra zeros to the nearest power in order to get the maximum speed-up. In worst case you double the memory you need for your signal.

• Adding zeros is equal to interpolating samples of your spectrum with $\mathrm{sinc}$ function. Therefore you will find it looking more smoothly. It is not affecting frequency resolution in any way.

• If some peaks were split between two bins, these can be interpolated to some extend and you might be able to retrieve some amplitude information thanks to that.

• If you are trying to plot frequency response of some FIR filter from it's impulse response then you need to add zeros to it. Otherwise you will get as many samples as the length of filter is. Please see here

• If you are trying to convolve your signal with some pattern using FFT, then you need to pad your signals with zeros to the appropriate length. Otherwise result of convolution will be incorrect (replicas in frequency domain will overlap). Please see here

## Disadvantages of zero padding:

Can't think of any. Oh maybe except of people believing that it will improve their frequency resolution in some magical way - I knew PhD's saying that...

• PhD was in English Lit, right? ;-) – Peter K. Mar 13 '15 at 12:21
• @PeterK. Yes indeed ;) – jojek Mar 13 '15 at 13:28

The disadvantage is you end up doing a longer FFT with higher computational cost: more MACs, energy spent toggling ALU/FPU transistors, memory paging and cache miss penalties, resulting in greater latency till the result is ready or requiring faster, hotter hardware.

If you only need a few interpolated points (one, or a small fraction of log N), it may be faster to do that locally using windowed Sinc interpolation rather than computing an entire longer FFT.

However that increased cost can be significantly less that other means of getting similar results, such as the interpolation of an entire window of plot points using polyphase filtering, or straight convolution vs. overlap add/save fast convolution, etc., etc.

Zero padding can help you resolve the finer structure of the spectrum, but it won't improve the resolution. Zero padding to 2^n number of points so that FFT can be faster. the computation scales like n*logn instead of n^2. As for amplitude measurement, the resolution is dominated by SNR no matter how fine spectrum you get in the end with zero padding.