That is a great video, especially due to the Matlab code which makes it easier to comprehend. I think it worth's mentioning that the increase in resolution will of course be limited to graphics, since adding zeros doesn't add information to the sampled signal.
7:57 It seems a little odd that the maximum amplitude increases slightly above the base value as the signal gets spread across more frequencies, it looks like it's getting pulled from surrounding frequencies. I'm seeing the same thing in my code though.
Dear Mike, According to the figure at 6:50, can I conclude that by zero padding the detected main frequencies are changed? As the figure shows not only the black line is smoothened, but its peaks and troughs are also shifted. Regards.
This doesn't make sense hey. 50k or 100k data points sampled at common frequency leads to changed frequency content of a signal, this doesn't sit well with me. I just don't understand how padding a signal with zeros changes frequency resolution, someone needs to assist me to understand this. U just increasing data points without fiddling with frequency content.
Thank you Mike, very helpful videos. Does Matlab really extend the signal with zeros, if the coeficients are calculated over N/2 points (going from two sided to one sided domain) this zeros aren't used,.. or only doubles N and N is used then for normalization and calculating frequency resolution?
Good observation, but no it doesn't produce a shift in the frequency domain; it increases the resolution (that is, the spacing between successive frequencies decreases). The phase values of the Fourier coefficients will preserve the time series order.
@@mikexcohen1 many thanks for your explanation and your wonderful video. I probably didn't understand what I saw at the end of your video, where the blue and red zero_padded spectra move away from the original in black. That also happens to me when I am trying to resolve two frequencies that are very close together. First I chose a large enough length of the time signal that will resolve the frequencies and they look fine in the dft, but when I zero_pad the signal in the time domain the padded spectrum shift a little. I don't know what I do wrong. Anyway congratulations and thanks for the quick reply!
You might not be doing anything wrong. When you add more zeros, it changes which frequencies have exact cycles in the time domain, which means that it introduces some non-stationarities, which ultimately smooths out the spectrum (this is part of the zero-padding theorem, which basically states that zero-padding in one domain is sinc-interpolation in the other domain). You might try zero-padding by an integer multiple. For example, if the original time series is N points long, then do a kN-point FFT, where k is any integer.
@@mikexcohen1 thanks again for the insight, defininitely there is so much more to zero padding than I know, I will check the theorem for more understanding.