Coherent sampling 2026-11-05
Coherent sampling records an integer number of cycles of a periodic signal in the observation interval used for a discrete Fourier transform. For equally spaced samples at sampling rate , a single sinusoidal frequency is coherent whenThis is a frequency-and-record-length condition, not merely starting the acquisition at a particular phase.[ref]
Coherent Sampling vs. Window Sampling by Analog Devices. What Defines Coherent Sampling?, integer-cycle relation
For the complex tone , the unnormalized discrete Fourier transform givesA real cosine has the corresponding positive- and negative-frequency bins. The cancellation follows from a finite geometric sum; arbitrary phase does not spoil it. Periodic continuation means , not that the last stored sample must equal .
For example, and make a tone coherent, while is off the DFT grid. The latter's rectangular window record generally has spectral leakage into multiple bins. The bin spacing remains in both cases: coherence has not changed the grid spacing or increased the record duration.
Choosing relatively prime to can help an analog-to-digital converter test sample more distinct input phases, but it is an additional condition. A -cycle tone in samples is coherent even though its sampled phases repeat after only samples. The manufacturer's application note discusses the irreducible-ratio choice separately from the integer-cycle equation.[ref]
Coherent Sampling vs. Window Sampling by Analog Devices. Figure 1 explanation, cycle count and irreducible ratio
An experiment must also maintain the required ratio over the record. Frequency drift or clock variation can invalidate a nominal setting. If coherence cannot be maintained, a different window function can reduce leakage, with changes to amplitude scaling and spectral spread accounted for through the coherent gain of a window.
Sampling at makes a frequency indistinguishable from , since the extra phase is . For a real sinusoid, reflection to also gives an alias, up to phase. For example, a cosine sampled at has exactly the samples of a cosine. A measured low-frequency feature can therefore originate above the instrument's Nyquist frequency.
To reconstruct an arbitrary baseband signal limited to bandwidth , sample strictly above and use an analogue anti-aliasing filter before the sampler. A practical filter needs a transition band, so merely choosing a nominal rate is insufficient. frequency components already folded together cannot in general be separated by later digital filtering. aliasing from insufficient sampling is distinct from spectral leakage caused by a finite observation window.
In this digital-sampling context, Nyquist's theorem means the Nyquist–Shannon sampling theorem. A continuous signal with no Fourier content outside can be reconstructed from uniformly spaced samples taken sufficiently fast. The familiar practical condition isHere is the Nyquist frequency, while is the Nyquist rate required by that signal bandwidth. A finite-energy bandlimited formulation allows equality; a rule intended to include arbitrary pure sinusoids at the boundary must be strict, because vanishes at every sampling time .
The mechanism is visible in the Fourier transform. Sampling by a time comb creates shifted copies of the original spectrum, separated by :If those copies do not overlap, an ideal reconstruction filter selects one copy and recovers the original waveform. Equivalently, ideal interpolation uses the normalized sinc function:Each interpolation function is one at its own sample and zero at all other sample times. Exact reconstruction presumes the bandwidth condition, an ideal sampling clock and the full sample sequence.
If the spectrum extends beyond half the sampling rate, different continuous frequencies become indistinguishable: this is aliasing. A sinusoid at frequency is indistinguishable on the sampling grid from frequencies differing by integer multiples of , with the usual sign reflection for real signals. For example, sampled at aliases to ; a later digital filter cannot tell which signal generated those samples.
Use an analogue anti-aliasing filter before the analogue-to-digital converter and choose a sampling rate leaving room for its finite transition band. Faster sampling can relax that analogue filtering problem, but simply increasing the number of samples in a fixed-duration record does not improve the independent Fourier-bin spacing beyond approximately . A long recording is needed for low-frequency resolution, while a small sampling interval is needed for high-frequency coverage. Finite records also introduce windowing and spectral leakage.
Digitization adds amplitude quantization as well as time sampling. An ideal -bit converter spanning voltage range has step . When quantization error may be modeled as independent and uniform across one step, its rms size is ; small coherent signals need not obey that white-noise approximation. Sampling rate controls temporal ambiguity, recording duration controls frequency resolution, and converter resolution controls amplitude discretization.
The source text and its figure are inconsistent here. The plotted low-frequency maximum in W is near , rather than the printed . The original PDF shows that this discrepancy is already present in the examination, rather than introduced by transcription.
Machine 2 records only about half a year. Its first nonzero discrete Fourier transform bin is therefore atThe annual component near is below that first bin. The finite window function spreads it through spectral leakage, with a prominent first-bin contribution. This explains the plotted peak without invoking a new physical period.
Peak phasor versus positive-frequency Fourier coefficient distinguishes a real sinusoid's reconstruction amplitude from one coefficient in its two-sided exponential expansion. For ,Thus the positive-frequency Fourier coefficient is half the peak amplitude phasor. The negative-frequency coefficient is its conjugate. A real sinusoid needs both; a complex exponential input has a different one-sided reconstruction.
The distinction also controls a sampled record. For evenly spaced samples of a real sinusoid with exactly cycles in the record and , use the unscaled forward discrete Fourier transformOrthogonality of the discrete exponentials gives . ConsequentlyThe default SciPy forward FFT has exactly this unscaled convention; its forward and orthonormal modes have different factors.[ref]
SciPy 1.16.2 documentation. scipy.fft.fft, Parameters: norm; Notes: forward sum and real-input symmetry
For an original example, sample volts. Then volts and volts. Dividing by 64 gives the positive-frequency coefficient volts; doubling it recovers the peak phasor. The RMS amplitude is volts.
These exact relations assume coherent sampling of the stated sinusoid without aliased extra components. DC and, for even , the Nyquist bin do not have distinct conjugate partners and must not be doubled. With a noninteger number of cycles or a windowed record, finite-record phasor extraction with coherent sampling must be distinguished from a generic bin readout; spectral leakage and the window's amplitude normalization alter the estimate. The parent peak amplitude phasor specifies the continuous-time convention before any sampled transform is chosen.
Rectangular window 2026-11-05
A rectangular window keeps all samples in a selected finite record with equal weight and sets the signal outside it to zero. For discrete samples, for and zero otherwise. Calling this no taper does not remove the effect of having a finite record. SciPy's primary implementation documentation identifies the boxcar and rectangular window as this same all-ones choice.[ref]
Its discrete-time Fourier transform at frequency in cycles per sample is a finite geometric sum:At integer , the limiting value is . The first zeros surrounding the central maximum are at , so the central zero-to-zero width is . The phase factor depends on the record's time origin; the magnitude response does not.
For a continuous centered record of duration , on has transformwhere the normalized sinc function is . Multiplication by the finite window spreads a sharp spectral component according to this response, producing spectral leakage.
An original finite-record example quantifies an off-bin amplitude error. A complex tone of amplitude lying half a DFT bin from the nearest sampled frequency has normalized responseAt the ratio is about , or relative to the coherent peak. The coherent gain of a window is still one; it does not correct this scalloping loss. Zero-padding samples the same frequency response more densely rather than lengthening the measured record.
For independent equal-variance sample noise, rectangular weighting has equivalent noise bandwidth of one DFT bin under the usual coherent-amplitude normalization. A Hann window suppresses distant sidelobes but changes the central width and noise scaling. The primary analysis manual reports these separate window properties rather than one universal best window.[ref]
A proposed test records a known sinusoidal input with an integer and then a non-integer number of cycles in the same record length, holding the sampling rate and amplitude fixed. Compare the raw DFT bins and the continuous window response. This separates finite-record leakage and bin placement from aliasing, which involves a different sampling ambiguity.
Spectrogram Created 2026-10-18 Updated 2026-11-05
A spectrogram displays a signal's changing local frequency spectrum, usually by color proportional to squared short-time Fourier transform magnitude. With window function , one convention isThe window selects a neighborhood of time before taking its Fourier transform. A sinusoid gives a persistent frequency ridge, while a brief pulse spreads across frequencies and occupies a short time range.
A longer window separates nearby persistent frequencies more clearly but mixes events across a longer interval. A shorter window localizes transients but broadens their spectral features. Changing the window function changes this tradeoff and the spectral leakage. Zero padding can sample the displayed frequency curve more finely; it does not add observed data or restore the resolution lost through a short measurement interval. The phase is discarded in the plotted squared magnitude, so the spectrogram should not be confused with a complete set of complex transform coefficients.