I tried to plot phase demodulated signal and original message signal but there is a significant difference between magnitudes of the message and demodulated signal. I have attached the code and the graph. Please help in pointing out the error.


clear all; close all;
fm = 50;
fc = 1000;
fs = 4000;

t = 0:1/fs:0.1;
kp1 = pi/2;

m_t = 5*cos(2*pi*fm*t);

x_pm = cos(2*pi*fc*t + kp1*m_t);

x = pmdemod(x_pm,fc,fs,kp1);

title('phase modulated signal');

title('message and demodulated signal');
legend('demodulated signal','message signal');

plotenter image description here

  • $\begingroup$ Looks like 180-degree phase jumps $\endgroup$ – Ben Feb 29 '20 at 4:16
  • $\begingroup$ @Ben What's the issue in the code? $\endgroup$ – A Q Feb 29 '20 at 4:28
  • $\begingroup$ @AQ nothing – you just don't unwrap the phase. That's OK for some applications, and not OK for others. Notice how it's natural that the output phase range is $[-\pi;\pi]$. Again, maybe drop the 5 prefactor and see what happens... $\endgroup$ – Marcus Müller Feb 29 '20 at 9:24
  • $\begingroup$ @MarcusMüller When I drop the 5 prefactor it works fine. I want to ask why does the demodulated wave not have the same amplitude as the message signal. $\endgroup$ – A Q Feb 29 '20 at 9:50
  • $\begingroup$ I explained that. Phase wrapping. $\endgroup$ – Marcus Müller Feb 29 '20 at 10:21

You tell the phase demodulator that the signal has a maximum phase deviation of $\pi/2$, but then you actually use a signal with a phase deviation of $5\pi/2$ (due to the amplitude of the message signal). This doesn't make sense.

Note that even the most ideal phase demodulator cannot distinguish between $\cos(2\pi f_ct+\phi(t))$ and $\cos(2\pi f_ct + \phi(t)+2k\pi)$, $k\in\mathbb{Z}$.

  • $\begingroup$ I first did that only when I used pmdemod but that decreased the amplitude of the demodulated signal to around 0.2 from 1. So, I thought I am doing something wrong. Can you write the code for getting the demodulated signal as message signal(with Am=5) by using unwrapping as said in comments as I not able to do. $\endgroup$ – A Q Feb 29 '20 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.