Generating (time, amplitude) data table using sound samples

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
princee
Posts: 2
Joined: Fri Jan 02, 2015 2:21 am
Operating System: Please select

Generating (time, amplitude) data table using sound samples

Post by princee » Tue Jan 06, 2015 1:17 am

   
How do I return the points of every nth sample in a .wav file?

I want to export the amplitude of each sample with respect to time into a file.
Note that my sound files are only 1 second long, so I don't think the data processing will be too difficult. Thus, I think that the n in "every nth" is 1.

See the below picture for clarification:
Image


Also, if possible, how can I create a best fit curve — preferably in the form

Code: Select all

a * sin(bx + c) + d
for a selection of sound samples?

Thanks!

steve
Site Admin
Posts: 80751
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Generating (time, amplitude) data table using sound samp

Post by steve » Tue Jan 06, 2015 1:39 am

9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: Generating (time, amplitude) data table using sound samp

Post by Robert J. H. » Tue Jan 06, 2015 5:32 am

steve wrote:How about "Sample Data Export"?
http://manual.audacityteam.org/o/man/sa ... xport.html
Since you want only each nth sample, you could preprocess the audio.
  1. open the nyquist prompt
  2. Code: Select all

    (snd-avg s 1 <nth sample> op-average)
    --> OK
  3. Change the sample rate in the track dropdown menu (Set Rate --> Other)
The last point is optional but it assures the right time indexing.
The new sample rate is

Code: Select all

old sample rate / nth sample
The code is meant to work with mono tracks, don't enter < and >, just the number.

Post Reply