Re: simpler way to get a particular banded matrix?
- To: mathgroup at smc.vnet.net
- Subject: [mg98190] Re: simpler way to get a particular banded matrix?
- From: Tammo Jan Dijkema <T.J.Dijkema at gmail.com>
- Date: Wed, 1 Apr 2009 06:00:24 -0500 (EST)
- References: <gqn910$2o$1@smc.vnet.net>
Op 2009-03-29 09:46:40 +0200, zei rip pelletier <bitbucket at comcast.net>:
>
> The following command constructs a matrix (typically denoted M0, it
> arises in filter banks in general, in Burrus, Gopinath, & Guo "intro to
> wavelets and wavelet transforms: a primer" in particular).
>
> I'm sure there's a way to do this without typing out all 5 bands.
> H={h0,h1,h2,h3,h4,h5};
> rH=Reverse[H];
>
> I get what I want:
>
> h0 0 0 0 0 0
> h2 h1 h0 0 0 0
> h4 h3 h2 h1 h0 0
> 0 h5 h4 h3 h2 h1
> 0 0 0 h5 h4 h3
> 0 0 0 0 0 h5
>
> Any easier ways to get this?
How about
Part[SparseArray[=E2=80=A8 MapIndexed[(Band[{1, First[#2]}, Automatic, {1,
2}] -> #) &, rH]=E2=80=A8 , {6, 11}], All, 6 ;;] // MatrixForm
Regards,
Tammo Jan