my question is that, i want to encypt my 16 -Qam signal using arnold choatic scrambling,how it is possible?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
below attachement having 1).the block diagram and 2).the representation of encryption signal 3)my qam encrypted output. the arnold scrambling 'um' sequence is multiply with real part of qam and 'vm' sequence is multiply with imaginary part. i did,but i can't get proper encyption output.
clc; clear all; close all; warning off; im=imread('lena.png'); im = imresize(im,[256,256]); figure imshow(im); title('plain image') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % Runge-kutta method h=0.002; % step size x = 0:h:2; % Calculates upto y(3) y = zeros(1,length(x)); y(1) = 5; % initial condition F_xy = @(t,r) 3.*exp(-t)-0.4*r; % change the function as you desire
for i=1:(length(x)-1) % calculation loop k_1 = F_xy(x(i),y(i)); k_2 = F_xy(x(i)+0.5*h,y(i)+0.5*h*k_1); k_3 = F_xy((x(i)+0.5*h),(y(i)+0.5*h*k_2)); k_4 = F_xy((x(i)+h),(y(i)+k_3*h));
y(i+1) = y(i) + (1/6)*(k_1+2*k_2+2*k_3+k_4)*h; % main equation
end
% % % Arnold choatic Encryption
X(1) = y(1);
Y(1) = y(2);
% X(1) = 0.32;
% Y(1) = 0.320000000000001;
a = 1;
b = 1;
ar_x(1) = X(1);
ar_y(1) = Y(1);
ii = 2;
% Equation (2)
for i = 1:numel(im)-1
y1 = [1 a; b 1+(a*b)];
z = [ar_x(i);ar_y(i)];
xx = (y1*z);
xx = round(mod(xx,256));
ar_x(ii) = xx(1);
ar_y(ii) = xx(2);
ii = ii+1;
end
r11 = length(ar_x);
r22=length(ar_y);
% d1 = (ar_x) + (ar_y-ar_x).*rand(1,r1);
d1 = (ar_x) + (ar_y-ar_x);
d2 = reshape(d1,256,256);
d3=uint8(d2);
d4=double(d2);
figure
imshow(d3);
title('Encrypted or cipher image');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x_stream=reshape(d4,65536,1);
bit_stream=round(x_stream./17);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
M=16;
y_map = qammod(bit_stream,M);
sw=scatterplot(y_map);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % % Runge-kutta method
h=0.002; % step size
um = 0:h:2; % Calculates upto y(3)
vm = zeros(1,length(um));
vm(1) = 0.6; % initial condition
F_xy = @(t,r) 3.*exp(-t)-0.4*r; % change the function as you desire
for i=1:(length(um)-1) % calculation loop
k_1 = F_xy(um(i),vm(i));
k_2 = F_xy(um(i)+0.5*h,vm(i)+0.5*h*k_1);
k_3 = F_xy((um(i)+0.5*h),(vm(i)+0.5*h*k_2));
k_4 = F_xy((um(i)+h),(vm(i)+k_3*h));
vm(i+1) = vm(i) + (1/6)*(k_1+2*k_2+2*k_3+k_4)*h; % main equation
end
% % % Arnold choatic Encryption
um(1) = vm(1);
vm(1) = vm(2);
alpha = 4;
beta = 6;
ar_um(1) = um(1);
ar_vm(1) = vm(1);
ii = 2;
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% Equation (3)
for i = 1:numel(y_map)-1
y1 = [1 alpha; beta 1+(alpha*beta)];
z = [ar_um(i);ar_vm(i)];
xx = (y1*z);
xx = round(mod(xx,256));
ar_um(ii) = xx(1);
ar_vm(ii) = xx(2);
ii = ii+1;
end
r1 = length(ar_um);
r2= length(ar_vm);
%%%%%%encrypted sequence generated%%%%%%%%%%%
UMM=reshape(ar_um,256,256);
VMM=reshape(ar_vm,256,256);
%%%%%real part%%%%%%%%%%%%
R =real(y_map);
RR=reshape(R,256,256);
R1=RR*UMM;
%%%%%imaginary part%%%%%%%
Im=imag(y_map);
Imm=reshape(Im,256,256);
Im1=Imm*VMM;
%%%%%real and imaginary%%%%
Rim=(R1 + Im1);
EN=im2double(Rim);
encr=uint8(EN);
figure
imshow(encr)
title('QAM ENCRYPTED OUTPUT')
0 Kommentare
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!