
% demo driver for spread spectrum 
function demo_spread_watermark()

% Random watermark demo
[D,mat] = imread('lena.gif','GIF');
n = 1000; % 1000 watermark bit length
[D,V,X,I] = spread_watermark_insert(D, n, 'random');
spread_watermark_extract(D,V,X, I,n,'random');

% JPEG compression demo
[D, mat] = imread('lena.gif','GIF');
n = 1000;
[D, V, X,I] = spread_watermark_insert(D, n, 'jpeg');
spread_watermark_extract(D,V,X,I, n,'jpeg');

% scaled JPEG image
[D, mat] = imread('scale_lena.gif','GIF');
n = 1000;
[D, V, X, I] = spread_watermark_insert(D, n, 'scaledjpeg');
spread_watermark_extract(D,V,X,I,n,'scaledjpeg');
