% ............ Reading the user input (image/ Video)...............%
[filename,pathname] = uigetfile({'*.jpeg;*.jpg;*.png;*.bmp'},'Enter the Image File');
watermark = imread(filename);
figure, imshow(watermark); % Original Image
[hgt wdt comp]=size(watermark); % Taking the dimensions of the Original image
binary_image = dec2bin(watermark, 8); % Converting the Image pixels from Decimal to Binary
[bin_hgt bin_wdt] = size(binary_image); % Taking the dimensions of the Binary image
N=bin_hgt*bin_wdt;
bits_watermark= reshape(binary_image', 1,N); % reshaping the binary image to a single bit stream
Transmit_SIG= str2num(bits_watermark');
convocode = poly2trellis(3,[5 7]);
watermark_convo=convenc(Transmit_SIG,convocode); % Applying the convolutional codes
N2=length(watermark_convo);
% % .............. Modulation..............%
M=2; % Order of modulation Scheme
Mod = modem.pskmod(M);
Modulated_sig = modulate(Mod,watermark_convo);
Modulated_sig_without = modulate(Mod,Transmit_SIG);
i=1;
%.............. Noise + Channel ..........%
% n1 = 1/sqrt(2)*[randn(1,N2) + j*randn(1,N2)];% white gaussian noise
% n1=n1';
% %
% Y = watermark_convo + 10^(-1)*n1;
Y = awgn(Modulated_sig,i);
Y_without = awgn(Modulated_sig_without,i);
%............. Demodulation .............%
Dem= modem.pskdemod(M);
Demodulated_sig = demodulate(Dem, Y);
Demodulated_sig_without = demodulate(Dem, Y_without);
decoded_watermark=vitdec(Demodulated_sig,convocode,35,'trunc','hard');
SIG_RECV_A= reshape(decoded_watermark',bin_wdt,bin_hgt);
SIG_RECV_B= SIG_RECV_A';
SIG_RECV_C= reshape(Demodulated_sig_without,bin_wdt,bin_hgt);
SIG_RECV_D= SIG_RECV_C';
Recvd_SIG_A= bin2dec(num2str(SIG_RECV_B));
reconstructed_watermark= reshape(Recvd_SIG_A, hgt, wdt, comp);
Recvd_SIG_C= bin2dec(num2str(SIG_RECV_D));
reconstructed_watermark_without= reshape(Recvd_SIG_C, hgt, wdt, comp);
% Final_recvd= unit8(Recvd_SIG_B(:,:,:));
Final_reconstructed_watermark= uint8(reconstructed_watermark(:,:,:));
Final_reconstructed_watermark_without= uint8(reconstructed_watermark_without(:,:,:));
% figure, imshow(Final_reconstructed_watermark);
% psnr(watermark,Final_reconstructed_watermark)
figure, imshow(Final_reconstructed_watermark_without);
psnr(watermark,Final_reconstructed_watermark_without);
peaksnr=psnr(watermark,Final_reconstructed_watermark_without);
fprintf(' The Peak-SNR value is %0.4f\n', peaksnr);
imwrite(Final_reconstructed_watermark_without, 'noiseimage.bmp');
% nErr1 = size(find([Transmit_SIG - decoded_watermark]),2);
%
% PSNR1=[35 52]
% PSNR2=[12 13 16 43 49 55 60]
% x=[3 6 9 12 15 18 21]
% % x1=[3 6]
% %
% hold on
% plot(x1,PSNR1);
% plot(x1,PSNR2);
LSB_test.zip_LSB_LSB steganography_steganography_turbo code
版权申诉
119 浏览量
2022-09-20
09:53:59
上传
评论
收藏 1.25MB ZIP 举报
Kinonoyomeo
- 粉丝: 76
- 资源: 1万+
最新资源
- 计科11班未参与实习认知名单.xlsx
- Java 使用回溯法解决01背包问题(含算法原理和代码)
- 毕业答辩模板2016超值实用黑板风毕业论文答辩模版
- 大学生创新创业的心得.doc
- MMDF3N06HDR2G-VB一款SOP8封装2个N-Channel场效应MOS管
- 毕业答辩模板2016超值实用黑板风毕业论文答辩模版(赠手绘图表)
- 毕业答辩模板(中文版式)黑白风毕业论文答辩通用PPT模板B-14
- MMDF3N04HDR2G-VB一款SOP8封装2个N-Channel场效应MOS管
- MMDF3301-VB一款SOP8封装2个P-Channel场效应MOS管
- 毕业答辩模板(医药专业)红色医药论文答辩模板
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