[求助]哪位高手会写音频水印提取部分啊????
clc[a,fs,bits]=wavread('D:\MATLAB6p5\work\music.wav');
subplot(3,1,1);plot(a);
title('原始音频波形图')
w=imread('D:\MATLAB6p5\work\liu.BMP');
subplot(3,1,2);imshow(w)
title('原始水印')
w1=w;
[c,l]=wavedec(a,3,'haar');
ca3=appcoef(c,l,3,'haar');
cd3=detcoef(c,l,3);
cd2=detcoef(c,l,2);
cd1=detcoef(c,l,1);
q=abs(min(ca3));
for i=1:1024
ave(i)=sum(ca3(i*20:(i+1)*20))/20;
z(i)=fix(ave(i)/q+1/2);
end
for i=1:1024
if mod(z(i),2)==w1(i)
cxzc=0;
else
if mod(z(i),2)~=w1(i)&&z(i)==fix(ave(i)/q)&&z(i)>=0||mod(z(i),2)~=w1(i)&&z(i)~=fix(ave(i)/q)&&z(i)<0
ca3(i*20:(i+1)*20)=ca3(i*20:(i+1)*20)+q;
else
ca3(i*20:(i+1)*20)=ca3(i*20:(i+1)*20)-q;
end
end
end
c1=[ca3',cd3',cd2',cd1'];
b=waverec(c1,l,'haar');
subplot(3,1,3);
plot(b);
title('嵌入水印后的音频')
wavwrite(b,fs,bits,'D:\MATLAB6p5\work\music1.wav')
这是写完的嵌入部分
谢谢了