Solved

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

Posted on 2003-10-24
5
149 Views
Last Modified: 2010-04-16
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
Comment
Question by:hsimola
5 Comments
 
LVL 4

Expert Comment

by:brunomsilva
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

by:nestorua
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

by:hsimola
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

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

Computer101
E-E Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now