W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: AnalyzerNode - magnitude/phase

From: Nick Thompson <ncthom91@gmail.com>
Date: Fri, 27 Sep 2013 10:43:15 -0700
Message-ID: <CAOXEKCMCUXbM3Uyd-=recT2v7YhHmGHssqhoCotYwLq2YjH0ow@mail.gmail.com>
To: Chris Lilley <chris@w3.org>
Cc: Chris Lowis <chris.lowis@gmail.com>, public-audio@w3.org
Hi all,

I wrote a similar email out to this group a few weeks ago but never
followed up with it. I agree with the notion that the phase data should be
accessible too, as there are certainly useful possibilities for an
AnalyserNode outside of visualization.

Digging through the webkit source code on github, it seems like it would be
a simple matter to augment the `getFloatFrequencyData()` method to accept
two arrays as arguments (one for the real numbers, one for the imaginary
numbers) and just write the values to both of them rather than calculating
the magnitude:
https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp#L195

With that, I'd put in a vote for Chris' option (i).

Cheers,
Nick


On Fri, Sep 27, 2013 at 10:18 AM, Chris Lilley <chris@w3.org> wrote:

> Hello Chris,
>
> Friday, September 27, 2013, 11:22:52 AM, you wrote:
>
> > i) Allow getFloatFrequencyData() to return an array of complex values
> somehow.
>
> Seems more technically correct and less likely to be implemented (oh
> no, complex numbers)
>
> > ii) Add methods for getRealFrequencyData() and
> getImaginaryFrequencyData()
>
> ditto (name is correct but scary)
>
> > iii) Add getFloatPhaseData() which would return the phase of the
> > calculated spectrum, and leave getFloatFrequencyData() returning the
> > magnitude.
>
> That seems like the best option to me. And yes, getting the phase is
> useful. What about an allpass filter as an example? Square waves in,
> tilted square waves out, that sort of thing.
>
>
> --
> Best regards,
>  Chris                            mailto:chris@w3.org
>
>
>


-- 
Nicholas Thompson
B.S. Computer Science
Cornell University, 2013
Received on Friday, 27 September 2013 17:43:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:11 UTC