# Mean of array

**URL:** <https://discourse.julialang.org/t/mean-of-array/26081>\
**Category:** General Usage\
**Tags:** smoothing\
**Created:** [July 6, 2019, 10:36pm UTC](https://discourse.julialang.org/t/mean-of-array/26081 "2019-07-06T22:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erik\_michtich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erik_michtich/32/9208_2.png) [@erik\_michtich](https://discourse.julialang.org/u/erik_michtich)\
**Post date:** [July 6, 2019, 10:36pm UTC](https://discourse.julialang.org/t/mean-of-array/26081/1 "2019-07-06T22:36:52Z")

</div>

Hello,  
Unfortunately, i am a complete newbie to julia and need some help. I have an Array with pretty different point and should compute a straighter curve, probably of means. Does anybody know how i can do this, are there packages helping me?

 ![IMG-20190702-WA0004](https://global.discourse-cdn.com/julialang/original/3X/9/f/9f09e3873e1f47682059f737fc4f9516a85826fb.jpeg)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [July 6, 2019, 11:58pm UTC](https://discourse.julialang.org/t/mean-of-array/26081/2 "2019-07-06T23:58:52Z")

</div>

> [@erik\_michtich](#):
>
> should compute a straighter curve

is it straight or curve? if by straighter you mean smoother, you may want to plot rolling average, either manually do some processing or use some package like [GitHub - dysonance/Temporal.jl: Time series implementation for the Julia language focused on efficiency and flexibility](https://github.com/dysonance/Temporal.jl)

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [July 7, 2019, 1:30am UTC](https://discourse.julialang.org/t/mean-of-array/26081/3 "2019-07-07T01:30:39Z")

</div>

A smoothing kernel may be appropriate:

> **[GitHub - panlanfeng/KernelEstimator.jl: The julia package for nonparametric...](https://github.com/panlanfeng/KernelEstimator.jl)**
>
> The julia package for nonparametric density estimate and regression - GitHub - panlanfeng/KernelEstimator.jl: The julia package for nonparametric density estimate and regression

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [July 7, 2019, 4:33am UTC](https://discourse.julialang.org/t/mean-of-array/26081/4 "2019-07-07T04:33:30Z")

</div>

I think you mean

“I have a very noisy signal. I want to filter out the noise and have the base signal instead”

But to do that you need to know what characteristic the noise have. And what characteristic the signal have. For example, if you knew the signal is SLOW CHANGING then you can use a filter to filter out the high frequencies in your data.

As others have mentioned, you can start with a simple MOVING AVERAGES algorithm.

> **[Moving average](https://en.wikipedia.org/wiki/Moving_average)**
>
> In statistics, a moving average (rolling average or running average) is a calculation to analyze data points by creating a series of averages of different selections of the full data set. It is also called a moving mean (MM) or rolling mean and is a type of finite impulse response filter. Variations include: simple, cumulative, or weighted forms (described below).
> A moving average filter is sometimes called a boxcar filter, especially when followed by decimation.
> Given a series of numbers and a...

> **[Digital filter](https://en.wikipedia.org/wiki/Digital_filter)**
>
> In signal processing, a digital filter is a system that performs mathematical operations on a sampled, discrete-time signal to reduce or enhance certain aspects of that signal. This is in contrast to the other major type of electronic filter, the analog filter, which is typically an electronic circuit operating on continuous-time analog signals.
> A digital filter system usually consists of an analog-to-digital converter (ADC) to sample the input signal, followed by a microprocessor and some peri...
