Python Forum
From theory to practice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
From theory to practice
#4
okay... so re-reading the numpy array documentation I get that it actually has a field for the data type which in this case is int16.. so 16bit signed integer.

I was a bit hung up on this:

Output:
[[-1 -2]  [ 1  1]  [-4 -3]  ...,  [ 4 -2]  [-4  2]  [ 4 -1]] (44100, array([[-1, -2],        [ 1,  1],        [-4, -3],        ...,        [ 4, -2],        [-4,  2],        [ 4, -1]], dtype=int16))
first one is printing out "audio" and the other is printing out "original" from the code of the original post... one is with a lot of commas... (the way I expected it to be after reading the manual) and the other isn't... just drops one in the middle where it doesn't really belong.

Okay... so now that I have an actual idea of how the data is represented I can think about altering the way I want to.

First I wanted to have it converted to mono... so generally you take the left and right samples and average them:

length = audio.shape[0]
mono = (audio[0:length:1, 0]+audio[0:length:1, 1])/2
Now there are two things I am wondering about:
The shape of the new array is this:
Output:
(210331,)
This means it's still a n by 2 array, right?

And secondly what is the best way to convert the datatype into float? So that I can work with a range of values from -1 to 1.
Reply


Messages In This Thread
From theory to practice - by bertibott - Feb-24-2017, 01:12 PM
RE: From theory to practice - by stranac - Feb-24-2017, 01:51 PM
RE: From theory to practice - by zivoni - Feb-24-2017, 02:19 PM
RE: From theory to practice - by bertibott - Feb-24-2017, 03:53 PM
RE: From theory to practice - by zivoni - Feb-24-2017, 04:55 PM
RE: From theory to practice - by Mekire - Feb-24-2017, 04:36 PM
RE: From theory to practice - by bertibott - Feb-24-2017, 04:51 PM
RE: From theory to practice - by zivoni - Feb-24-2017, 05:22 PM
RE: From theory to practice - by Mekire - Feb-24-2017, 05:07 PM
RE: From theory to practice - by bertibott - Feb-24-2017, 05:46 PM
RE: From theory to practice - by sparkz_alot - Feb-24-2017, 08:32 PM
RE: From theory to practice - by zivoni - Feb-24-2017, 09:37 PM
RE: From theory to practice - by sparkz_alot - Feb-25-2017, 12:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  .xls processing with Pandas - my struggle moving from theory to practical use prolle 0 1,584 May-21-2020, 06:57 PM
Last Post: prolle
  Help with Data Match Theory randor 2 2,065 Dec-25-2019, 05:57 PM
Last Post: randor

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020