A better way to decimate a file??
- To: mathgroup at smc.vnet.net
- Subject: [mg21350] A better way to decimate a file??
- From: rob-piovere at swbell.net (Rob Peterson)
- Date: Tue, 28 Dec 1999 00:49:35 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I start with a list y that I need to decimate (sp?). I've looked thru
the book and the only list function I can find to dump list elements
is the Drop[] function. But, the best I can do is get rid of half of
the elements at a time. I want to decimate this list by 16, ie I want
to dump 15 of every 16 entries. So, I dump half of them four times.
This seems to work but I figure the pros hanging in this group will
know a much more elegant way to do this. I did this:
(* start with y as the list and ly = Length[y] *)
y2 = Drop[y, {1, ly, 2}]; ly2 = Length[y2]
y4 = Drop[y2, {1, ly2, 2}]; ly4 = Length[y4]
and so on
So how should it really be done? I'd like to be able to decimate by
non-binary numbers too.
Thanks, Rob
- Follow-Ups:
- Re: A better way to decimate a file??
- From: Andrew Watson <abwatson@mail.arc.nasa.gov>
- Re: A better way to decimate a file??