In order to solve the structural dynamic response caused by nonzero initial condition and external load in the discrete frequency domain, a new frequency domain algorithm is constructed. The discrete Fourier transform (DFT) of Diarc δ function and its first derivative is derived based on the Fourier transform (FT) and finite difference formula. With this new algorithm, the numerical divergence of dynamic response caused by nonzero initial displacement in the traditional frequency domain algorithm is effectively overcome. Three numerical examples are used to further study the performance of this algorithm. They are a linear system of single degree of freedom (SDOF), a 4 000-DOF truss structure, and a cantilever beam with concentrated mass at the top, respectively. These structures all have nonzero initial displacement and initial velocity. The numerical results show that the improved frequency domain algorithm provides consistent results with the traditional numerical method, and has higher accuracy and efficiency, which is suitable for solving the dynamic response of various linear vibration problems.