Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28848
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python@mrabarnett.plus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.021 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'skip:[ 20': 0.03; 'that?': 0.05; '[1,': 0.09; 'value.': 0.15; '2],': 0.16; '[2,': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'numpy': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'import': 0.21; 'command': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'looks': 0.26; 'received:192.168.1.3': 0.29; 'array': 0.29; 'probably': 0.29; 'to:addr:python-list': 0.33; 'there': 0.35; 'but': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'maximum': 0.63; 'sum': 0.66; 'header:Reply-To:1': 0.68; 'skip:n 30': 0.69; 'reply-to:no real name:2**0': 0.72; 'average.': 0.84; 'reply- to:addr:python.org': 0.84; 'stereo': 0.84 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.0 cv=W6e6pGqk c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=lR6CHUT36vYA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=kZIQh7jScyYA:10 a=PeOeGrWN0p5IMPFtStkA:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 |
| X-AUTH | mrabarnett:2500 |
| Date | Mon, 10 Sep 2012 21:11:46 +0100 |
| From | MRAB <python@mrabarnett.plus.com> |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Numpy combine channels |
| References | <de5d9415-f3d8-47b9-bcc2-822dc57fd1d8@googlegroups.com> |
| In-Reply-To | <de5d9415-f3d8-47b9-bcc2-822dc57fd1d8@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | python-list@python.org |
| 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.465.1347307911.27098.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1347307911 news.xs4all.nl 6984 [2001:888:2000:d::a6]:37533 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:28848 |
Show key headers only | View raw
On 10/09/2012 20:39, Wanderer wrote:
> 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?
>
>>> import numpy
>>> numpy.array([[1,1],[1,2],[2,3]], dtype="i")
array([[1, 1],
[1, 2],
[2, 3]])
>>> a[:, 0]
array([1, 1, 2])
>>> a[:, 1]
array([1, 2, 3])
>>> a[:, 0] + a[:, 1]
array([2, 3, 5])
But should they be added together to make mono?
Suppose, for example, that both channels have a maximum value. Their
sum would be _twice_ the maximum.
Therefore, I think that it should probably be the average.
>>> (a[:, 0] + a[:, 1]) / 2
array([1, 1, 2])
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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