I need some MATLAB code to demodulate the data I have which is BPSK modulated. MAC layer protocol of this data is AX25 UI. BPSK baud rate is 1200bps. I have a good quality frame of this data in a .wav file.
You should implement matched (also called Calman or whitening) filter. Usual implementation for signal processing is FIR. For this, first tune filter in the presence of channel noise to flatten noise spectrum; then pass signal+noise through the same filter. In matlab, matched filtering is performed by "filter" command. See matlab help for details.
About Doppler shift: after matched filter you need to implement convolution filter (if you know how Doppler frequency changes). If you do not know, you are in trouble.
The structure of the decoder depends on many parameters.
Do you have a continuous transmission --> one packet after the other ?
Or a bursty transmission --> intermittent traffic?
In case of a continuous transmission you can use a PLL to perform frequency synchronization.
If you have bursty traffic you need to detect first if you are receiving a packet at all. This can be done with a simple energy detector. Afterwards, you can perform frequency synchronization using the Rife and Boorstyn algorithm, for example. This algorithm consists basically on performing an FFT of the received signal with many points. The estimated carrier frequency is simply the peak of the FFT. You can then compensate the Doppler on your received signal.
Now you should perform frame synchronization, symbol timing estimation, matched filtering and to downsample your signal.
You can find blocks performing all these functions in the communication toolbox of matlab. Using Simulink you can then easily build a receiver chain.
A very good reference for synchronization is this book
Umberto Mengali, Aldo N. D'Andrea, "Synchronization Techniques for Digital Receivers", Springer
If you need more info you can provide a more detailed description of your system.