# Correct way to get velocity and movement spectrum from acceleration signal sample

I have an acceleration signal sample and I need to get velocity and movement spectrum (amplitudes and phases) from it. I try to solve this problem in two ways:

1. First method
• Get FFT of acceleration signal.
• To get velocity amplitudes I divide each acceleration amplitude by $$2\pi f$$ and subtract $$\pi/2$$ from each acceleration phase.
• To get the amplitudes of the movement spectrum I divide each acceleration amplitude by $$4\pi^2f^2$$ and subtract $$\pi$$ from each acceleration phase.
1. Second method
• Using trapezoidal integration, I normalize the acceleration signal.
• I then take an integral of it to get the velocity.
• After this I take the FFT of the velocity.
• I then normalize the velocity and take the integral to get the movement.
• Finally I take the FFT of the movement.

The results obtained with these two methods are slightly different (spectrums amplitudes values). Which method is preferable to use?

Let $$T_s$$ be the sampling period, and $$v_i$$ the average speed in the interval $$i T_s < t < (i+1)T_s$$. Then $$v_i = (x_{i+1} - x_i) / T_s$$, assuming you have the correct initial position you can get $$x_{i+1}$$ from $$x_i$$ using the trapezoid integration rule.
From the properties of the Fourier transform, the spectrum of the time shifted position $$x_{i+1}$$ is $$e^{-2j \pi f T_s} X(f)$$, if $$f = k / (N T_s)$$, $$N$$ being the number of samples for the FFT. And one can derive the spectrum of the speed as
$$V_k = \frac{e^{-2j\pi k / N} - 1}{T_s} X_k$$