0

I have a very large signal with 20Hz sampling frequency and I am using moving average (movavg) fuction with n=20 to make it smooth but in result I get a signal with the same sampling rate as the input. Is there a function which takes input and applies moving average filter and return a down sampled signal. Best Regards.

  • Welcome to Stackoverflow. Please see [https://stackoverflow.com/help/mcve] and [https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example] on how to create a minimal, reproducible example. – Chriss Paul Sep 04 '18 at 23:44

1 Answers1

1

You can keep one observation every 20 of the smoothed signal x[x%%20 == 0].

Which one you take must not have a significant impact as long as it is regular. You can get reassurance by comparing x[x%%20==0], x[x%%20==1], x[x%%20==2],...

AlainD
  • 6,187
  • 3
  • 17
  • 31