log frequency graphing
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!!
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
filter out the zeros going to your log~ object!
experiment with different log bases
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?
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.
Thanks, this approach is working for me now!
i needed a bipolar graph of the difference between two spectra.