DSPRelated.com
Forums

logarithmic fft for musical notes?

Started by Barry January 21, 2005
Hi,

I was wondering are there FFTs available with bin widths that match
the frequency of a musical note. So, bin 10 say for C, bin 11 for Db,
bin 12 for D etc.

Are there any articles on this?

Perhaps I might be more interested in a psd for of this.

Cheers,

Barry.
"Barry" <bg_ie@yahoo.com> wrote in message
news:731cea69.0501211757.13a59cae@posting.google.com...
> Hi, > > I was wondering are there FFTs available with bin widths
that match
> the frequency of a musical note. So, bin 10 say for C, bin
11 for Db,
> bin 12 for D etc. > > Are there any articles on this? > > Perhaps I might be more interested in a psd for of this. > > Cheers, > > Barry.
I don't think you'll find an FFT that does this directly, but you could certainly construct a DFT that does this using table-driven frequencies. Note that you are back to an O(N^2)-type algorithm, but if you have few enough frequencies, you might get suitable performance.
John E. Hadstate wrote:
> "Barry" <bg_ie@yahoo.com> wrote in message > news:731cea69.0501211757.13a59cae@posting.google.com... > > Hi, > > > > I was wondering are there FFTs available with bin widths > that match > > the frequency of a musical note. So, bin 10 say for C, bin > 11 for Db, > > bin 12 for D etc. > > > > Are there any articles on this? > > > > Perhaps I might be more interested in a psd for of this. > > > > Cheers, > > > > Barry. > > I don't think you'll find an FFT that does this directly, > but you could certainly construct a DFT that does this using > table-driven frequencies. Note that you are back to an > O(N^2)-type algorithm, but if you have few enough > frequencies, you might get suitable performance.
Cheers.

I was thinking that a log psd would probably be the best option. For
example, an A4 note ranges from 428 to 452 Hz, but an A2 only ranges
from 107 to 113Hz. How might I estimate the power between from 107 to
113Hz and from 428 to 452?

I'm looking for an output something like this from my log psd  function
-

A0	0.001
A#	0 0.4
B0	0.021
C0	0.101
C#0	0.02
etc.

Any ideas where to start?

Thanks.

Woops, tring to get the hang of Google Groups Beta!

Cheers.

I was thinking that a log psd would probably be the best option. For
example, an A4 note ranges from 428 to 452 Hz, but an A2 only ranges
from 107 to 113Hz. How might I estimate the power between from 107 to
113Hz and from 428 to 452?

I'm looking for an output something like this from my log psd  function
-

A0	0.001
A#	0 0.4
B0	0.021
C0	0.101
C#0	0.02
etc.

Any ideas where to start?

Thanks.

bg_ie@yahoo.com wrote in news:1106427304.547451.22260
@c13g2000cwb.googlegroups.com:

> Cheers. > > I was thinking that a log psd would probably be the best option. For > example, an A4 note ranges from 428 to 452 Hz, but an A2 only ranges > from 107 to 113Hz. How might I estimate the power between from 107 to > 113Hz and from 428 to 452? > > I'm looking for an output something like this from my log psd function > - > > A0 0.001 > A# 0 0.4 > B0 0.021 > C0 0.101 > C#0 0.02 > etc. > > Any ideas where to start? > > Thanks. > >
I think what you really want is a filter bank with constant percentage bandwidth. In your case 1/12th octaves. These can be constructed with 12 IIR filters. If you decimate by 2 and rerun the filters, you get the next lower octave. You can partion your processing so that the highest octave takes 1/2 the computation time, the next 1/4, the next 1/8th etc. This is not particularly efficient as compared to the FFTs. An FFT method requires large FFTs or multiple FFTs at different sample rates. You add multiple bins together to synthesize each note bin. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
"Barry" <bg_ie@yahoo.com> wrote in message 
news:731cea69.0501211757.13a59cae@posting.google.com...
> Hi, > > I was wondering are there FFTs available with bin widths that match > the frequency of a musical note. So, bin 10 say for C, bin 11 for Db, > bin 12 for D etc. > > Are there any articles on this? >
Look up spectrum analyzers in various threads. That's usually what they do. There have been many discussions. One method would combine bins of a higher resolution FFT. Note there will be a lower frequency limit for the fractional bands. Fred
On 21 Jan 2005 17:57:52 -0800, bg_ie@yahoo.com (Barry) wrote:

>Hi, > >I was wondering are there FFTs available with bin widths that match >the frequency of a musical note. So, bin 10 say for C, bin 11 for Db, >bin 12 for D etc. > >Are there any articles on this? > >Perhaps I might be more interested in a psd for of this. > >Cheers, > >Barry.
You could use a modified constant-Q transform for this. Regards, Allan
Allan Herriman wrote:

> On 21 Jan 2005 17:57:52 -0800, bg_ie@yahoo.com (Barry) wrote: > > >>Hi, >> >>I was wondering are there FFTs available with bin widths that match >>the frequency of a musical note. So, bin 10 say for C, bin 11 for Db, >>bin 12 for D etc. >> >>Are there any articles on this? >> >>Perhaps I might be more interested in a psd for of this. >> >>Cheers, >> >>Barry. > > > You could use a modified constant-Q transform for this. > > Regards, > Allan
I just KNEW I'd seen something relevant discussed. I've lost my links -- any references to code?
On Mon, 24 Jan 2005 14:35:10 -0600, Richard Owlett
<rowlett@atlascomm.net> wrote:

>Allan Herriman wrote: > >> On 21 Jan 2005 17:57:52 -0800, bg_ie@yahoo.com (Barry) wrote: >> >> >>>Hi, >>> >>>I was wondering are there FFTs available with bin widths that match >>>the frequency of a musical note. So, bin 10 say for C, bin 11 for Db, >>>bin 12 for D etc. >>> >>>Are there any articles on this? >>> >>>Perhaps I might be more interested in a psd for of this. >>> >>>Cheers, >>> >>>Barry. >> >> >> You could use a modified constant-Q transform for this. >> >> Regards, >> Allan > >I just KNEW I'd seen something relevant discussed. >I've lost my links -- any references to code?
A vocoder filter array can do this, but the "transform" tag makes me also wonder if there's a better way to do that. Tony (remove the "_" to reply by email)