to find starting point of a waveform
-
How to find the coordinates of the starting point of a waveform (stored in two columns of data: first column-time; second column-g)? The technique needs to be able to discard the noise sometime which may be before the real start point. Thank you for your start ideal and coding techniques!
-
How to find the coordinates of the starting point of a waveform (stored in two columns of data: first column-time; second column-g)? The technique needs to be able to discard the noise sometime which may be before the real start point. Thank you for your start ideal and coding techniques!
If you mean a file made up by lines (separated by a '\n') each containing two numbers separated by a delimiter, with some spurious character at beginning, you typically need to read the file line by line, then parse each line to identify the presence of certain structural elements (digits, signs, separators etc.) Once you decide that the line looks OK, you can start to convert the (sub)strings into numbers. Another technique can make use of a circular buffer. You read the file to fill in the buffer, check the buffer contents if matching some "prerequisite" (as above), do the required conversion then discard the already read characters, and refill the buffer.
2 bugs found. > recompile ... 65534 bugs found. :doh:
-
How to find the coordinates of the starting point of a waveform (stored in two columns of data: first column-time; second column-g)? The technique needs to be able to discard the noise sometime which may be before the real start point. Thank you for your start ideal and coding techniques!
Can you please elaborate your question? if i understood it correctly,(since you said you want to discard noise) you must be trying to strip the silence in the .Wav file and create a new .wav file. please be clear.
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
-
If you mean a file made up by lines (separated by a '\n') each containing two numbers separated by a delimiter, with some spurious character at beginning, you typically need to read the file line by line, then parse each line to identify the presence of certain structural elements (digits, signs, separators etc.) Once you decide that the line looks OK, you can start to convert the (sub)strings into numbers. Another technique can make use of a circular buffer. You read the file to fill in the buffer, check the buffer contents if matching some "prerequisite" (as above), do the required conversion then discard the already read characters, and refill the buffer.
2 bugs found. > recompile ... 65534 bugs found. :doh:
Thanks. This is about data processing of a seismic wave stored in a file containing two columns of data: the fist column is the time: 0, 0.0001, 0.0002, 0.0003, ...; the second column is the wave amplitude: 0.00, 0.0001, 0.00015, ...; the zero's or noise in the beginning for some time, then real wave onset come and the wave started. I need to detect the wave onset. Too bad I can not draw a picture for you here. For example, a paper here provide a way to find this onset, but too complex. Here is the link for the paper: http://www-geo.phys.ualberta.ca/~doug/papers/First-break_timing.pdf[^] I am looking a simple, better method. Thanks
-
Can you please elaborate your question? if i understood it correctly,(since you said you want to discard noise) you must be trying to strip the silence in the .Wav file and create a new .wav file. please be clear.
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
I am trying to find a simple, better way than in this paper: http://www-geo.phys.ualberta.ca/~doug/papers/First-break_timing.pdf[^] This is about a method of data processing of waveform data, such as seismic or magnetic wave data.You may have a better wave to find the onset of wave. Thanks
-
How to find the coordinates of the starting point of a waveform (stored in two columns of data: first column-time; second column-g)? The technique needs to be able to discard the noise sometime which may be before the real start point. Thank you for your start ideal and coding techniques!
My two cents. To determine starting point you need to state what charateristic of the waveform changes at the start point - frequency or amplitude of signal. For e.g. for seismic waveforms, i assume that there will be a rapid increase of amplitude of the signal at the start of the event. In this case you can determine rate of change of amplitude of a window of data. The window must be moved over the complete set. The first window in which the rate of change is above a certain threshold would contain the starting point of the waveform. [Edit] assuming you are not looking for actual code, you may have better luck posting this question in 'Algorithms' section.
-
How to find the coordinates of the starting point of a waveform (stored in two columns of data: first column-time; second column-g)? The technique needs to be able to discard the noise sometime which may be before the real start point. Thank you for your start ideal and coding techniques!
Using regression you can find the curve that best fits the data, averaging out the noise. Then the equation of the curve will give you the starting point. See http://en.wikipedia.org/wiki/Polynomial_regression[^]
-
Thanks. This is about data processing of a seismic wave stored in a file containing two columns of data: the fist column is the time: 0, 0.0001, 0.0002, 0.0003, ...; the second column is the wave amplitude: 0.00, 0.0001, 0.00015, ...; the zero's or noise in the beginning for some time, then real wave onset come and the wave started. I need to detect the wave onset. Too bad I can not draw a picture for you here. For example, a paper here provide a way to find this onset, but too complex. Here is the link for the paper: http://www-geo.phys.ualberta.ca/~doug/papers/First-break_timing.pdf[^] I am looking a simple, better method. Thanks
mrby123 wrote:
Too bad I can not draw a picture for you here.
But you can show the relevant parts of the file, yes?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mrby123 wrote:
Too bad I can not draw a picture for you here.
But you can show the relevant parts of the file, yes?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
This paper was trying to solve the same problem. However, the method is too complex. I need something more simple, quicker, and better than this: http://www-geo.phys.ualberta.ca/~doug/papers/First-break_timing.pdf[^] Thanks
Your problem is about parsing a data file that represents a waveform, correct?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Your problem is about parsing a data file that represents a waveform, correct?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Not exactly, it is about to find the onset of the waveform like that in the paper in the link.
mrby123 wrote:
...it is about to find the onset of the waveform...
But you are using a data file as input for this, correct?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mrby123 wrote:
...it is about to find the onset of the waveform...
But you are using a data file as input for this, correct?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Ok, so the problem boils down to something like:
FILE *pFile = fopen(...);
double dTime, dAmp;
while (fscanf("%f %f\n", &dTime, &dAmp) != EOF)
{
// analyze dTime and dAmp to know when waveform starts
}"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Ok, so the problem boils down to something like:
FILE *pFile = fopen(...);
double dTime, dAmp;
while (fscanf("%f %f\n", &dTime, &dAmp) != EOF)
{
// analyze dTime and dAmp to know when waveform starts
}"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Thanks. You are right on the issue. Now the key I am looking for is the technique to detect the onset. What is the robust criterion to determine the onset of the wave, while the noise in the data will not confuse the determination? Thanks for smart thought.
-
Thanks. You are right on the issue. Now the key I am looking for is the technique to detect the onset. What is the robust criterion to determine the onset of the wave, while the noise in the data will not confuse the determination? Thanks for smart thought.
mrby123 wrote:
Thanks. You are right on the issue.
Which is what I was trying to get at three posts ago.
mrby123 wrote:
Now the key I am looking for is the technique to detect the onset. What is the robust criterion to determine the onset of the wave, while the noise in the data will not confuse the determination?
Only you can determine what is noise and what is not. When you are dealing with floating-point numbers, you can't check a number being exactly equal to
0
. You'll have to compare against something like epsilon."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius