How Do you Correct for a Time Delay between Multiple Signals?Notes

When comparing phases using the cross power spectrum, any relative time delay between signals introduces a systematic, frequency-dependent phase offset. A time shift in the time domain corresponds to a linear phase shift in the frequency domain, proportional to angular frequency. Because phase is a linear quantity, this offset can be corrected by adding a simple term, ω t_d, to the measured phase difference. The note derives this relationship from the Fourier transform and Euler’s formula, and provides a physical interpretation in terms of wave propagation and frequency-dependent phase behavior.

May 2021 · Oana Vesa

Difference between arrays in Python and IDL

Python and IDL store and interpret multi-dimensional arrays using different axis orderings, which leads to apparent transposition when visualizing the same FITS data. In Python, FITS files are typically read as (t, y, x), whereas IDL uses (x, y, t). Although both languages use zero-based indexing, their axis conventions differ. The note shows how to use a simple transpose operation in Python to reorder the array dimensions and recover IDL-style (x, y, t) ordering for consistent comparison and analysis.

May 2021 · Oana Vesa

IPython Path

The note describes how conflicting Python and IPython installations can cause missing library errors when invoking IPython from the shell. By inspecting all available IPython executables using which -a ipython, the underlying path precedence issue can be identified. Instead of modifying system paths, the solution uses python -m IPython to explicitly launch the IPython instance associated with the desired Python environment, in this case Anaconda. An alias is then added to the shell configuration to enforce this behavior consistently while minimizing the risk of destabilizing existing Python setups.

April 2021 · Oana Vesa

Does the order of the signals matter when computing the cross power and phase?

The cross power spectrum is defined as the product of the Fourier transform of one signal and the complex conjugate of the other. Swapping the signal order leaves the real part of the cross power unchanged but reverses the sign of the imaginary part. As a result, the phase difference changes sign while its magnitude remains the same. Therefore, the signal order matters only through the chosen phase convention; for most physical interpretations that depend on phase magnitude, the ordering does not change the result.

April 2021 · Oana Vesa

Normalizing a Fourier Transform

The note clarifies that NumPy and SciPy apply normalization only in the inverse DFT, and shows how to explicitly normalize the forward transform for consistent amplitude and power interpretation. It defines appropriate normalization factors for the Fourier transform, amplitude spectrum, power spectrum, and power spectral density, with attention to units and sampling frequency. The discussion also extends to multi-dimensional FFTs and shows how normalization must be modified when window functions are applied, ensuring physically meaningful and comparable spectral estimates.

April 2021 · Oana Vesa

Python's FFT

The note presents the exact DFT conventions used by NumPy and SciPy, explicitly defining the normalization, sign conventions, and index roles in the forward and inverse transforms. It connects the discrete formulation to the continuous exponential form, interprets the meaning of each index and parameter, and clarifies how discrete frequency, cycles per sample, and angular frequency are related. The goal is to make Python’s FFT conventions transparent and avoid common sources of confusion when interpreting spectral results.

March 2021 · Oana Vesa