6 ms·
Can't edit, but I just realized that when you go from continuous to discrete via the sampling step you also introduce replication in the frequency domain. So yo
by krackers 4y ago
Can't edit, but I just realized that when you go from continuous to discrete via the sampling step you also introduce replication in the frequency domain. So you have
Continuous sin wave: Spectrum is a single dirac
Sampling: Infinite samples of sin wave - spectrum is periodic train of impulses
Windowing: Fixed number of samples - spectrum is sinc convolved with that impulse train. The DTFT would end here.
DFT: Windowed samples are then periodically extended - spectrum is spectrum of DTFT multiplied by a comb.
Even assuming nyquist is satisfied, the tails of the sinc would still interact with each other, so the shape of the DTFT isn't _just_ a sinc, right? It'd be almost a sinc but with some additional wonkiness from the tails?
- geokon 4y agoI understand what you're saying on a high level, but it's tricky for me to then translate that into practice One issue is that all this interactive stuff always just give you a "Frequency Domain" when really you have complex values and weights. At the end of the day I need to find a way to work backwards. From a sinc ringing back to both a frequency and phase. Say I have data that's got some high frequency relatively low amplitude noise and I have say several thousand samples. The samples in my case are actually not exactly evenly spaces in time unfortunately, but I can interpolate. And I want to extract a strong very low frequency component. It's got maybe 10 oscillations in my dataset. If I do an FFT I'll get some sinc around 10Hz. There is other stuff in the spectrum, but not much around 10Hz. Now I want to work from that sinc and get back to an original frequency and phase. How do I go about that? (without truncating my data) In my usecase it might be a bit trickier. There are probably several distinct frequencies but the phase need to be known very accurately. Normally when playing with FFTs it's a bit problematic when it comes to determining frequency b/c the naiive interpretation limits you to discreet values. But when it comes to the phase offset there is no such limit. The limit is determined by the accuracy of your input (though I don't actually know how to go from data error-values to a phase error-value. The error propagation is a little confusing to calculate)
- krackers 4y agoI'm not quite sure I follow: evaluating the fourier transform (whether continuous or discrete) at a given frequency omega gives you a complex value that encodes both the magnitude and the phase. Usually for the sake of plotting we just take the magnitude of this. Given these values for all frequencies, the FT et al. are perfectly invertible and you'll get back to your original sampled signal. But it seems like you want to go from the spectrum of the windowed signal to the spectrum of the "true" signal. I.e. undo the effects of the sinc ringing, which would involve reconstructing a posteriori the most probable signal. I don't know much here, but for DTFT maybe deconvolution techniques are something to look at? Alternatively for the DFT since we only have information about discrete frequencies, some sort of technique that tries to interpolate samples at the edges to ensure the periodic summed waveform doesn't have discontinuities?
- krackers 4y agoOh also this is only semi-related, but the following is also really unintuitive to me: given a windowed function, it could have been constructed from any number of possible functions. But in the fourier domain, we're guaranteed that the spectrum of the windowed function is simply the spectrum of the original function convolved with sinc (which I just think of as "smoothing"). So the paradox is that the portions of the original function outside of the window can be "anything", even something completely wonky, and yet somehow when convolving its spectrum with sinc we always end up with the same thing. Trying to puzzle this out: Let the "original" function be a superposition of the windowed portion like f1 and a non-windowed portion like f2: orig = rect * f1 + (1 - rect) * f2 Then we have F{orig} = F{rect * f1} + F{(1 - rect) * f2} Now F{1 - rect} is (dirac - sinc) so we have F{orig} = F{rect * f1} + F{(1 - rect) * f2} = F{f1} ⊛ sinc + (dirac - sinc) ⊛ F{f2} Since convolution is distributive F{orig} = F{f1} ⊛ sinc + (dirac - sinc) ⊛ F{f2} = (F{f1} ⊛ sinc) - (F{f2} ⊛ sinc) + F{f2} The above I've plotted to verify, and it's intuitive so far. rect * orig = f1 F{orig} ⊛ sinc = sinc ⊛ ((F{f1} ⊛ sinc) - (F{f2} ⊛ sinc) + F{f2}) = sinc ⊛ (F{f1} ⊛ sinc) - sinc ⊛ (F{f2} ⊛ sinc) + F{f2}) = sinc ⊛ sinc ⊛ F{f1} - sinc ⊛ F{f2} + sinc ⊛ sinc ⊛ F{f2} But sinc ⊛ sinc = sinc (easiest to see in the fourier domain), so the second terms cancel out and we get = sinc ⊛ F{f1} So I think the real magic here is that for any function f(x), f(x) - sinc ⊛ f(x) is a function that gives 0 when again convolved with sinc. The math works out so that sinc is precisely the function which captures that "uncertainty" as to what the portions outside the window are. Really mind-blowing. --- But back on topic to your question, note that even truncating your data doesn't get rid of the sinc ringing, it's always there as an artifact of the windowing, it's just not always revealed by the discrete sampling of the spectrum. The sinc ringing itself tells you the measure of uncertainty. In terms of how to practically use this information of a DFT though, probably just taking the spectrum values of magnitude above sinc main-lobe/side-lobe ratio would be good enough? Or interpolate the DFT values to reconstruct the DTFT spectrum and then resample it yourself? I can't be of much help here, I'm more comfortable with the theory than practical usage.