This paper proposes a new Matlab-developed algorithm for automatic recognition of digital modulations using the constellation of states. Using this technique the automatic distinction between four digital modulation schemes (8-QAM, 16-QAM, 32-QAM and 64-QAM) was made. It has been seen that the efficiency of the algorithm is influenced by the type of modulation, the value of the signal-to-noise ratio and the number of samples. In the case of an AWGN noise channel the simulation results indicated that the value of SNR (signal-to-noise ratio) has a small influence on the recognition rate for lower-order QAM (8-QAM and 16-QAM). The length of the signal may change essentially the recognition rate of this algorithm especially for modulations with a high number of bits per symbol. Consequently, for the 64-QAM modulation in a case of 25dB signal-to-noise ratio the recognition rate is doubled if the sample rate is incresed from 5400 to 80640.