I applied Fourier transform on a sound (PCM generated digitally with sin function) and frequency detection is accurate. However, if I play the sound and record it, and then apply a Fourier transform to detect frequencies, my results are nowhere close to original results. The window size I have chosen for Fourier transform is 30 samples. ( Sampling frequency is 44100 Hz and 30 samples represent a symbol. Each symbol frequency is shifted by 1470 Hz.). Is my approach right ?
That's to be expected. If the input of your FF transform is 30 (real) points, you also get 30 real amplitudes out, for 30 different frequency bins. Each bin is (44100/2)/30 Hz wide, or about 700 Hz. That is quite wide. Add to that the effect of spectral leakage, which may quite well extend for 5 bins in either direction. 10 out of 30 bins will contain the ground frequency. Any higher harmonics will add to that.
Normally, people use much longer FFT's. 256 is quite a common choice, and 1024 isn't unheard of either.