cancel
Showing results for
Did you mean:

## count the number of peaks of channel

Hi,

I want to count the number of peaks a particular channel has above a certain limit defined by me. For example, If i define 35 as the limit, then it should give me the sum of all the occurences everytime a peak occurs with a value greater than 35.

Thanks

Akash

Message 1 of 6
(6,243 Views)

## Re: count the number of peaks of channel

You should be able to go to Analysis, Channel Functions, Calculate Peaks

It will return two channels of data.  Position and Amplitude.  The Length of the channel is how many peaks you have.

I used 40 as my min in the example below.

dim peak

Call ChnPeakDetect("[1]/Time","[1]/Speed","/Position1","/Amplitude1","Peaks",40,3)

peak = Data.Root.ChannelGroups(4).Channels("Position1").Properties("length").Value

call MsgBoxDisp (peak, "MB_OK")

Message 2 of 6
(6,234 Views)

## Re: count the number of peaks of channel

Hey,

Thanks for the reply. I have already tried this and I understand the length of the channel is the number of peaks in the channel, but how do i put that value in a table in a report? Please help!

Thanks & Regards

Akash

Message 3 of 6
(6,228 Views)

## Re: count the number of peaks of channel

It depends on how you want your table to look

If you just want to add text that staes the number of peaks

Change from

dim peak

to

globaldim "peak"

Then in your report set up a text feild and where you want the value to show up type

@@peak@@

and it will grab the number from your script and place it in the report.

Sorry I can't help more.  I don't use too many tables in my reports.

Message 4 of 6
(6,225 Views)

## Re: count the number of peaks of channel

Hi,

place 2D table to the REPORT. Then move (drag&drop) channels into tabel a set parameter of the table:

Table Definition -> Scaling -> Table length: Automatic maximum.

Simyfren

Message 5 of 6
(6,206 Views)

## Re: count the number of peaks of channel

There is a simpler way to show the number fo peaks in your report:

• Make sure you have a report open
• Select the channel you created with PeakDetection in the data portal.
• In the list of properties, there is one which indicates the length of the channel
• Drag&Drop this property to the report
• DIAdem will create a text which shows the length of the channel in the report

You can do this with any property from the dataportal.

If you double click teh text in the layout, a dialog will open which shows you how DIAdem created the reference to the property

Message 6 of 6
(6,200 Views)