Solved

# Counting frequency of samples (numbers) - Search when values goes over 100

Posted on 2003-10-24
153 Views
Hi,

I am trying to make code which looks for "rising edges" of numbers stored in array.

I mean "rising edge" is first value over 100.

Code must increase some integer variable until "rising edge" have found. Then in resets integer variable to zero and continues looking for next "rising edge" with same time again increasing ineteger variable....and so on until all samples have gone thru.

So, basicly I am trying to calculate frequency of when sample value is over 100 fisrt time - rising edge.

i am looking for very fast code for this.

Example samples from array:

3
15
14
19
23
24
32
29
41
30
74
235
246
238
238
230
232
223
226
216
221
197
35
4
18
15
24
23
30
31
34
39
38
190
255
234
242
231
232
226
223
223
213
225
89
0
20
12
22
23
26
32
29
44
25
127
255
237
242
234
231
230
222
226
211
229
150
5
15
14
19
24
24
32
29
40
30
71
232
246
238
239
230
232
224
225
217
220
201
40
3
18
14
24
23
29
31
33
40
35
182
255
234
242
231
232
227
223
224
212
226
95
0
20
12
22
23
26
33
29
44
25
121
255
237
241
234
231
230
222
227
212
228
158
8
13
15
18
24
24
32
29
40
32
65
227
248
237
239
230
232
224
225
218
219
205
45
2
19
14
24
23
29
31
33
41
33
176
255
234
242
231
232
227
222
224
211
228
105
0
19
13
22
23
26
33
29
44
25
112
252
238
241
235
231
230
222
227
212
228
164
10
12
15
18
24
24
31
29
39
33
60
222
250
237
240
230
232
224
225
218
218
209
50
1
19
14
24
23
29
32
32
42
31
172
255
234
242
232
232
228
222
225
211
229
109
0
19
12
21
23
25
32
29
44
25
109
251
239
241
235
231
230
222
226
212
227
168
13
11
15
17
24
23
31
29
38
34
56
218
251
236
240
230
232
224
225
219
217
211
54
0
19
13
23
23
28

0
Question by:hsimola
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 4

Expert Comment

ID: 9617861
this is just a simple approach, not sure if that's what you wanted. your question was a bit confusing

var x: array [1..1000] of integer;
i: integer;
edgePos: integer;
begin
edgePos := 0;
for i:= 1 to 1000 do
begin
inc(edgePos);
if x[i]>100 then
begin
// print edgePos
edgePos := 0;
end;
end;
end;
0

LVL 4

Expert Comment

ID: 9619797
HI,
Try to explain your question once more. Give two or three examples of arrays and what freaquency you get for these very examples.
Sincerely,
Nestorua.
0

Author Comment

ID: 9625170
Hi,

I am trying to use following code for frequency counting :

http://www-tcsn.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20741065.html

I feed square wave to MIC input and try to calculate frequency between pulses rising edges.

0

LVL 1

Accepted Solution

Computer101 earned 0 total points
ID: 12388744
PAQed, with points refunded (250)

Computer101
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
###### Suggested Courses
Course of the Month8 days, 13 hours left to enroll