MATLAB analysis of spectral resolution in periodic graph and its improved method