# How to find frequency and phase shift in the recorded wave( .wav file )

I am working on BPSK at frequecies near 20 kHz with a sample rate of 44100 Hz.

We can't afford sample rates above than this due to computational complexities.

Have found that the frequency of recorded wave is also changing with different set of information, like for example if I send all zeros there was a frequency difference of 5 Hz between carrier and recorded wave and if I send random data it is around 400Hz.

I am extending my work after this Periodically-varying phase between transmitted sound and received sound.

So to do the phase correction while demodulation, frequency correction is also needed. So my question is:

• Is there any better digital implementation for my case to do the carrier recovery at receiver side?

I tried Phase locked loop implementations but found that before sending the wave into PLL block of code I have to multiply the received signal and carrier signal then send them into a squaring block and then Band pass it to get a $2f_c$ signal¹.

But for implementing this method when I do the squaring my sample rate of 44100Hz is not sufficient for the doubled frequency ($2\cdot20000$ Hz).

So I need help in either a way I could manipulate this sample rate problem like downsampling first then doing squaring (which I dont think it works) or any other carrier recovery methods to get a best estimate of received wave frequency and phase difference.

¹ method is in the book C. Richard Johnson Jr, William A. Sethares, Andrew G. Klein-Software Receiver Design_ Build Your Own Digital Communication System in Five Easy Steps-Cambridge University Press (2011)

• I made a few ortorgraphical correction; really, "Hertz" is abbreviated "Hz", not "hz"! But: I'm pretty sure you mean sample rate, not frame rate, right? Jul 12 '16 at 8:37
• Thanks Marcus. Yeah in my case both are same, we have the term frame rate as parameter in many of our functions so got accustomed to it, will pay more attention on presentation next time.
– Sate
Jul 12 '16 at 9:03
• ... Ok, then I'll go ahead and replace "frame" with "sample"... Jul 12 '16 at 9:21