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


Groups > comp.lang.python > #28851

Re: Numpy combine channels

Newsgroups comp.lang.python
Date 2012-09-10 13:14 -0700
References <de5d9415-f3d8-47b9-bcc2-822dc57fd1d8@googlegroups.com> <mailman.465.1347307911.27098.python-list@python.org>
Subject Re: Numpy combine channels
From Wanderer <wanderer@dialup4less.com>
Message-ID <mailman.466.1347308061.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Monday, September 10, 2012 4:12:40 PM UTC-4, MRAB wrote:
> 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])

I'm decoding morse code. So it's CV dots and dashes.

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