We studied the Raman scattering in a magnetized plasma by one-dimensional particle-in-cell (PIC) simulations in non-relativistic regime. It is found from the X-mode dispersion relation that the frequency of the backward scattered wave is downshifted by an amount of upper hybrid frequency, while that of the forward scattered wave merely depends on the magnetic field. We propose such a spectral difference be used to measure simultaneously the plasma density and magnetic field of magnetized plasmas. The idea was verified by a series of PIC simulations, where we used the directional field splitting method to obtain accurate peak position of the scattered waves' frequencies. We compared the frequency shift and the growth rate of the scattering from theory and simulations to obtain reasonably good agreement between them for different external magnetic fields.