       Re: simpler way to get a particular banded matrix?

• To: mathgroup at smc.vnet.net
• Subject: [mg98146] Re: simpler way to get a particular banded matrix?
• From: rip pelletier <bitbucket at comcast.net>
• Date: Tue, 31 Mar 2009 04:19:46 -0500 (EST)
• References: <gqq3tb\$7n6\$1@smc.vnet.net>

```In article <gqq3tb\$7n6\$1 at smc.vnet.net>, Bob Hanlon <hanlonr at cox.net>
wrote:

> H = {h0, h1, h2, h3, h4, h5};
> rH = Reverse[H];
> z = Table[0, {5}];
>
> Take[#, -6] & /@
>  NestList[RotateRight[#, 2] &, Join[rH, z], 5]
>
> Table[Take[Join[z, rH, z], {13, 18} - 2 n], {n, 6}]
>
>
> Bob Hanlon

This time let me thank you publicly, Bob. Having looked at your
solution, I've used some of it ­ rotating a larger h vector with zeroes
in it.

Vale,
Rip

>
> ---- rip pelletier <bitbucket at comcast.net> wrote:
>
> =============
> Hi,
>
> 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. Here's
> what i did:
>
> SparseArray[Band[{1,1}]->H,{6,6}]+
> SparseArray[Band[{2,3}]->H,{6,6}]+
> SparseArray[Band[{3,5}]->H,{6,6}]+
> SparseArray[Band[{-2,-3},{1,1},{-1,-1}]->rH,{6,6}]+
> SparseArray[Band[{-3,-5},{1,1},{-1,-1}]->rH,{6,6}]
>
> where
>
> 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?
>
> TIA and vale,
>    rip

--
NB eddress is r i p 1 AT c o m c a s t DOT n e t

```

• Prev by Date: Using manipulate in two cells in one note book crashes my computer.
• Next by Date: Re: Integrating package documentation with the documentation center
• Previous by thread: Re: simpler way to get a particular banded matrix?
• Next by thread: Re: simpler way to get a particular banded matrix?