• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java sound - calculating amplitude

 
Ranch Hand
Posts: 41
Python Angular Framework Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have written a java application that records an audio wave and does some processing on it.
My array of audio samples is in this format :
Sample rate = 14000 Hz
Sample size in bits = 16
Number of channels = 1
unsigned sample values
and it's in little endian order

The application purpose is to calculate three things :
1. Frequency
2. Amplitude
3. Phase

According to frequency, iv'e used the FFT algorithm on the sampled array and got an accurate result.
but ... according to amplitude ...
my samples array is 16-bit for each sample, so the value range is -32768 to 32767.
How can i convert this number into a meaningful unit of measure (like : meter) ?
And does any one knows how can i compute the phase ?

 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may be better off posting on a sound engineers/audio forum and then coming back here if you can't implement the formulas given to you.

Having said that a quick search found an interesting and informative reply to a similar question on SO http://stackoverflow.com/questions/15134740/16bit-little-endian-byte-array-to-integer-array-to-decibel-value. I hope this helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic