Need a code to calculate average value

I need to get an average value out of all the frequency values that I am getting out of a wind speed module. I have connected the module's output to the analog IN pin 0 of arduino and trying to get an ave. value of all these frequency values displayed on the COM port over a period of time. e.g. the total inputs over 1 min needs to displayed at once on COM port. Any help on how to write the code would be appreciated.

Is this what you need...

http://www.arduino.cc/playground/Code/AverageList

Thanks a lot for the reply. I am trying to understand the code. I will let you know if I have more questions. Thanks again.

How do I change the following part of the code to - "int reading =analogRead(0);" I need to get 10-20 analog values from here and then average them.

The code in the average sketch is:

void loop() {
sample rand = random(1,100)/1.5; //how do I change this so it takes 10 analog value?

list.addValue( rand );

I got it. thanks. I just put analogRead(0) and it worked.