Re: Basic sample code for FFT audio frequency spectrum? Sarcasm Maybe?
Re: Basic sample code for FFT audio frequency spectrum? Sarcasm Maybe?
- Subject: Re: Basic sample code for FFT audio frequency spectrum? Sarcasm Maybe?
- From: Nigel Redmon <email@hidden>
- Date: Fri, 6 Jul 2007 02:14:53 -0700
Hi Matt,
The answer isn't so clear cut because it's a bit of a loaded
question... For instance, if you ask "I need to plot the response my
this low-pass filter I made... how do I figure out the response?"--
that's easy. If you talking about doing a spectrum analyzer, then
you're asking people to make a ton of implementation decisions for
you. Now, maybe you can find some source code that does what you
want, but of course you can google for that as well as I can, so that
doesn't seem to be the issue you're presenting. (Or maybe it is and
you couldn't find exactly what you want, and you're hoping someone
else has, but as James noted--"Everything I have looked at is very
complex and I am having trouble extracting the basics"--you're not
going so find a routine and a few function calls and "ta-duh".)
An FFT converts one cycle of a repeating waveform to its harmonic
components. Implicit there is that you have exactly one cycle, and
that cycle repeat continuously. Well, that's really a DFT--an FFT is
an optimization that makes it more efficient, but stipulates
conditions on the number of samples that make up that one cycle--
typically a power of two. And the number of samples dictates the
frequency resolution as well, so you have to make a decision there.
First you are rarely going to be lucky enough to grab exactly one
cycle in the power-of-two you chose, and second, it's unlikely you
are trying to measure a static waveform.
From there, you begin your journey of decisions and trade-offs.
Basically, you can work around those FFT limitations by repeatedly
running FFTs and overlapping them, but that is only to say that the
can of worms is now open. There are well-known techniques of doing
this sort of thing, and whether it's complex or not pretty much
depends on your level of DSP expertise. It's not as complicated as
(musically-useful) pitch shifting, but it's a far cry from tossing
together a biquad.
I know this doesn't help much, except it might help you understand
why you're not getting deluged with source code. I would think you
can find something, but then it's probably up to you to search for
it, and figure out how you can use it.
Regards,
Nigel
On Jul 5, 2007, at 8:29 PM, IgnisFatuus wrote:
Sorry about this fools response to this forum listed below...
Cocoa has it all (now also 64-bit available)
Google for:
NSLoadAnAudioFile
NSPressTheButton
NSDisplayFrequencySpectrum
Some of us really appreciate honest feedback.
Maybe you should be kicked off this forum since
you don't seem to be of any help!
I wrote software for macs for years but not within
the audio realm! I know your above responses
are crap!
I like to start from the bottom foundation and
work my way up to the details so I can "learn".
If I couldn't find what I was looking for on the
Apple developers site... then I post for
directions or links etc. Not CRAP!
Like say when the audio file is loaded, and how to retrieve
that data for the FFT then the finished result so I can
plot in an NSView.
If all you have is crap to say... then you might as well
resign from this forum! You evidently don't have "any"
programming skills to help out!
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden