Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Monday, March 21, 2011

5:48 PM

flist = []; %% loop between folders


dir='E:\Documents and Settings\thawtar\Desktop\arr\arr~\PUB-leak-tests\rochor\';
flist = ls([dir '\STN_22*.raw']);
if length(flist)~=0
fs = 250;
allpressure =[];
data=[];
Nwin = 256;
Nfft = 256;
Nlap =205;
window = 'blackman';
w = feval(window,Nwin,'periodic');

for j= 1:120:length(flist);
z_t=[];
y_t=[];
if (j+120)>length(flist);
g=length(flist)-j;
else
g=120;
end
allpressure =[];
for l=j:j+g
prid = fopen ([dir '\' char(flist (l,:))]);
fname=char(flist(j,:));
[ts]=correct_time_stamp(fname);
pressure = fread(prid, inf, 'int16');
fclose(prid);
allpressure = [allpressure; pressure];
end
[C,L]=wavedec(allpressure,3,'db1') ;
A3=wrcoef('a',C,L,'db1',3);
y = resample(A3,200,fs);
[S,f,t]=spectrogram (y,w,Nlap,Nfft,200);
s = 10 * log(abs(S));
gggg=[];
for gg=1:length(t)
ggg=ts+t(gg);
year=0;
month=0;
day=0;
hour=floor(ggg/3600);
minute=floor(((ggg/3600)-hour)*60);
second=(((((ggg/3600)-hour)*60)-minute)*60);
xdate = datenum(year,month,day,hour,minute,second);
gggg=[gggg xdate];
end
c=.55*sqrt(2*log(512))*sqrt(512);

Unfiled Notes Page 1


c=.55*sqrt(2*log(512))*sqrt(512);
d=[];
for aa=1:129
d(aa,:)=s(aa,:)>c;
end
dd=d.*s;
highfreq= mean(dd(11:120,:)); %10 feb added
high=movavg(highfreq,200,300,1);
if max(high)>35
plot(gggg,high);
datetick('x',13);
axis tight;ylim([-10 100]);
xlabel ('Rochor A3 51-120 Hz');
title('28 feb 2011');
print -append;
close;
end
end
end

Unfiled Notes Page 2


Ok Rochor
Monday, March 21, 2011
5:01 PM

Unfiled Notes Page 3


anson
Monday, March 21, 2011
5:52 PM

Unfiled Notes Page 4


anson
Monday, March 21, 2011
5:53 PM

Unfiled Notes Page 5


republic
Monday, March 21, 2011
6:01 PM

Unfiled Notes Page 6


temasek
Monday, March 21, 2011
6:19 PM

Unfiled Notes Page 7


temasek
Monday, March 21, 2011
6:20 PM

Unfiled Notes Page 8


Gateway
Monday, March 21, 2011
6:37 PM

Unfiled Notes Page 9

You might also like