Skip to main content
Share Your Experience: Take the 2024 Developer Survey
14 votes
Accepted

What happens when N increases in N-point DFT

The length N of the DFT is the number of frequency points that will result in the DFT output. Zero padding will result in more frequency samples, however this does not increase frequency resolution, ...
Dan Boschen's user avatar
  • 51.9k
13 votes
Accepted

Bandwidth of an entire song

First of all, kudos to you: I appreciate the effort and thinking you've managed to articulate in your question. The DFT is a mathematical tool. As such, the parameters used to compute it can hide or ...
Jdip's user avatar
  • 6,265
9 votes
Accepted

Why doesnt DFT Padding cause sinc like features

The OP is showing very good insight in all the comments stated. A product in the time domain with a rectangular pulse is convolution in the frequency domain with a Sinc. In fact zero padding in time ...
Dan Boschen's user avatar
  • 51.9k
8 votes

How does zero-padding affect the magnitude of the DFT?

All effects you see have to do with windowing. Your signal can be seen as a truncated (i.e., rectangularly windowed) sinusoid. If $s[n]$ is your signal, and $w[n]$ is the window, the signal you ...
Matt L.'s user avatar
  • 90.3k
7 votes
Accepted

FFT: Sinewave frequency displacement when zero-padding

(I show only positive frequencies): which is part of the problem here :-) You would get the expected behavior if you used a complex sine, i.e. $x[n] = e^{j2\pi\frac{n}{N}}$ but a sine wave actually ...
Hilmar's user avatar
  • 45.3k
6 votes

Why Zero Padding in the Center of the DFT Interpolates / Upsamples the Signal (Sinc Interpolation / DFT Interpolation / Periodic Interpolation)

What you are experiencing is technically called interpolation by DFT; i.e., interpolating a time-domain sequence $x[n]$ by properly zero filling the middle portion of it's DFT $X[k]$ (and taking the ...
Fat32's user avatar
  • 28.3k
5 votes
Accepted

Zero padding - High amplitude

I'd like to apply zero padding to it, for better frequency bin resolution. First of all, let's state it one more time that zero padding does not improve frequency resolution of DFT. It'll only ...
Fat32's user avatar
  • 28.3k
5 votes

Relation of zero-padding and frequency resolution

why do I get "better" frequency resolution in case of adding zero-padding to this signal. You do and you don't. Zero padding increases resolution by interpolating between existing data ...
Hilmar's user avatar
  • 45.3k
5 votes
Accepted

Question about zero padding example in Lyons book on Understanding DSP

