Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7765729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:14:13+00:00 2026-06-01T15:14:13+00:00

So i have a .wav file. from this i got the data: as expected

  • 0

So i have a .wav file. from this i got the data:
as expected from a sound file it is in stereo so the data looks like

List 1 (Original List)

[ [1,2],
[2,3],
[4,9],
[1,5],
[1,7],
….]

Note: I just made up those numbers, however the point is it’s a nested list.
The problem here is I’m doing FFT on that and as such want to only use the average of the two channels so i want:

List 2 (Averaged)

[
[1.5],
[2.5],
[6.5],
[3],
[4],
….
]

so for that I did:

averaged_array =  [sum(x)/len(x) for x in original_list]

I assume len(x) is a constant time operation even though it will always be 2.

The problem here is that the length of the original list is >900,000 I believe. On my home computer I can average it in ~46 seconds. At the computer I have to use for the presentation it takes ~121 seconds. This is a sizeable increase and it frankly is bad to have to wait around while it runs. Is there anyway I can optimize this so the time it takes it reduced?

Note: I believe this is a double core computer so I cannot run this in parallel (I think?).
It is possible for me to ssh into a server (with a few i7’s running on it) which I’ve been given permission to use.. Would it be better if I somehow ssh’ed and did the calculations there? The original computer I’m using I believe is ~2 ghz but is an old dell model relative (the series from a few years ago). Additionally, McAfee and another process eat up ~50% of the processing as well and I have no rights to kill these.

If I do that:

  • How would I do the calculations on this remote computer via SSH? (I’m using python 2.7 and would really prefer not to install any external libraries as this is not my computer but an organization computer)
  • Would I be able to do the calculations in a sort of “order”? I thought that when doing things in parallel, you could not maintain order as it would be done as soon as a core is open to compute it. By order I mean: I want the list to maintain the average at the same index of the original list.
    Ex. [ [1,2], [3,4]] should give [ [2.5], [3.5]] not [ [3.5], [2.5]]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:14:15+00:00Added an answer on June 1, 2026 at 3:14 pm

    For this kind of tasks, you really want to use the de facto standard NumPy module. This module handles large arrays in an efficient way (it even does FFT for you, if this is what you need).

    Here is how you can do your average:

    >>> a = numpy.array([[1,2], [2,3], [4,9], [1,5], [1,7]])
    >>> numpy.average(a, axis=-1)
    array([ 1.5,  2.5,  6.5,  3. ,  4. ])
    

    Performing the average on an array of 1 million pairs takes only 22 ms on my machine.

    The FFT can then be done with the numpy.fft module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a linear PCM file (.wav) in my app and I would like
File formats I would like to play include .wav, .mp3, .midi. I have tried
I have created a voice recorder applet. The output sound file will be .wav
I have a situation where there is a corrupt WAV file from which I'm
I have a .wav file on the iPhone device that I would like to
I have a .wav music file. When I tried to play using SoundEffect.Play(); mus1.Play();
My problem is the following: I have a 2-minute long WAV file, and my
I have 2 wav files that I want to concatenate into one file with
If I already have the wav data in two arrays (left channel & right
I have tried this but it does not work (even if I specify .wav

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.