Previous in Forum: IPCONFIG.EXE in Widows 2000/XP   Next in Forum: Looking for Physician Scheduling Software
Close
Close
Close
5 comments
Rate Comments: Nested
Associate
Engineering Fields - Marine Engineering - New Member

Join Date: May 2006
Posts: 36

MATLAB and Amplitude Calculations

03/05/2009 7:05 PM

hi;

i have around 34,000 readings of wave surface elevations at every 0.5 second. using a pressure transducer under the water, the height variation of the water surface was taken.when i plot these data; y axis= height above sealevel, x axis=time, i get a sinusoidal wave graph. now i need to calculate the amplitude of each sine shaped wave. how can i do this MATLAB?...how can i compute the amplitudes (which is the dist from the peak or trough to the zero line)...

thanks.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
New Zealand - Member - Kiwi Popular Science - Weaponology - New Member Engineering Fields - Power Engineering - New Member Engineering Fields - Electrical Engineering - New Member

Join Date: Sep 2006
Location: Auckland, New Zealand
Posts: 8777
Good Answers: 376
#1

Re: MATLAB

03/05/2009 8:29 PM

Well its been a while since I programmed with MATLAB, but this is a simple "addition of two numbers" problem that Microsoft Excel performs very well. If you don't need to monitor data in real time, or are not using the calculated amplitude data in real time, then I would suggest you use Excel instead.

__________________
jack of all trades
Register to Reply
Guru
Engineering Fields - Control Engineering - New Member China - Member - New Member

Join Date: Sep 2006
Location: CHINA
Posts: 2945
Good Answers: 14
#2

Re: MATLAB

03/05/2009 11:07 PM

You plot the graph, so you can see the amplitude of the sine wave. why still ask? I may misunderstand,

or you can do like this ( however, excel can do the tick as suggested by Jack )

: y and z as row and t as column so the data will be

T...

0 5 ..

Y 0 deepth …

Z a00 a01 …a0n

-

-

Am0 am1 … amn

For y-0, you can get the first z row, then y=+1, until y= you required

For t=0, get z first data, t=+ ticket, until you measured

Plot ( z, t)

So that you have a three dimensions graphic,

If you wish to calculate the max value of the data, I think the best bet is filtered by Gauss filter at first, then use the a program which can caluculate max vakue.

You can try this way,

For y =0, y=+, y

For t=0, t=+ tickle, t…

The frirst z, then second – first, if the different > 0, keep the second, otherwise, keep the first, and the difference value p,

Then the third,, use it minus the front value, and use this differece - the front difference, if the difference >0, and use this difference -p, if >0,repeat, you can find the max, then min.

you can find many such programs. to get the max value etc.

once the math routine is set, the rest may be easy.

Register to Reply
Commentator

Join Date: Feb 2009
Location: Timisoara, Romania
Posts: 60
Good Answers: 4
#3

Re: MATLAB and Amplitude Calculations

03/07/2009 6:05 AM

Well, since you have 34000 signals, I can understand why you don't want to use excel or read them yourself...

I think the easiest way is to use the max() function. You can search it in matlab's help. It's pretty straight forward:

[m,p]=max(1dimarray)

where m is the maximum value in the array and p is its position

Since you have a sine, you would probably get the position of the first maximum value, which can also enable you to calculate the phase! And of course, if you need the peak-to-peak values, just multiply by 2 (that if you have a perfect sinus wave).

I don't really now how it works if you have a 2dim array where the lines or the columns are your sinuses. I guess you could select the line with "2dimarray(line,:)" and the column with "2dimarray(:,column)". But since you plotted them already, that souldn't be a problem.

hope it helps.

__________________
Patricia_a
Register to Reply
Commentator

Join Date: Mar 2009
Posts: 82
#4

Re: MATLAB and Amplitude Calculations

03/23/2009 7:42 AM

Motivated by recent progress in calculating field theory amplitudes, we study applications of the basic ideas in these developments to the calculation of amplitudes in string theory. We consider in particular both non-Abelian and Abelian open superstring disk amplitudes in a flat space background, focusing mainly on the four-dimensional case. The basic field theory ideas under consideration split into three separate categories. In the first, we argue that the calculation of alpha'-corrections to MHV open string disk amplitudes reduces to the determination of certain classes of polynomials. This line of reasoning is then used to determine the alpha'^3-correction to the MHV amplitude for all multiplicities. A second line of attack concerns the existence of an analog of CSW rules derived from the Abelian Dirac-Born-Infeld action in four dimensions. We show explicitly that the CSW-like perturbation series of this action is surprisingly trivial: only helicity conserving amplitudes are non-zero. Last but not least, we initiate the study of BCFW on-shell recursion relations in string theory. These should appear very naturally as the UV properties of the string theory are excellent. We show that all open four-point string amplitudes in a flat background at the disk level obey BCFW recursion relations. Based on the naturalness of the proof and some explicit results for the five-point gluon amplitude, it is expected that this pattern persists for all higher point amplitudes and for the closed string.

Register to Reply
Commentator

Join Date: Mar 2009
Posts: 82
#5

Re: MATLAB and Amplitude Calculations

03/23/2009 7:53 AM

#define M_PI 3.14159265358979323846

long bin,k;
double arg;
for (bin = 0; bin < transformLength; bin++) {

transformData[bin] = 0.;
for (k = 0; k < transformLength; k++) {

arg = (float)bin * M_PI *(float)k / (float)transformLength;
transformData[bin] += inputData[k] * sin(arg);

}

Register to Reply
Register to Reply 5 comments
Copy to Clipboard

Users who posted comments:

attila2007 (2); cnpower (1); jack of all trades (1); Patricia_a (1)

Previous in Forum: IPCONFIG.EXE in Widows 2000/XP   Next in Forum: Looking for Physician Scheduling Software

Advertisement