Because of the range-angle dependency in random log frequency diverse array(RD-log-FDA)radar,a method for designing beamspace transformation matrix in angle and range based on the receive signal has been proposed.It is demon-strated that the designed beamspace transformation matrix ba-sically meets the requirements of beam gain.However,there are some problems in the transformation matrix designed,such as unstable beam gain and high sidelobe.Hence,we propose an optimization method by adjusting array element spacing and random number in frequency offset to get the optimum beam gain.Therefore,particle swarm optimization(PSO)is used to find the optimal solution.The beam gain comparison before and after the optimization is obtained by simulation,and the results show that the optimized array after beamspace preprocessing has more stable beam gain,lower sidelobe,and higher resolution in parameter estimation.In conclusion,the RD-log-FDA is capable of forming desired beam gain in angle and distance through beamspace preprocessing,and suppressing interference sig-nals in other areas.