fs = 8000;
dt = 1/fs;
fc = 200;
t = (0:0.001:10);
fm = 30;
freqdev = 50;
phasedev = 50;

x = sin(2*pi*fm*t);
%plot(t,x);
%title('sin wave with 8KHz sampling rate')

%y1 = fmmod(x,fc,fs,freqdev);
%plot(t,y1);
%title('modulated signal')

%y2 = fmdemod(y1,fc,fs,freqdev);
%plot(t,y2);
%title('demodulated signal')

%z1 = pmmod(x,fc,fs,phasedev);
%plot(t,z1);
%title('pm modulated signal')

z2 = pmdemod(z1,fc,fs,phasedev);
plot(t,z2);
title('pm demodulated signal')