> >"kaz" <37480@dsprelated> wrote: > >> I prefer to get fft without any zero padding. > >You are idiot. > >> Zero padding adds a sudden >> discontinuity to the signal implying some high frequencies. >. >With or without zero padding, discontinuity is still there. > >VLV > >true and added that to my first post immediately Kadhiem
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →
FFT, zero padding and DFT bins
Started by ●February 19, 2013
Reply by ●February 19, 20132013-02-19
Reply by ●February 19, 20132013-02-19
Chris Bore <chris.bore@gmail.com> wrote: (snip on zero padding for FFT, then I wrote)>> I have previously mentioned the book "Deconvolution of Images >> and Spectra" by Jansson:>> http://www.amazon.com/gp/product/0486453251/(snip)>> Unlike much of DSP, spectroscopy is done with intensity >> (usually called power in DSP). That is, the phase information >> has been lost. The book deals with non-linear deconvolution, >> where the fact that intensity can't be negative is used.> When I was doing it, in the early 1970s when Ernst's work was also > done, we used quadrature RF detection so the signal was inherently > complex and phase was preserved.For most things called spectroscopy, such as optical and X-ray, phase is lost. When I wrote that, I was thinking that it could be preserved for MRI, but wasn't sure.> The paper I quoted does not base its argument son the loss of phase. > However my work was in the early development of MRI (imaging, then > called 'zeugmatography') and so I only looked into the spectroscopy > issues as background to that. Zero padding, even though Ernst > recommended it, was even then not universally accepted and my own > view was that it came down to interpolation based on assumptions.The obvious linear deconvolution method: FFT data, divide by FFT of the point-spread-function, iFFT, fails if the FFT of the PSF goes to zero, and, with a little noise, when it is small. If you don't actually do that, but try to visualize the deconvolution (that is, look at a peak and imagine what source would generate it) it might be that some interpolation of the data would make that easier. If you look at enough spectra, I can certainly imagine that would start to happen after a while. The rule I remember from data analysis class is that one should interpolate on additional digit when reading, for example, an (analog) voltmeter. That is, one more digit than the scale gradations. -- glen
Reply by ●February 19, 20132013-02-19
Vladimir Vassilevsky <nospam@nowhere.com> wrote:> > "kaz" <37480@dsprelated> wrote:>> I prefer to get fft without any zero padding.> You are idiot.>> Zero padding adds a sudden >> discontinuity to the signal implying some high frequencies.> With or without zero padding, discontinuity is still there.If you have samples of a periodic function, with the transform length an integer mutliple of the period, then there is no discontinuity. It isn't so obvious how often that is true. I have wondered about using a PLL to generate a clock an appropriate multiple of one period, which should avoid the discontinuity. If you data is exactly periodic, but with a period not convenient for your FFT algorithm, zero padding generates a discontinuity not present in the original data. -- glen
Reply by ●February 19, 20132013-02-19
On 2/19/13 5:00 PM, Vladimir Vassilevsky wrote:> "kaz"<37480@dsprelated> wrote: > >> I prefer to get fft without any zero padding. > > You are idiot. >Vlad, you ain't very nice. sometimes, when you say this, the content might be accurate, but this time i don't think it is. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●February 19, 20132013-02-19
On Tuesday, 19 February 2013 22:24:55 UTC, glen herrmannsfeldt wrote:> Vladimir Vassilevsky <nospam@nowhere.com> wrote: > > > > > > "kaz" <37480@dsprelated> wrote: > > > > >> I prefer to get fft without any zero padding. > > > > > You are idiot. > > > > >> Zero padding adds a sudden > > >> discontinuity to the signal implying some high frequencies. > > > > > With or without zero padding, discontinuity is still there. > > > > If you have samples of a periodic function, with the transform > > length an integer mutliple of the period, then there is no > > discontinuity. It isn't so obvious how often that is true. > > > > I have wondered about using a PLL to generate a clock an > > appropriate multiple of one period, which should avoid the > > discontinuity.HP used to call that order processing - locking the sampling to some known cyclic characteristic of the system. Although I have been out of the field for some years, it is also what we used in MRI - locking the sample clock to the transmitted RF and the magnetic field gradients. It is used in medical ultrasound scanners - at least the one I last worked on - locking the clocks throughout the system so that the generated RF (ultrasound in this case) drives the sampling. In student exercises I use data that is sampled very much faster than 'necessary' - for example at 500 Ms/s for audio - and down-sample to simulate a similar effect (treating the high sample rate data loosely as effectively 'analog' for the purposes of learning). In the NMR and MRI cases, the 'discontinuity' is less of an issue since we know (or at least assume..) the signal decays as a series of superposed exponentials, thus there is a natural window imposed - which also allows a certain amount of cheating in the spectral interpolation since we know the spectral line shape of a decaying exponential is a Lorentzian. A lot of statements about DFT and FFT, I think, depend on implicit assumptions about the signals that have been sampled - assumptions that when questioned may often be seen to be incorrect and misleading. By this I mean of course to refer to the interpretation of the results of the DFT in terms of the signal analyzed and its 'spectrum' - the DFT itself is of course clear and fixed mathematically provided one agrees upon its definition.> > > > If you data is exactly periodic, but with a period not convenient > > for your FFT algorithm, zero padding generates a discontinuity not > > present in the original data. > > > > -- glen
Reply by ●February 19, 20132013-02-19
> >"kaz" <37480@dsprelated> wrote: > >> I prefer to get fft without any zero padding. > >You are idiot. > >> Zero padding adds a sudden >> discontinuity to the signal implying some high frequencies. >. >With or without zero padding, discontinuity is still there. > >VLV > >I happened to miss reading your first very impolite section. You are definitely a worthless mental who is used to squeeze out their filth in public. You are idiotic not to read my second immediate post that clarifies the very point you are after. You are idiot and so are those who encourage your sickening contributions. Kadhiem
Reply by ●February 19, 20132013-02-19
On Tue, 19 Feb 2013 13:35:53 -0600, "wond3rboy" <47228@dsprelated> wrote:>Zero padding the signal in the Time domain and computing its FFT results in >the frequency spectrum being sampled more densely. It does not affect the >Spectral(Frequency) Resolution of the resulting FFT since the added zeros >don't matter in the FFT computation. This however, does change the Visual >Resolution (have 'data points' between the original bins) and for a plot in >Matlab for e.g, I can move (read off) between two DFT bins. (Ofcourse the >plot is Matlab is a linear interpolation of the data points).As others have said padding with zeroes cannot add information. However in special cases it can be one way to determine a frequency with more precision than by merely taking the DFT bin with the highest power amplitude. But the only reason that works is if you assume that the frequency you are trying to measure is fairly isolated in the spectrum. Otherwise the bleed-over from nearby frequencies will obscure the peak amplitude that you are trying to detect. Padding with zeroes does add more bins spaced closer together. But the amplitudes in those bins become blurred with lots of spill-over into adjacent bins. Now it is true that one single frequency will produce a broad peak across a number of bins and the bin where the amplitude is maximized might be well defined, giving more resolution to the frequency measurement. But in a more general case with nearby components the blurring effect will move the peak so that the frequency is no better defined than if you had not used zero-padding in the first place. Another way of illustrating the non-magical powers of zero padding is to point out an alternative method of measuring the frequency of an isolated component without zero-padding. There are a number of bin interpolation formulas that use the amplitude of the peak together with the amplitudes of the two adjacent bins to calculate a likely frequency for the true peak. I have used one of those methods in a piano tuning application. In that application I am able to regularly get frequency measurements of components of a musical tone to an accuracy of about 1/10 of a DFT bin. As with the zero-padding, this works only because the frequency components are well isolated so they don't interfere with each other. If you had two frequency components that were only one DFT bin apart then you would not be able to determine their frequency to an accuracy any better than one bin regardless if you use zero-padding to make more bins or use bin interpolation based on three amplitudes. Robert Scott Real-Time Specialties Hopkins, MN
Reply by ●February 20, 20132013-02-20
Le mardi 19 f�vrier 2013 20:35:53 UTC+1, wond3rboy a �crit�:> I wanted to know if my understanding is correct. If so then do we say that > > the DFT resolution has increased by zero padding the signal? > > Shouldn't the DFT resolution mean the frequency resolution? >Hi, Resolution should not be confused with definition. If you take a picture with a high-end digital camera you'll get a picture with a lot of pixels. That's a high _definition_ image. But if the optical quality of the lens is poor, you will not be able to distinguish details : you'll have a high _definition_, low _resolution_ image. By padding zeroes you essentially improve the definition (more points in the spectrum), not the resolution (expect in the mentionned special cases of well-defined single tones). B.L
Reply by ●February 21, 20132013-02-21
On Tue, 19 Feb 2013 13:35:53 -0600, "wond3rboy" <47228@dsprelated> wrote:>Zero padding the signal in the Time domain and computing its FFT results in >the frequency spectrum being sampled more densely. It does not affect the >Spectral(Frequency) Resolution of the resulting FFT since the added zeros >don't matter in the FFT computation.You might benefit from studying the well-known Harris paper on windows: http://web.mit.edu/xiphmont/Public/windows.pdf The above is one of several available on the web. Note Section G on p. 57 where the author writes about �Minimum Resolution Bandwidth,� and defines it as: �we would be interested in the minimum separation between two equal-strength lines such that for an arbitrary spectral location their spectrum main lobes can be resolved.� Also note further down, the statement that begins: �The problem with this criteria � .� There are a number of other papers you should study, such as: A. H. Nuttal, �Some Windows with Very Good Sidelobe Behavior,� IEEE Trans. on Acoustics, Speech and Signal Processing, vol. ASSP-29, no. 1, Feb. 1981, pp. 84-91. and: R. J. Webster, �Leakage Regulation in the Discrete Fourier Transform Spectrum,� Proc. IEEE, vol. 68, no. 10, Oct. 1980, pp. 1339-1341. The Webster paper will mess with your head. In it, the author shows that leakage is a phenomenon of calculation. He shows that, by a proper choice and placement of a sum-of-cosines window, he can eliminate leakage beyond (or before) other bins in the spectrum when confronted with an interfering sinusoid. Yet another paper you should get is: http://mgasior.web.cern.ch/mgasior/pap/biw2004.pdf Pay particular attention to the third paragraph under �Measurements,� which begins: �The interpolation gain of 4700 � .� DFT 'resolution' depends on: 1) the specifics of the problem (eg: 1, 2, or 3 sinusoids, strengths, closeness, etc.), 2) what kind of window you're using, 3) what kind of technique (if any) you're applying (eg: estimating/subtracting sinusoids), 4) what kind of SNR you're dealing with. Some approaches for high SNR problems make no sense when dealing with low SNR problems. Without specifics, it's tough to formulate an answer. For simple zero- padding, you'll get more points in the frequency spectrum, but it won't necessarily help you answer the question: �Is that bump in the spectrum due to one sinusoid, or due to two equal-strength sinusoids that are so closely spaced that their peaks in the frequency spectrum have merged?� (and if they're not equal-strength, then that opens up another can of worms). Kevin McGee
Reply by ●February 21, 20132013-02-21
> >"kaz" <37480@dsprelated> wrote: > >> I prefer to get fft without any zero padding. > >You are idiot. > >> Zero padding adds a sudden >> discontinuity to the signal implying some high frequencies. >. >With or without zero padding, discontinuity is still there. > >VLV > > > >Hello, Just to clear another point. I wanted to know of any technical reason for computing a zero padded FFT. I can think of two, the fact that we are using a radix 2 FFT algorithm so we might be required to have the number of samples to be a power of 2 or in the second case, we might need better visualisation (say read two closely appearing signals from a FFT plot). Thanks.







