Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28847

RE: Numpy combine channels

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <nick.cash@npcinternational.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'skip:[ 20': 0.03; 'that?': 0.05; '[1,': 0.09; 'received:216.32.180': 0.09; '2],': 0.16; '[2,': 0.16; 'nick': 0.16; 'numpy': 0.16; 'thanks,': 0.18; 'to:name:python-list@python.org': 0.20; 'to:2**1': 0.23; 'received:169.254': 0.24; 'command': 0.24; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'necessary.': 0.27; 'received:216.32': 0.27; 'array': 0.29; 'received:169': 0.29; 'header:Received:8': 0.30; 'to:addr:python-list': 0.33; 'list': 0.35; 'received:bigfish.com': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'received:216': 0.62; 'received:169.254.8': 0.84; 'stereo': 0.84
X-Forefront-Antispam-Report CIP:157.56.236.229; KIP:(null); UIP:(null); IPV:NLI; H:BY2PRD0611HT005.namprd06.prod.outlook.com; RD:none; EFVD:NLI
X-SpamScore -1
X-BigFish PS-1(zz4015Izz1202h1d1ahzzz2fh2a8h668h839h944hd25hf0ah107ah1220h1288h12a5h12a9h1155h)
Received-SPF pass (mail75-co1: domain of npcinternational.com designates 157.56.236.229 as permitted sender) client-ip=157.56.236.229; envelope-from=nick.cash@npcinternational.com; helo=BY2PRD0611HT005.namprd06.prod.outlook.com ; .outlook.com ;
From Nick Cash <nick.cash@npcinternational.com>
To Wanderer <wanderer@dialup4less.com>, "python-list@python.org" <python-list@python.org>
Subject RE: Numpy combine channels
Thread-Topic Numpy combine channels
Thread-Index AQHNj4wrX2iRaRAAskamuNzsdzBtRZeD+ylw
Date Mon, 10 Sep 2012 19:50:09 +0000
References <de5d9415-f3d8-47b9-bcc2-822dc57fd1d8@googlegroups.com>
In-Reply-To <de5d9415-f3d8-47b9-bcc2-822dc57fd1d8@googlegroups.com>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [70.166.238.194]
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-OriginatorOrg npcinternational.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.464.1347307538.27098.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347307538 news.xs4all.nl 6957 [2001:888:2000:d::a6]:33087
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28847

Show key headers only | View raw


> I have an array generated by audiolab of left and right stereo
> channels. It looks like [[1,1],[1,2],[2,3]]. I would like to combine
> the left and right channels to get an array [2,3,5]. Is there a numpy
> command to do that?

You may be over-thinking this, and numpy might not be necessary.

A simple solution would be just a quick list comprehension:

stereo_array = [[1, 1], [1, 2], [2, 3]]
mono_array = [l+r for (l, r) in stereo_array]

Thanks,
Nick Cash

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 12:39 -0700
  Re: Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 12:56 -0700
  RE: Numpy combine channels Nick Cash <nick.cash@npcinternational.com> - 2012-09-10 19:50 +0000
  Re: Numpy combine channels MRAB <python@mrabarnett.plus.com> - 2012-09-10 21:11 +0100
    Re: Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 13:14 -0700
      Re: Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 13:15 -0700
      Re: Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 13:15 -0700
    Re: Numpy combine channels Wanderer <wanderer@dialup4less.com> - 2012-09-10 13:14 -0700
    Re: Numpy combine channels aahz@pythoncraft.com (Aahz) - 2012-11-09 20:30 -0800
      Re: Numpy combine channels Dave Angel <d@davea.name> - 2012-11-10 08:05 -0500

csiph-web