Phase shift by arduinofft is not corrected

Use a cross-correlation function for that. Example: