A 64-channel detector stores its output in a NumPy array of shape in C order

PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Scientific programming for physicists · Scientific programming for physicists

Scientific Computing for Physicists, Ch Spectra with error bars: the fast transform, convolution and spectral estimation

Problem

A 64-channel detector stores its output in a NumPy array of shape (64, 65536)(64,\,65536) in C order, so each channel's N=65 536=216N=65\,536=2^{16} samples occupy one contiguous block of memory, with the sample index as the last, innermost axis. ((a)) Using the operation-count scaling Nlog⁡2NN\log_2N derived from the even-odd split of the DFT, and the direct-sum cost N2N^2, estimate the ratio of direct to fast cost for transforming one channel, and confirm that the same ratio holds for all 64 channels transformed together. ((b)) Before transforming, the linear drift of each channel is removed by minimising the sum of squared residuals ∑n(xn−a−bn)2\sum_n (x_n - a - bn)^2 over the constants aa and bb (the least-squares normal equations obtained by setting the gradient to zero). After this detrending, one channel has sample variance 0.64 V20.64\,\mathrm{V^2} and was sampled at fs=20 kHzf_s = 20\,\mathrm{kHz}. Treating the detrended residual as white noise, state its one-sided power spectral density level in V2 Hz−1\mathrm{V^2\,Hz^{-1}}, and verify Parseval's check by integrating this level from 00 to the Nyquist frequency.

Browse the problem library