A real-time method and system to accurately demarcate sub-territories of the subthalamic nucleus area in the brain during surgery, based on microelectrode recordings and a Hidden Markov Model. Root mean square and power spectral density of the microelectrode recordings are used to train and test Hidden Markov Model in identifying the dorsolateral oscillatory region and non-oscillatory sub-territories within the subthalamic nucleus. After the dorsolateral oscillatory region in the subthalamic nucleus is mapped, the microelectrodes are removed, and a macroelectrode is inserted in the mapped dorsolateral oscillatory region for producing deep brain simulation for treatment of Parkinson's disease.