I assume that the Nyquist theorem doesn't apply, at least not in the standard sense, for a non-bandlimited signal. In my case, I sample the signal (in the time domain) above the Nyquist rate and then take the FFT up to the Nyquist frequency. How should I take into account the fact that my signal isn't bandlimited?
-
10$\begingroup$ If the signal is not bandlimited, how do you sample it above the Nyquist rate? That's a contradiction. $\endgroup$– MBazCommented May 10, 2022 at 14:09
-
1$\begingroup$ @MBaz. Assume physics does not apply and you can sample continuously in time :) $\endgroup$– Mad PhysicistCommented May 10, 2022 at 23:46
-
$\begingroup$ Your assumption is simply incorrect. Nyquist always applies. It either tells you what the band limiting should be, or what the effects will be if you're not band limited. $\endgroup$– Mark RansomCommented May 11, 2022 at 2:12
-
1$\begingroup$ @user253751. Yup. Too bad everything we have besides pure math is finite. $\endgroup$– Mad PhysicistCommented May 11, 2022 at 11:40
-
1$\begingroup$ You have to bandlimit the continuous-time signal first. Then sample the signal properly. Then FFT. $\endgroup$– robert bristow-johnsonCommented May 11, 2022 at 20:30
4 Answers
In the real world, there is always some amount of aliasing, because no real signal is actually bandlimited.
In many cases, the signal spectrum tends to zero relatively quickly as the frequency increases. With a proper selection of sampling frequency, aliasing (and the corresponding distortion) can be kept within acceptable levels.
In other cases, the signal's spectrum rolloff to zero is very slow -- an example would be trying to sample white noise. Directly sampling the signal at any practical sampling rate results in unacceptable aliasing. What one does is to filter the signal first, and then sample. This results in information loss, but at least the frequency band of interest was properly sampled.
To directly answer your question (corroborating what Dan said): if you're not in one of these two scenarios, the signal is not properly sampled: the samples do not correspond to the signal and it is essentially impossible to perform any useful signal analysis using them.
-
1$\begingroup$ I don't understand why such aliasing isn't treated as an irrelevant technicality. A signal can be perfectly 1Hz over a finite duration, and if we sample it over that duration, then we have a perfect 1Hz sine, without distortions that are implied by aliasing. Just because "finite = infinite bw for continuous FT" doesn't mean "all real world signals are distorted", as such descriptions imply. Isn't it better to reserve the word for when we have actual uncertainty for peak frequency over a finite duration? $\endgroup$ Commented May 10, 2022 at 16:48
-
3$\begingroup$ The problem with the 1Hz sine is when you try to re-generate the continuous-time signal from its samples: the interpolation will fail at the start and end of the signal. Regarding distortion, the fact that this distortion is acceptable in many cases is what makes DSP useful in the first place. In a well-designed system aliasing is an irrelevant technicality. It was not clear from the OP's question whether the aliasing in their system is irrelevant or significant. $\endgroup$– MBazCommented May 10, 2022 at 17:23
-
$\begingroup$ @MBaz +1 Thank you very much. Could you please elaborate on how to determine the proper sampling in either of the two cases you mentioned, as well as how to determine what the filter should be? Signal processing is quite new to me. $\endgroup$– user62718Commented May 11, 2022 at 3:12
-
$\begingroup$ To add on to my previous comment, I guess the distinction between the two cases is somewhat arbitrary, and in the case #2, you probably apply a low-pass filter or something like that. Is that correct? But why do you sample afterward? I thought the signal was already sampled in the time domain, you take the FT, and then apply the filter to the output. Could you sample first and then apply the filter? Sorry for being dense, but I don't have a signal processing background. $\endgroup$– user62718Commented May 11, 2022 at 3:49
-
2$\begingroup$ @OverLordGoldDragon You are reading things in my post that I didn't say. Also: the sampling theorem (what the original question is about) is all about reconstruction from the samples. And: most signals of interest tend to zero both as $|t| \rightarrow \infty$ and $|f| \rightarrow \infty$. $\endgroup$– MBazCommented May 11, 2022 at 14:56
If your signal is not band-limited prior to sampling, then without any further information (such as a copy of the signal sampled at a time offset, which could synthesize a higher sampling rate), irreversible “damage” is done to the waveform via aliasing: each sample contains energy from all Nyquist zones and the FFT will properly reflect this result. It is simply a many to one mapping so nothing further can be done without other information. An analogy is x+ y = 5; we know the sum but without a second formula we cannot distinguish x from y —- so in this case without other information about the signal we cannot know what Nyquist zone in the continuous time domain the signal originated. "Other information" can be what filtering was used or other copies of the waveform with different sampling that was done concurrently (or repeatably sampled if we know other details of the waveform such as ergodicity and stationarity). In most cases we are sampling the waveform to determine its characteristics but noting that there are situations where other information can be used. This last point can be more confusing so should not distract from understanding the aliasing mechanism when sampling signals and understanding the need for band selection filtering prior to sampling.
The bottom line to avoid aliasing is that the signal must be band-limited to be within one Nyquist zone prior to sampling (including the possibility of bandpass filtering higher Nyquist zones when the analog input bandwidth of the ADC allows for bandpass sampling).
The same condition exists when decimating or resampling the signal- prior to down-sampling, the higher sampled waveform must first be band-limited to be within one Nyquist zone for the lower sampling rate.
In real life (as opposed to mathematical fictions) there is always noise (thermal and quantum at the limit), measurement errors, finite durations of operation, finite precision data types and arithmetic, etc., among other limitations, creating a noise floor.
So in practice, one considers a signal to be band limited if all the spectrum above the band limit frequency is thought to be below the desired or assumed noise floor. Or considers the portion of the spectrum above the band limit frequency to be noise contributing to the measurement and computational noise floor.
So you take your FFT by taking an FFT. But your FFT result becomes fuzzy by up to the maximum of that floor, or is fuzzy by about some statistic of that noise floor, due to the aliasing of that above bandlimit frequency noise into the spectrum (FFT result bins) of interest.
The FFT is an efficient computational algorithm implementing the DFT (discrete Fourier transform) performing an orthogonal transform on a finite discrete data set. There is no way to "improperly" take it. It is nonsensical to talk about "bandlimited" "signals" in connection with an FFT; for example, it is employed as an integral part in very large multiplication algorithms that have nothing whatsoever to do with band-limited signals but rely on it for diagonalisation of circulant matrices.
What is covered by the Nyquist theorem is discrete-time equispaced sampling. FFT is a red herring other than that "band-limited" tends to be defined in terms of the continuous time-unlimited Fourier transform which is somewhat related to the DFT but is an analytical rather than computational tool.
Certain approximations of Fourier transform related information, like the overlapped windowed short-time Fourier transform, give some useful interpretations of relevant signal characteristics.
But there is no way to handwave your problem around those interpretations in general terms: how useful readings of those computational readings are depends on the kind of task you are trying to address, and bandlimitations and/or aliasing are artifacts in connection with your sampling process and are not really affecting the validity of the subsequent analysis of the data other than by the GIGO principle (garbage-in, garbage-out).