Measuring traffic in real time is one of the main functionalities of Smart Cities. To reduce the costs of deployment and operation, traffic measurement with mobile devices has been widely studied. In this paper, a traffic monitoring system using mobile devices is proposed. The proposed algorithm has the advantage of having a very low computational cost, allowing most of the preprocessing being done in the mobile device and therefore making possible the centralized collection of a massive number of measurements.