log frequency graphing

Jan 16, 2006 at 11:03pm

log frequency graphing

Hi,

I am suffering from “patcher’s block” (like writer’s block) looking
for a way to graph fft amplitude frames on a log frequency scale.
Spectrograph~ is almost, but not quite, what I need for this patch.
Using the vectral~ help file as a starting point, I thought maybe
warping the signal going from the fft ramp outlet to vectral~’s index
inlets would work, but I couldn’t find documentation about those
inlets and my experiments didn’t seem to work. There must be an
obvious approach I am missing…any ideas, examples, or other
thoughts to help get me un-stuck on this?

Thanks a lot!!

-Alex

#23964
Jan 17, 2006 at 12:50am

Hi Alex,
Well, if you’re working in pfft~, and you don’t have to worry about
the mirror image at the top of your fft, just use log~, and then rescale
log~’s output to your frame size. For example, if your fft index (the
third output from fftin~) goes from 0-256, that means that log~’s output
will go from 0-8 (using the default base 2). Then multiply that signal
by 32 to get you back to your original frame size, but now you’ve
log-scaled your frequency. Use that signal as the middle input to
vectral~. The left input signal can just be your ordinary, unaltered
index output from the fftin~.
If you are using fft~ rather than pfft~, you’ll need to split up your
index signal into its two halves and do a little math on the mirror
image part.
Other tips:
filter out the zeros going to your log~ object!
experiment with different log bases

have fun,
jim

#68547
Jan 17, 2006 at 1:17am

#68548
Jan 17, 2006 at 1:29am

What about the logarithmic option in the Spectrograph~ object’s option
dialog isn’t working for you? What else do you need it to do?

_Mark

#68549
Jan 17, 2006 at 2:32am

#68550
Jan 17, 2006 at 8:58am

If you have Jitter, you can look at jit-examples/audio/audio-viz/
1.audioviz_simple_jit_fft.pat. This should do what you need. The
log display works by generating a power function in a buffer~ which
is used by lookup~ to warp the x axis of the graph.

-Randy

#68551
Jan 18, 2006 at 12:49am

Thanks, this approach is working for me now!

-Alex

#68552
Jan 18, 2006 at 1:07am

i needed a bipolar graph of the difference between two spectra.

-Alex

#68553

You must be logged in to reply to this topic.