W3C home > Mailing lists > Public > public-audio@w3.org > April to June 2016

Re: two questions about FFT/IFFT

From: Paul Adenot <padenot@mozilla.com>
Date: Wed, 13 Apr 2016 11:15:22 +0200
Message-ID: <CANWt0Wr989P6eSYJ2O8HBnyUkQsb+3WTTJiNu3wnNzCx_+aG-g@mail.gmail.com>
To: Matt Diamond <mdiamond@jhu.edu>
Cc: Raymond Toy <rtoy@google.com>, "public-audio@w3.org" <public-audio@w3.org>
Something like this maybe ?

function frequencyForBinIndex(index) {    return (index - 1) *
  this.audioContext.sampleRate /           this.analyser.fftSize;}
Paul.



On Wed, Apr 13, 2016 at 2:04 AM, Matt Diamond <mdiamond@jhu.edu> wrote:

> Thanks for the reply. This might be a silly question, but is there an
> equation I can use to reliably calculate the actual frequency range of each
> bin returned by the analyser? I get an array of decibel values but I don't
> know exactly what frequencies they correspond to.
>
> Matt
>
> On Tue, Apr 12, 2016 at 7:32 PM, Raymond Toy <rtoy@google.com> wrote:
>
>>
>>
>> On Tue, Apr 12, 2016 at 2:24 PM, Matt Diamond <mdiamond@jhu.edu> wrote:
>>
>>> 1) Is it possible to do a non-realtime spectral analysis of a
>>> BufferSource using an AnalyserNode with an OfflineAudioContext?
>>>
>>
>> Yes, but you probably need to use suspend/resume to get correct timing.
>>
>>>
>>> 2) Is it possible for me to use a PeriodicWave to convert an array of
>>> frequency data from the Analyser Node back into a time-domain waveform? It
>>> seems like this isn't possible.
>>>
>>
>> Right.  The analyser loses the phase information so you can't get the
>> original back.
>>
>>>
>>> Basically I'd like to come up with a web-based version of the spectral
>>> averaging technique that R Luke DuBois employed on Timelapse... averaging
>>> the spectral content of an entire buffer and then reproducing that content
>>> as a sustained drone. Is that possible yet with the Web Audio API as it
>>> currently exists?
>>>
>>> Thanks,
>>> Matt Diamond
>>>
>>
>>
>
Received on Wednesday, 13 April 2016 09:16:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 13 April 2016 09:16:12 UTC