Accurate localization in indoor environments with ultra-wideband (UWB) technology has long attracted much attention. However, due to the presence of multipath components or non-line of sight (NLOS) propagation of the radio signals, it has been converted to a critical challenge. Existing solutions use many fixed anchors in the indoor environment. Particularly, large areas require many anchor points and in the case of unexpected events that lead to the destruction of existing infrastructures, the fixed anchor points cannot be used. In this paper, a novel localization framework based on the transmitting signal from a mobile UWB sensor outside of the building and its received signal regarding the modified Saleh Valenzuela (SV) channel model is presented. After preprocessing the received signals, two new procedures to reduce the ranging error caused by multipath components are proposed. In the first procedure, two machine learning algorithms including multi-layer perceptron (MLP) and support vector machine (SVM) using the extracted features from the received UWB signal time and power vectors are implemented. Moreover, in the second procedure, two deep learning algorithms including MLP and convolutional neural networks (CNNs) using the received UWB signal time and power vectors are implemented to improve the performance of the indoor localization system. The simulation results show that the architecture designed for the convolutional neural network based on the hybrid dataset (the combination of the dataset related to received UWB signal time and power vectors) provides a mean absolute error (MAE) of about 3 cm.