【信号隐藏】基于奇异值分解svd实现音频水印嵌入提取含攻击matlab代码

1 简介

奇异值分解是矩阵对角化的有效数值分析工具,被广泛地应用于图像处理领域。假设数字图像A 的大小为 N × N,对其进行奇异值分解,则存在正

2 部分代码

function out=invzigzag(in,num_rows,num_cols)
% Inverse Zig-zag scanning
% This function reorders a 1-D array into a specifiable
% 2-D matrix by implementing the INVERSE ZIG-ZAG SCNANNING procedure.
% IN specifies the input 1-D array or vector
% NUM_ROWS is the number of rows desired in the output matrix
% NUM_COLS is the number of columns desired in the output matrix
% OUT is the resulting inverse zig-zag scanned matrix
% having the same number of elements as vector IN
%
% As an example,
% IN = [1     2     4     7     5     3     6     8   10   11     9   12];
% OUT = INVZIGZAG(IN,4,3)
% OUT=
%1     2     3
%4     5     6
%7     8     9
%10   11   12

tot_elem=length(in);

if nargin>3
error('Too many input arguments');
elseif nargin<3
error('Too few input arguments');
end

% Check if matrix dimensions correspond
if tot_elem~=num_rows*num_cols
error('Matrix dimensions do not coincide');
end


% Initialise the output matrix
out=zeros(num_rows,num_cols);

cur_row=1;cur_col=1;cur_index=1;

% First element
%out(1,1)=in(1);

while cur_index<=tot_elem
if cur_row==1 & mod(cur_row+cur_col,2)==0 & cur_col~=num_cols
out(cur_row,cur_col)=in(cur_index);
cur_col=cur_col+1;%move right at the top
cur_index=cur_index+1;

elseif cur_row==num_rows & mod(cur_row+cur_col,2)~=0 & cur_col~=num_cols
out(cur_row,cur_col)=in(cur_index);
cur_col=cur_col+1;%move right at the bottom
cur_index=cur_index+1;

elseif cur_col==1 & mod(cur_row+cur_col,2)~=0 & cur_row~=num_rows
out(cur_row,cur_col)=in(cur_index);
cur_row=cur_row+1;%move down at the left
cur_index=cur_index+1;

elseif cur_col==num_cols & mod(cur_row+cur_col,2)==0 & cur_row~=num_rows
out(cur_row,cur_col)=in(cur_index);
cur_row=cur_row+1;%move down at the right
cur_index=cur_index+1;

elseif cur_col~=1 & cur_row~=num_rows & mod(cur_row+cur_col,2)~=0
out(cur_row,cur_col)=in(cur_index);
cur_row=cur_row+1;cur_col=cur_col-1;%move diagonally left down
cur_index=cur_index+1;

elseif cur_row~=1 & cur_col~=num_cols & mod(cur_row+cur_col,2)==0
out(cur_row,cur_col)=in(cur_index);
cur_row=cur_row-1;cur_col=cur_col+1;%move diagonally right up
cur_index=cur_index+1;

elseif cur_index==tot_elem%input the bottom right element
       out(end)=in(end);%end of the operation
break%terminate the operation
   end
end

3 仿真结果

4 参考文献

[1]黄菊. 基于SVD的音频认证水印算法研究[D]. 西南交通大学.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Matlab科研辅导帮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值