# low frequency issue with noise spectrum (of derivative)

I have hard time in understanding the results I get when I plot the spectrum of the time-derivative of a noise signal:

$|DFT[\frac{dx(t)}{dt}](\omega)|^2$

as a function of frequency $\omega$ (see image below), where $DFT$ is the discrete Fourier Transform, $x(t)$ is a discrete time serie of random samples extracted from a gaussian distribution.

In python:

import numpy as np
import matplotlib.pyplot as plt
x = np.random.randn(100000)
F = np.abs(fft.fft(np.diff(x)))**2
plt.loglog(F[:50000])


The F.transform of a derivative is $i\omega$ times the F.transform. So I'd expect the result to be $\omega^2 |DFT[x]|^2$.

This happens, but what are the features at low frequency? If I run the script several times, a plateau shows up at low frequency, but not always with the same amplitude and not always at the same low frequencies (see in the fig. the differences between various runs of the same script). Probably something strange happens also at high frequency? I heard "leakage" can explain things like this, but I'n not an expert. Can you help me to understand, and correct it?

• plot your data on a linear frequency scale and look at 0 to 40 Hz. The fft is linear in frequency and you’re stretching the low frequency bins on your log frequency plot
– user28715
Oct 30, 2017 at 21:43
• @StanleyPawlukiewicz Changing scale does not change the result. In loglog, $\omega^2$ is the diagonal line with the right slope in the figure, so loglog is useful. The plateau shows up more clearly in loglog Oct 31, 2017 at 8:16

 N = 32*256;                       % Length of the time domain signal
figure,plot(linspace(-1,1,N),Px)  % plot the $DFT|^2 from -pi to pi title('Simplified Periodogram'); % QUADRATIC behaviour is recognised. xlabel('Normalized Frequency (x \pi rad/sample)'); % No DC plateau ? % LOG-LOG plot. figure,loglog(10E3*wk(N/2+1:end),Px(N/2+1:end)) % Alternatively: compute PSD based on time-domain signal pX = fftshift(j*wk.*X); % DFT of the derivative dx = real(ifft(pX,N)); % time-domain signal from I-DFT figure,periodogram(dx,hamming(N)); % compute & display its Periodogram figure,pwelch(dx); % compute & display its Welch  The resulting plots are: The loglog plot of MATLAB is the following: there is no DC plateau here. I believe it's your diff function which adds the DC content to your differentiated data. You should apply the DSP standard diagnostic procedure to investigate your case and find out which step deviates from the expected behaviour... • but it seems you take the fft(derivative) already as$\omega^2 fft(x)^2$. I would like to know why (fft(diff(x)))^2 is not equal to$\omega^2 fft(x)^2\$ at low frequency Oct 31, 2017 at 8:20
• They should be equal but where is (fft(diff(x)))^2 inyour code ? Oct 31, 2017 at 9:20
• Hmm now you have a different code... So the results must be the same provided that the function diff(x) indeed returns the samples of the differentiated time domain signal. The only mismatch is due to the display plot funciton being loglog. (I assume that your random number generator is also compatbile with Matlab's...) Oct 31, 2017 at 15:38