A Fourier based numerical method for computing the dynamic permeability of periodic porous media