function out=simplecodecW(z,b,c)
if c == 1
[y,Fs] = wavread(z);
xx = y';
x = xx(1:4096*7);
else
x = z;
Fs = 2^13;
end
len=length(x);
n=2^5;
nw=floor(len/n);
x=x(1:n*nw);
L=0.3;
q=2*L/(2^b-1);
for i=1:n
for j=1:2*n
M(i,j)= cos((i-1+1/2)*(j-1+1/2+n/2)*pi/n);
end
end
M=sqrt(2/n)*M;
N=M';
x=0.3*x/max(abs(x));
sound(x,Fs);
h = (sqrt(2)*sin(((1:2*n)-1/2)*pi/(2*n)))';
out=[];
for k=1:nw-1
x0=x(1+(k-1)*n:2*n+(k-1)*n)';
x0 = x0.*h;
y0=M*x0;
y1=round(y0/q);
y2=y1*q;
w(:,k)=N*y2;
if(k>1)
w2=w(n+1:2*n,k-1).*h(n+1:2*n);
w3=w(1:n,k).*h(1:n);
out=[out;(w2+w3)/2];
end
end
if c ==1
pause(4)
end
pause(1)
sound(out,Fs)
DIFF = [];
for i=1:len-64
DIFF=[DIFF;x(i+32)-out(i)];
end
new_out = [];
new_x = [];
new_DIFF = [];
for i=1:150
new_out = [new_out;out(i)];
new_x = [new_x;x(i+32)];
new_DIFF = [new_DIFF;DIFF(i)];
end
RMSE = rms(DIFF')
subplot(2,2,3);
plot((1:150),new_DIFF);
title('Difference')
xlabel('Steps')
ylabel('Amplitude')
subplot(2,2,1);
plot((1:150),new_x);
title('Normalized Input Signal')
xlabel('Steps')
ylabel('Amplitude')
subplot(2,2,2)
plot((1:150),new_out);
title('Output Signal')
xlabel('Steps')
ylabel('Amplitude')
Error using simplecodecW (line 7)
Not enough input arguments.