15,935,429 members
See more:
how can i integrate the signal to find the area under the curve of this signal in malab
Posted
Sandeep Mewara 10-May-11 2:30am

## Solution 2

Matlab has an amazing help support. You can find almost all the functionalities with an example in Matlab help section.

Why don't you try them ?

For This particular question of yours, you can Do it using two different methods.

* ` CUMSUM `
* ` TRAPZ ` ( Trapezoidal Integral )

Using ` CUMSUM ` :
Depending on what Domain your signal is sampled you can do one of the following methods. ( Assuming the Signal yo be Y )
-- In Frequency Domain :
` integralOfY = CUMSUM (Y) / f ` ( where f : sampled frequency )

-- In Time Domain :
` integralOfY = CUMSUM (Y) . * [ 1; diff(t)] `( where t : sampled time interval )

Using ` TRAPZ ` :

-- ` Z = TRAPZ ( Y ) ` : Integral of Y
-- ` Z = TRAPZ ( X, Y) ` : Integral of Y wrt X

BR//
Harsha

Albert Holguin 16-May-11 13:08pm
this: `integralOfY = CUMSUM (Y) / f`, would give you the area under the curve up til the sampling frequency itself, which would be the regular spectrum and the inverted spectrum (giving you twice the value).......... good info though, my 4
ZeeroC00l 17-May-11 1:22am
@Albert :
Yes, you are correct. Sorry for not making it Perfectly clear.

But if you are looking for finding the area under the curve with 2 limiting values I would suggest the Trapezoidal rule is the best one for that.

## Solution 1

what's your signal format? if its already digitized, it's just treated as binary data.

Top Experts
Last 24hrsThis month
 Richard Deeming 115 Pete O'Hanlon 55 OriginalGriff 30 Gbenbam 25 merano99 25
 OriginalGriff 670 Pete O'Hanlon 560 Richard Deeming 475 merano99 215 Dave Kreskowiak 170

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900