From: aye myamon on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hntsun$r84$1(a)fred.mathworks.com>...
> "aye myamon" <ayemyamon(a)hotmail.com> wrote in message <hntrl0$s4d$1(a)fred.mathworks.com>...
> > i am now detecting the leak from pipeline. i am a very new user for matlab.
> >
> > i am now facing some difficulties to do time domain analysis from the pressure sensor. i have already done for frequency domain analysis but still need to analyse with time domain.
> >
> > here is my frequency domain analysis. pls help me how to write the code for time domain analysis. thanks to all.
> >
> > directory = cd;
> > c = [0.0018441793 34.3574964587]; % stn-15
> > filelist = ls(['STN_15*.raw']);
> > allpressure =[];
> > fs = 1000;
> > for ii= 252:253
> > prid = fopen(char(filelist(ii,:)));
> > pressure = fread(prid, inf, 'int16');
> > fclose(prid);
> > allpressure = [allpressure; pressure];
> > end
> > t = linspace(0,length(allpressure)/fs,length(allpressure));
> >
> > figure;
> > plot (t,allpressure);
> > xlabel('time (sec)');
> > ylabel ('pressure (psi)');
> > specgramdemo(allpressure,2000);
>
> Hi,
> I think you need to be much more specific about what you mean by "time-domain analysis" before anyone can help you. What exactly are you attempting to accomplish in the time-domain in addition to just plotting the signal as a function of time?
>
> Also, why do you state that your sampling frequency is 1 kHz (fs=1000), but then input 2 kHz into specgramdemo()? The 2nd input to specgramdemo() should be the sampling frequency.
>
> With regard to the way you are doing your time-frequency analysis, I think you should spend some time in learning to use spectrogram() instead of specgramdemo() to produce your time-frequency analysis. spectrogram() provides you with much more control over the length of the segment (window), the number of overlapping samples per segment, and the length of the discrete Fourier transform (whether there is any zero padding for each segment for example). These are important parameters that should always be tailored to your signal and the goals of your analysis.
>
> Hope that helps,
> Wayne

hi Wayne thanks for ur advice. my teacher let me to analyze with both frequency and time domain. my target is determining the time when the pipe leak as exact as i can.

thanks again
aye