Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Multiple application of LinearFilter

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64844] Re: Multiple application of LinearFilter
  • From: bghiggins at ucdavis.edu
  • Date: Sun, 5 Mar 2006 03:19:06 -0500 (EST)
  • References: <dubjps$h0t$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Lea,

 Use NestList or Nest as shown below:

<<Statistics`DataSmoothing`

data1 = {7.,4.,5.,3.,8.,5.,2.,3.,6.,8.};

This function displays the data after each pass through the filter, up
to n passes:

myFilter[n_Integer]:=NestList[LinearFilter[#,{1/2,1/2}]&,data1,n]

myFilter[4]

This function displays the data after n passes through the filter:

myFilter2[n_Integer]:=Nest[LinearFilter[#,{1/2,1/2}]&,data1,n]

myFilter2[4]

Hope this helps,

Cheers,

Brian


  • Prev by Date: mathematica to word
  • Next by Date: Re: three column output
  • Previous by thread: Re: Multiple application of LinearFilter
  • Next by thread: Re: Multiple application of LinearFilter