Hi I am trying to use bpsk to transmitt an image in a problem I am working on but I have a problem with reshaping the image back.
my code
clear all close all imag = imread('saina.jpg');
img= imag(:,:,:);
[z zz t] = size( img);
bin = dec2bin(img, 8); [z zz t] = size( img);
bin = dec2bin(img, 8); %de2bi()has lower resolution%
[s ss] = size(bin);
sigg = reshape( bin', 1,s*ss );
sig = str2num(sigg'); % if no transpose then sig will be Inf%
M = modem.pskmod(2);
sig1 = modulate(M,sig);
l=length(sig1);
z=modem.pskdemod(2); %demodulation object
kr= demodulate(z,sig); %demodulating the data kr1 = (sig+1)/2;
newrsig = reshape(kr', ss , s);
newrsigg= newrsig';
final = bin2dec ( num2str(newrsigg) );
final = reshape ( final', z ,zz , t);
figure, imshow (uint8(final(:,:,:))) ,
after running this code i get the following error messge
??? Error using ==> reshape Conversion to double from modem.pskdemod is not possible.
Error in ==> Untitled4 at 41 final = reshape ( final', z ,zz , t);