The speciation phenomenon is the process used by the evolution to allow populations to become distinct species. The speciation is the primary cause of the complexity of the ecological network. Sympatric speciation concerns the rise of a new species from a surviving ancestral species while both continue to inhabit the same ecological niche or geographical region. In sympatric speciation, reproductive isolation evolves within a population in an ecological niche without the aid of geographic barriers. Different models have been proposed for alternative modes of sympatric speciation. The most popular was first put forward by John Maynard Smith in 1966 who suggested that in a given population homozygous individuals may, under particular environmental conditions, have a greater fitness than those with alleles heterozygous for a certain trait, eventually leading to speciation in the population. In this framework we assume an effective description of the speciation process based on a dynamical model for the populations in an ecological system. Our basic assumption is the existence of an ancestral population in an ecological niche that can express two phenotypes. In presence of certain environmental conditions one of the phenotypes has the propensity to separate from the original population in the reproduction process. Then new individuals may give rise to a new species in the ecosystem realizing a sympatric speciation. Due to the finite resources in the niche the populations are continuously competing each other's, and their numerousness fluctuates according to the changes of the environmental conditions. The effect of natural selection is introduced in the model by stochastic perturbations, that decrease the reproduction rate of the populations in the niche. We show some the dynamical properties of the system and we prove the existence of a threshold values in the environmental stress in order to observe the speciation process. We also discuss some biological implications of the model and the validation problem using empirical data.