On the left side of Figure 3-21(a) the discrete 16-sample input sequence is represented by the dots. (The lightly-shaded sinusoidal curve is shown for reference only!) On the right side of Figure 3-21(...
Richard Lyons's user avatar
5 votes

Question about zero padding example in Lyons book on Understanding DSP

@gschro, I understand your puzzlement. Find the equation for computing a DTFT, in a textbook or on the Internet, and carefully examine it. In that equation $omega$ is a continuous frequency variable ...
Richard Lyons's user avatar
4 votes
Accepted

Zeropadding and amplitude scaling

The conventional definition of the DFT for a length $N$ signal (without zero-padding) is $$X[k]=\sum_{n=0}^{N-1}x[n]e^{-j2\pi nk/N}\tag{1}$$ So there is no scaling involved. Scaling is applied to ...
Matt L.'s user avatar
  • 90.3k
4 votes

How to Zero Pad in Order to Perform Filtering in the Fourier (Frequency) Domain?

The result of a convolution of a data vector of length M with a kernel of length G is of length M + G - 1. (the maximum length of the non-zero portion, even though the limits of integration is ...
hotpaw2's user avatar
  • 35.4k
4 votes
Accepted

Why is my time domain interpolation via zero-padding in frequency domain wrong?

The answer above is correct. Just to clarify a bit further, using x = np.linspace(0,10,5) will produce 5 numbers from 0 to 10 inclusively ...
Michael Gruner's user avatar
4 votes
Accepted

Why to pad zeros at the middle of sequence instead at the end of the sequence?

When working with the DFT and IFFT we can zero pad the signal, which serves to interpolate new samples in the other domain. We will often see this applied with padding at the end of the sequence or ...
Dan Boschen's user avatar
  • 51.9k
4 votes

Why doesnt DFT Padding cause sinc like features

@George kirby. I suggest you discard that notion of "multiplying a step function on top of the original signal to form a longer time sequence". I believe such a multiplication is not ...
Richard Lyons's user avatar
3 votes
Accepted

Zero padding effect on a FFT of gaussian noise

Think about both questions separately. First of all, the (I)FFT is just an implementation of the (I)DFT, so I'm going to generalize all this to the DFT. Does the zero-padded IDFT retain variance? ...
Marcus Müller's user avatar
3 votes

Why should I zero-pad a signal before taking the discrete Fourier transform?

I did not see these mentioned in the prior good responses so I will add the following additional important reasons for zero padding: Radix-2 algorithms are more efficient so zero padding out to the ...
Dan Boschen's user avatar
  • 51.9k
3 votes

remove zero padding effect crosscorrealation

so let's say the length of your FFT is $N$. let's say that you fill half of the buffer with your signal and fill the other half with zeros. $$ x[n] = 0 \quad \text{ for } \tfrac{N}2 \le n < N $...
robert bristow-johnson's user avatar
3 votes

Does Zero Padding Work as Advertised?

Zero-padding data for a longer FFT is equivalent to interpolation by a (periodic) Sinc kernel. Interpolation by a (periodic) Sinc kernel can reconstruct points between samples of a signal that was ...
hotpaw2's user avatar
  • 35.4k
3 votes
Accepted

DFT of sum of sinusoids with random zeroed samples

The math is well known; it is the convolution theorem for the DFT. In this specific case: $$DFT\left\{f[n]\cdot z[n]\right\} = DFT\left\{f[n]\right\} * DFT\left\{z[n]\right\}$$ Where: $f[n]$ ...
Andy Walls's user avatar
  • 2,710
3 votes
Accepted

DFT zero-padding of signals starting before n=0

Use the second one Tony... It yields the correct implied phase relationship.
Fat32's user avatar
  • 28.3k
3 votes

How to Zero Pad in Order to Perform Filtering in the Fourier (Frequency) Domain?

The reason why this zero-padding is necessary is that if you will be filtering (or convolving) $f$ and $h$ using multiplication in the frequency domain and you're using a computer to do it to the ...
robert bristow-johnson's user avatar
3 votes
Accepted

Why do the lengths of the sampled signals $x_1, \: x_2$ have to be $\text{length}(x_1)+\text{length}(x_2)-1$?

Multiplication in the frequency domain is equivalent to circular convolution in the time domain with a period of NFFT. If you don't zero pad them to at least ...
ZR Han's user avatar
  • 3,248
3 votes

Relation of zero-padding and frequency resolution

Zero padding before an FFT increases the number of interpolated points to plot from the longer result, by doing a high quality Sinc interpolation. With a higher density of plot points, the probability ...
hotpaw2's user avatar
  • 35.4k
3 votes

Interpolation by zero padding FFT

Two problems: (1) your signal is not periodic to hide the effect of windowing and (2) wrong frequency domain padding. Throw the last samples and manage carefully the lengths: ...
AlexTP's user avatar
  • 6,595
3 votes
Accepted

Does Zero padding cause noise in the high frequency region?

Is that correct? No. This zero padding just leads to interpolation with a (cyclic) sinc kernel. It affects all subcarriers the same (as you can see in your own DFT!). So, this has to be a problem ...
Marcus Müller's user avatar
3 votes
Accepted

Zero padding versus zero stuffing

Both can be used to upsample a signal by adding zeros in the time-domain. Nope. Zero padding in time interpolates in frequency. If you want to interpolate in time, you need to zero pad in frequency, ...
Hilmar's user avatar
  • 45.3k
3 votes
Accepted

Group delay and number of zeros for a symmetric FIR system

Leading zeros just add a delay of one sample for each zero. Consider the simple case of a filter with coefficients [0,0,1], this is just a 2 sample delay ($z^{-2}$). Similarly, a filter with ...
Dan Boschen's user avatar
  • 51.9k
3 votes
Accepted

FFT of 2 sine tones using windowing and zero padding. Wrong FFT amplitude

If you want to see the original amplitudes in your DFT magnitude plot, you need to apply correct scaling: Scale the results by $\sum_{k}{w_k}$, $w_k$ being the window, and multiply by $2$ to account ...
Jdip's user avatar
  • 6,265
2 votes

How does zero-padding affect the magnitude of the DFT?

Zero-padding does not affect DFT magnitude of the original N-DFT Samples. Overall energy does increase in the longer DFT and that is because we have introduced non-zero samples in between N-point DFT. ...
DSP Rookie's user avatar
  • 2,611

Only top scored, non community-wiki answers of a minimum length are eligible