15,936,014 members
0.00/5 (No votes)
See more:
how can i integrate the signal to find the area under the curve of this signal in malab
Posted
Comments
Sandeep Mewara 10-May-11 2:30am
Tried Google? Mathswork website?

## 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

Comments
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.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 Pete O'Hanlon 65 Richard Deeming 45 OriginalGriff 40 Gbenbam 25 merano99 25
 OriginalGriff 680 Pete O'Hanlon 570 Richard Deeming 475 merano99 215 Dave Kreskowiak 170

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