Forums

call on a file and filtering it with simple procedure, but ??

Started by blue...@yahoo.com February 28, 2009
please check the following programs, the 1st is used to call on a .wav file, change it into a matrix, fft it, filter it, and then rewrite it, but the problem is the new file is just a file, there is no sound??
the 2nd is the same but without filtering and the same problem arises, I will really appreciate any help !! :) thanks <3
----------------------------- 1st
NC79;
e=eye(N);
fp1=fopen('e:/Project/Test/8tst.wav','r');
x=fread(fp1,'int16');
Xt(x');
for m=2:101;
for n=1:4379;
if m==n, e(m,n)=0.0; end;
end;
end;
for mB80:4379;
for n=1:4379;
if m==n, e(m,n)=0.0; end;
end;
end;
Y=X*e;
y=ifft(Y,N);
fp=fopen('e:/Project/Test/mLPF.wav','w');
fwrite(fp,y','int16');
fclose(fp1);
fclose(fp);
-----------2nd
Nd;
fid1=fopen('E:\Project\Test\8tst.wav','r');
fid2=fopen('E:\Project\Test\8tstout.wav','w');
c=0;
p=0;
for i=1:8000,
fseek(fid1,p,0);
fseek(fid2,p,0);
x = fread(fid1,N,'int8');
fwrite(fid2,x,'int8');
p=N+c;
c=c+N;
aof(fid1);
if a==1,
break;
end;
end;
fclose(fid1);
fclose(fid2);