# How to smooth data in the FreeFem++ (like movemean in matlab)

**URL:** <https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672>\
**Category:** General Discussion\
**Created:** [August 30, 2023, 4:40pm UTC](https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672 "2023-08-30T16:40:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)\
**Post date:** [August 30, 2023, 4:40pm UTC](https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672/1 "2023-08-30T16:40:28Z")

</div>

Dear all,  
I meet this problem these days. I get some data after the simulation(NS equations) , but it isn’t so smooth (with some high frequency part in space) and I want to use some way to filter it or smooth it.  
Is there any way in the FreeFem++ that may help me?  
Thanks a lot !

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [August 31, 2023, 7:51pm UTC](https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672/2 "2023-08-31T19:51:29Z")

</div>

To day no real way, but it is very simple to write the function like movemean , but I think this function make a to big smoothing.

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [September 1, 2023, 3:18pm UTC](https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672/3 "2023-09-01T15:18:50Z")

</div>

I guess you could just interpolate into a coarser mesh or series of meshes  
if this accomplishes an acceptable result  
With moving average on an actual grid you can easily look at frequency  
response although with the mesh and element selection it may be a bit  
more empirical.

---

<div class="post-metadata">

**Author:** ![clthu](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clthu](https://community.freefem.org/u/clthu)\
**Post date:** [September 4, 2023, 12:38pm UTC](https://community.freefem.org/t/how-to-smooth-data-in-the-freefem-like-movemean-in-matlab/2672/4 "2023-09-04T12:38:49Z")

</div>

Thanks for both suggestions！ I have tried to interpolate and the results are OK, and then I use my solver to solve the equations after the interpolating again.
