Solved

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

Posted on 2003-10-24
5
148 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

14 Experts available now in Live!

Get 1:1 Help Now