M =2; % alphabet size;
%must be always greater than 
%the value of integers in the input signal

%reading the image
x1=imread('planet5.gif');

%converting to black and white image
x2=im2bw(x1,0.05);

%displaying image before modulating
figure;
imshow(x2);

x3=double(x2);

%modulation technique
y = dpskmod(x3,M);

%demodulation process
z = dpskdemod(y,M);

%displaying the output after demodulation
figure;
imshow(z);
