3 n = 10^3; % size of the cover
\r
4 alpha = 0.5; % relative payload
\r
5 h = 8; % constraint height - default is 10 - drives the complexity/quality tradeof
\r
7 cover = uint8(rand(n, 1));
\r
8 m = round(n * alpha); % number of message bits
\r
9 message = uint8(rand(m, 1));
\r
10 profile = ones(n, 1);
\r
13 [dist, stego] = stc_embed(cover, message, profile, h); % embed message
\r
15 fprintf('distortion per cover element = %f\n', dist / n);
\r
16 fprintf(' embedding efficiency = %f\n', alpha / (dist / n));
\r
17 fprintf(' throughput = %1.1f Kbits/sec\n', n / toc() / 1024);
\r
19 message2 = stc_extract(stego, m, h); % extract message
\r
20 if all(message == message2)
\r
21 disp('Message has been extracted correctly.');
\r
23 error('Some error occured in the extraction process.');
\r