Click here to Skip to main content
15,867,453 members
Home / Discussions / C#
   

C#

 
QuestionRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen31-Jan-18 23:06
professionalEddy Vluggen31-Jan-18 23:06 
AnswerRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon31-Jan-18 23:17
Krellon31-Jan-18 23:17 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen31-Jan-18 23:26
professionalEddy Vluggen31-Jan-18 23:26 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon1-Feb-18 0:20
Krellon1-Feb-18 0:20 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen1-Feb-18 1:37
professionalEddy Vluggen1-Feb-18 1:37 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon1-Feb-18 2:47
Krellon1-Feb-18 2:47 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen1-Feb-18 3:21
professionalEddy Vluggen1-Feb-18 3:21 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon1-Feb-18 4:07
Krellon1-Feb-18 4:07 
Hi Eddy,

If you stick the following data into Excel and plot it. Then place markers on the 9th 11th and 24th point you would see what I was after.

double[] trace = new double[] { 47.92370605, 44, 49, 46.31715393, 44.98129654, 46.17653275, 78, 73, 82, 63, 69, 41.72979736, 41.13000488, 41.49586487, 37, 40, 30, 40.79894257, 40.65593719, 41.37298584, 39.13498688, 55, 51, 60, 39.3440094, 38.51491547, 42, 35.12589264 };


If I could embed an image into my comment I would show you.

Your essentially looping through an array of points looking for the biggest and smallest peaks and waiting for the delta either side them to go >= 6dB. When it does you grab the biggest peak between the -6dB points. Rinse and repeat.

So,

1,6,3,7,1 would yield a peak at p[4] = 7 with a window size of 5.
1,7,1 would yield a peak at p[2] = 7 with a window size of 3.
1,-3,-2,7,5,1 would yield a peak at p[4] = 7 with a window size of 4.
1,-7,1,-6 would yield 2 peaks. One at p[1] = 1 with a window size if 2 and one at p[3] with a window size of 3.


stick them all together and you get

1,6,3,7,1,1,7,1,1,-3,-2,7,5,1,1,-7,1,-6

Peaks at p[4], p[7], p[12] and p[17]
Respective window sizes in points would be, 5, 3, 4 and 3 Smile | :)


Hope that's helps Hmmm | :|

Br
Nigel
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen1-Feb-18 9:25
professionalEddy Vluggen1-Feb-18 9:25 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon1-Feb-18 12:44
Krellon1-Feb-18 12:44 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen1-Feb-18 13:45
professionalEddy Vluggen1-Feb-18 13:45 
AnswerRe: Peak Search Algorithm with sliding window and peak excursion Pin
Gerry Schmitz1-Feb-18 10:25
mveGerry Schmitz1-Feb-18 10:25 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Krellon1-Feb-18 12:17
Krellon1-Feb-18 12:17 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Gerry Schmitz1-Feb-18 12:46
mveGerry Schmitz1-Feb-18 12:46 
GeneralRe: Peak Search Algorithm with sliding window and peak excursion Pin
Eddy Vluggen1-Feb-18 14:36
professionalEddy Vluggen1-Feb-18 14:36 
QuestionHow do I make a program that reacts to a specific word entered on the keyboard? Pin
Member 1365479431-Jan-18 15:11
Member 1365479431-Jan-18 15:11 
AnswerRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
Dave Kreskowiak31-Jan-18 16:11
mveDave Kreskowiak31-Jan-18 16:11 
GeneralRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
Member 1365479431-Jan-18 17:04
Member 1365479431-Jan-18 17:04 
AnswerRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
BillWoodruff31-Jan-18 19:54
professionalBillWoodruff31-Jan-18 19:54 
GeneralRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
Member 136547942-Feb-18 10:25
Member 136547942-Feb-18 10:25 
AnswerRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
OriginalGriff31-Jan-18 21:02
mveOriginalGriff31-Jan-18 21:02 
AnswerRe: How do I make a program that reacts to a specific word entered on the keyboard? Pin
Gerry Schmitz1-Feb-18 7:53
mveGerry Schmitz1-Feb-18 7:53 
QuestionIs it possible to make a class whose objects are castable into ints? Pin
arnold_w31-Jan-18 10:33
arnold_w31-Jan-18 10:33 
AnswerRe: Is it possible to make a class whose objects are castable into ints? Pin
Dave Kreskowiak31-Jan-18 11:24
mveDave Kreskowiak31-Jan-18 11:24 
GeneralRe: Is it possible to make a class whose objects are castable into ints? Pin
arnold_w6-Feb-18 0:25
arnold_w6-Feb-18 0:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.