Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Image Transmission MATLAB code

Status
Not open for further replies.

hpl999

Newbie level 3
Joined
Feb 27, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
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);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top