I\'m doing video analysis.
The end result array I get is something like:
signal =
Columns 1 through 7
73960 73960 73960 73
This VBA

Sub NewGraph()
Dim X
Dim Y
Dim lngRow As Long
Dim lngCnt As Long
Dim Chr As ChartObject
X = Range([a1], Cells(Rows.Count, "b").End(xlUp))
Y = Application.Transpose(X)
For lngRow = 2 To UBound(X, 1) - 1
If X(lngRow, 2) > X(lngRow - 1, 2) Then
If X(lngRow, 2) > X(lngRow + 1, 2) Then
lngCnt = lngCnt + 1
Y(1, lngCnt) = X(lngRow, 1)
Y(2, lngCnt) = X(lngRow, 2)
End If
Else
If X(lngRow, 2) < X(lngRow + 1, 2) Then
lngCnt = lngCnt + 1
Y(1, lngCnt) = X(lngRow, 1)
Y(2, lngCnt) = X(lngRow, 2)
End If
End If
Next lngRow
ReDim Preserve Y(1 To 2, 1 To lngCnt)
Set Chr = ActiveSheet.ChartObjects.Add(250, 175, 275, 200)
With Chr.Chart
With .SeriesCollection.NewSeries
.XValues = Application.Index(Application.Transpose(Y), 0, 1)
.Values = Application.Index(Application.Transpose(Y), 0, 2)
End With
.ChartType = xlXYScatter
End With
End Sub