Dear Mike, Thanks a lot, I just started EEG research, your channel has been a great help! I'm confused about the scientific validity of zero padding with regards to your example of wanting a Fourier coefficient for the exact frequence of a flickering lightbulb: If I think of an extreme case, i.e. a sampling rate of 1 Hz over 1 second, then the EEG signal only tells us the mean current for this given second. However, if you zeropad the signal with 99 seconds of null activity, you get Fourier coefficients for increments of 1/100 Hzs. As you said at the end of the video, it helps in smoothing out a curve. I see that, but I have a hard time figuring how you could draw new conclusions from it e.g. with the light bulb experiment. Many thanks, Victor
Hi Victor. Zero-padding is valid as long as you understand the correct interpretation: The values in between the "true" frequencies are sinc-interpolated values. You can trust them as much as you can trust any other interpolated signal. If the resolution is already fairly good, then interpolating a bit higher is fine. In extreme cases, it would be good to exert caution. Anyway, zero-padding is necessary for some applications like convolution, so it's used even if the interpolated points are not interpreted.
Dear Professor Mike, Your tutorials are incredibly helpful, and you are my reference for signal processing. I am currently learning from your EEG Bootcamp, which is a high-quality educational and practical course. I have a question regarding zero-padding in the frequency domain before applying an IFFT. Is it similar to applying Sinc interpolation in the space or time domain to increase the image or signal size? Also, I’ve noticed that some zero-padding methods include zeros between the Nyquist (positive frequency) and the negative frequency, like this: spectrum(pos)___zeros___spectrum(neg). I’m unsure why we don't just do the padding before and after the spectrum, like this: zeros___spectrum___zeros. It have a link if the spectrum is shifted or not ?
Thank you for your kind words, Anassofti. Zero-padding in the frequency domain increases the temporal resolution in the time domain. This is called sinc interpolation. And yes, the zeros go in between the positive and negative frequencies. Your suggestion (zeros__spectrum__zeros) is actually also correct, if you put the 0 frequency in the middle and negative frequencies to the left.
Hi Marcus. The frequency resolution is determined by the sampling rate and the number of time points. Without changing the sampling rate, zero-padding is the best way to increase the frequency resolution.
Dear Mike, Thank you so much. I have a question please: By zero padding, a new signal is generated; the result of the fft should change in a way that in ifft the straight part of the new signal be covered as well. It causes change in frequency content of the signal! Where is my mistake, please?
Hi Arash. Zero padding increases the frequency resolution, but it doesn't change the frequencies or the shape of the spectrum except to make it smoother.
@@mikexcohen1 thanks. You are totally correct. I checked that in some examples as well. (There is just a conflict between my feeling and the way which mathematics works in this case 😃). Thank you so much.
I am having trouble understanding WHY the zeros are added after the actual readings. Intuitively adding zeros between valid data points and interpolating between data points makes sense- please help
Zero-padding is indeed confusing. Imagine what would happen if you put zeros in between data points -- that would actually change the frequency characteristics of the signal and introduce a lot of artifacts. Imagine, for example, a sine wave. Then you put zeros between each time point in the sine wave. The signal would have a sine wave at 1/2 the frequency, and it would keep bouncing between zero and a valid sine point.
Indeed, zero-padding is sinc-interpolation (a.k.a. the zero-padding theorem). Frequency resolution is the spacing between successive frequencies, and so with more time points in the signal, the frequency resolution increases.
@@mikexcohen1 ok, I think there is different definitions on frequency resolution. From what I have learn frequency spacing and frequency resolution is not the same.
@@JsoProductionChannel " I have heard it said that it increases frequency resolution because it extends the signal, but I don't agree as by just adding zeros you haven't added any new information to the signal. "
Random music producer just passin thru lol. This is next level!
Thanks :)
Dear Mike,
Thanks a lot, I just started EEG research, your channel has been a great help!
I'm confused about the scientific validity of zero padding with regards to your example of wanting a Fourier coefficient for the exact frequence of a flickering lightbulb:
If I think of an extreme case, i.e. a sampling rate of 1 Hz over 1 second, then the EEG signal only tells us the mean current for this given second. However, if you zeropad the signal with 99 seconds of null activity, you get Fourier coefficients for increments of 1/100 Hzs.
As you said at the end of the video, it helps in smoothing out a curve. I see that, but I have a hard time figuring how you could draw new conclusions from it e.g. with the light bulb experiment.
Many thanks, Victor
Hi Victor. Zero-padding is valid as long as you understand the correct interpretation: The values in between the "true" frequencies are sinc-interpolated values. You can trust them as much as you can trust any other interpolated signal. If the resolution is already fairly good, then interpolating a bit higher is fine. In extreme cases, it would be good to exert caution.
Anyway, zero-padding is necessary for some applications like convolution, so it's used even if the interpolated points are not interpreted.
Dear Mike, many thanks for your response. It's clearer now. Best, Victor
at 3:34, didn't you mean "decrease the resolution" ? Because if you are lowering the sample rate, the buckets move closer together.
nvm, the closer the buckets move together, the higher the resolution. Not the opposite.
Exactly. It's confusing stuff ;)
It would be equally accurate to say that we're decreasing the frequency spacing.
Dear Professor Mike,
Your tutorials are incredibly helpful, and you are my reference for signal processing. I am currently learning from your EEG Bootcamp, which is a high-quality educational and practical course.
I have a question regarding zero-padding in the frequency domain before applying an IFFT. Is it similar to applying Sinc interpolation in the space or time domain to increase the image or signal size? Also, I’ve noticed that some zero-padding methods include zeros between the Nyquist (positive frequency) and the negative frequency, like this: spectrum(pos)___zeros___spectrum(neg). I’m unsure why we don't just do the padding before and after the spectrum, like this: zeros___spectrum___zeros. It have a link if the spectrum is shifted or not ?
Thank you for your kind words, Anassofti.
Zero-padding in the frequency domain increases the temporal resolution in the time domain. This is called sinc interpolation. And yes, the zeros go in between the positive and negative frequencies. Your suggestion (zeros__spectrum__zeros) is actually also correct, if you put the 0 frequency in the middle and negative frequencies to the left.
@@mikexcohen1 It's very clear for me now, thanks a lot for your explanation ❤
Is there a way to use the same number of time points to take the DFT only of a shorter frequency band with more frequency resolution?
Hi Marcus. The frequency resolution is determined by the sampling rate and the number of time points. Without changing the sampling rate, zero-padding is the best way to increase the frequency resolution.
It's a metod for oversampling? When a plugin make it?
very good explaining, would you please talk as well about hunning and hamming windowing?
Find my video called "Welch's method for smooth spectral decomposition."
Dear Mike,
Thank you so much.
I have a question please:
By zero padding, a new signal is generated; the result of the fft should change in a way that in ifft the straight part of the new signal be covered as well. It causes change in frequency content of the signal!
Where is my mistake, please?
Hi Arash. Zero padding increases the frequency resolution, but it doesn't change the frequencies or the shape of the spectrum except to make it smoother.
@@mikexcohen1 thanks. You are totally correct. I checked that in some examples as well.
(There is just a conflict between my feeling and the way which mathematics works in this case 😃).
Thank you so much.
Math is often unintuitive, sometimes even counter-intuitive...
I am having trouble understanding WHY the zeros are added after the actual readings. Intuitively adding zeros between valid data points and interpolating between data points makes sense- please help
Zero-padding is indeed confusing. Imagine what would happen if you put zeros in between data points -- that would actually change the frequency characteristics of the signal and introduce a lot of artifacts. Imagine, for example, a sine wave. Then you put zeros between each time point in the sine wave. The signal would have a sine wave at 1/2 the frequency, and it would keep bouncing between zero and a valid sine point.
Your stuff is SO good.
Thanks bro
Thank you for sharing this amazing work!
Glad you enjoyed it!
if I add a window to the sampled signal, then reverse it and inverse it, and pad this reverse-inverse signal with the original signal, can it work?
This is called reflection and is usually done to attenuate edge effects during filtering.
@@mikexcohen1 so can it increase the frequency resolution or it's totally nonsense for increasing freq resolution?
Technically it would increase frequency resolution, but the goal of reflection is to attenuate edge effects in (time-domain) filtering.
Zero-padding does not increase frequency resolution. It is only a technique which interpolates the signal points.
Indeed, zero-padding is sinc-interpolation (a.k.a. the zero-padding theorem). Frequency resolution is the spacing between successive frequencies, and so with more time points in the signal, the frequency resolution increases.
@@mikexcohen1 ok, I think there is different definitions on frequency resolution. From what I have learn frequency spacing and frequency resolution is not the same.
@@JsoProductionChannel " I have heard it said that it increases frequency resolution because it extends the signal, but I don't agree as by just adding zeros you haven't added any new information to the signal. "
Character In the video It's great, I like it a lot $$