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) in C order, so each channel's N=65536=216 samples occupy one contiguous block of memory, with the sample index as the last, innermost axis.
((a)) Using the operation-count scaling Nlog2N derived from the even-odd split of the DFT, and the direct-sum cost N2, 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 over the constants a and b (the least-squares normal equations obtained by setting the gradient to zero). After this detrending, one channel has sample variance 0.64V2 and was sampled at fs=20kHz. Treating the detrended residual as white noise, state its one-sided power spectral density level in V2Hz−1, and verify Parseval's check by integrating this level from 0 to the Nyquist frequency.