Hi,
I manage to visualize the spectrum and know I'd like to add some scale at the abscissa, like all the thousand Hertz
any idea ?
thanks
Spectrum with scale
Hi,
I manage to visualize the spectrum and know I'd like to add some scale at the abscissa, like all the thousand Hertz
any idea ?
thanks
You mean adding labels to the axes? If so, check out Help Browser -> Pure Data -> 2.controle.examples -> 16.more.arrays.pd
hi,
yes that's what I mean, but how to know where is the 1000Hz, 4000Hz, 10 000Hz etc. on the abscissa?
thanks
Oh, I see. You're plotting a spectrum using FFT. Unfortunately, there isn't a simple way to plot the actually frequency, since the units of the x-axis are the bin numbers. So if you want the frequency to be plotted, you're just going to have to do it by hand and use comments or [cnv] to label different spots on the axis.
The frequency is linear, though, so it's not too much of a challenge. Just divide the frequency you want to plot by the maximum frequency being plotted, then multiply by the width in pixels. That'll give you exactly where it should show up, if you want to be that precise. Or just send some sine waves through it and plot the peaks.
thank you.
I arrived at this patch. I don't want a very precise analyser but I want it cover until 20kHz. And as you see I'm a novice with FFT.
I'va got this problems :
magnitude isn't constant
frequency axis isn't so much linear
is-there a solution ? (mainly for the first)
thanks
Right now, you aren't windowing the FFT, which is the same thing as using a rectangular window. This kind of window can get a lot of bleed from nearby frequencies while also having too narrow of a passband to pick up frequencies that don' lie right in the middle of a bin. For plotting spectra, I personally like the Blackmann-Harris window or the Kaiser window. Check out the windowing library in Pd-extended for objects that will generate the window for you.
The frequency in FFT is always linear, it just may not quite appear that way because of your magnitude issue.
What is the [biquad~] and [hip~] for?
Thanks,
don't know for [biquad~] and [hip~] : things I saw and recopied.
I've put block size to 1024 samples (the magintude is more stable like this) and know I arrived at what I expected.
there is just one thing which insn't clear for me :
what's the link between the block size and the array size of magintude ?
(I chose it empirically and I found a good result for an array size equal to (a little bit less than) half of the block size)
thank you
If you're using [rfft~], the array should be half the block size. [fft~] will give you the full block size, but that accounts for 0 Hz up to the sample rate. For real signals (such as sound), anything above half the sample rate is just a mirror image of everything below, and so it's likely useless if all you're trying to do is plot the spectrum of audio.
Oops! Looks like something went wrong!