W3C home > Mailing lists > Public > public-audio-dev@w3.org > March 2013

Re: FFT & IFFT with Web Audio API

From: Chris Wilson <cwilso@google.com>
Date: Fri, 22 Mar 2013 09:23:45 -0700
Message-ID: <CAJK2wqXiLttcThyONYyOftqLPCP4MV_gR9Gm5M3YVSzCnmj_mw@mail.gmail.com>
To: Michael Weitnauer <weitnauer@irt.de>
Cc: "public-audio-dev@w3.org" <public-audio-dev@w3.org>
Hi Michael,
You can obtain frequency domain data of an audio-rate signal with
AnalyserNode.getFloatFrequencyData(), as you understood; the array values
you will receive back from that call are signal levels (in dB, if I recall
correctly) of each frequency band (the frequencyBinCount frequency bands
are spread linearly across the frequency spectrum, from 0...Nyquist
frequency of the current AudioContext).    The phase components are not
accessible, though, I believe - the AnalyserNode is really designed to be a
visualizer (and great debugging tool!), not a general-purpose FTT.

WaveTable *is* intended for use with the OscillatorNode.  You can't quite
use it as a general-purpose IFFT, except in some fairly restricted

In short, it seems like you'll need your own FFT/IFFT, unless you want to
think through what signal processing you're trying to do and construct it
as AudioNodes.  (This can be quite powerful, depending on what you're
trying to do; for example, my Web Audio
Vocoder<http://webaudiovocoder.appspot.com/>does not use any direct
JavaScript audio processing at all.)

On Thu, Mar 21, 2013 at 8:34 AM, Michael Weitnauer <weitnauer@irt.de> wrote:

> Hi all,
> I wonder whether there is (or maybe will be) the possibility to conduct a
> FFT and an IFFT with the Web Audio API. As far as I understood from the
> Working Draft, it's somehow possible to get some frequency domain data via
> the* getFloatFrequencyData() *method of the AnalyserNode. But it's not
> clear to me, which kind of data I would receive from this method. The
> Working Draft is - at least to me - not clear in this point. By using a
> WaveTableNode, it might be possible to conduct an IFFT, but this feature
> seems to be limited for the usage along with an OscillatorNode.
> My intention is to conduct some signal processing (in real-time) with the
> Web Audio API and for that I need buffers with complex values in the
> frequency domain.
> I would love to read some answers. Thanks anyway for you help,
> Michael
> ---------------------------------------------------------
> Michael Weitnauer
> Production Systems Audio
> Institut fuer Rundfunktechnik GmbH (IRT)
> R&D Institute of ARD, ZDF, DRadio, ORF and SRG/SSR
> Floriansmuehlstr. 60, D-80939 Muenchen, Germany
> Email: weitnauer@irt.de
> Web: http://www.irt.de
> Phone: +49 89 32399-387
> Managing director:  Dr. Klaus Illgner-Fehns
> Registration court:  Munich Commercial, Register No. B 5191
Received on Friday, 22 March 2013 16:24:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:43:28 UTC