Re: Something astray in my FFT understanding
- From: "Rune Allnor" <allnor@xxxxxxxxxxxx>
- Date: 8 Apr 2006 13:23:29 -0700
SeanOg skrev:
Many thanks for the quick replies. Sorry for the confusion, Im probally
using the terminology a bit to quickly without thinking exactly what it
means.
What my routine does is it accepts an array of N points. This array
represents the signal to be transformed. This is what I meant about the
FFT being real, it accepts one array of real, not complex, numbers, each
point in the array representing one sample.
OK...
The output of the routine is an array of N points which represents (at
least what I believed up to now) the entire DFT; the real part of the DFT,
stored in the first half, and the imaginary part, stored in the second
half.
Maybe I'm just splitting a few hairs here, but we need to agree on the
details.
An N-point DFT produces N complex-valued coefficients, that contain
one real and one imaginary part, 2N in all. Due to a symmetry
when the input signal is real, namely
X(w) = re{X(w)} + j*im{X(w)}
X(-w) = conj(X(w)) = re{X(w)} - j*im{X(w)}
the full spectrum is known from N/2 complex-valued coefficients.
So if your FFT routine accepts only real-valued signals and produces
N real numbers, it is almost certain that N/2 of those numbers
represent
the real part and the other N/2 the imaginary parts...
So using an impulse function of 8 points as an example (input is a single
8 point array);
Input Output
1 0 0 0 0 0 0 0 -> FFT -> 1 1 1 1 0 0 0 0
|real | |img |
(the above output is what it should be, I get all 1's)
....like what you indicate here.
Hi,
I am not sure what you mean by frequency here.
Again bad use of a term on my part. What I was getting at was that in the
example of the impulse shifted by two, the output looked like the output
of the 1 point shifted impulse but with 'twice the frequency'.
I am pretty sure this has to do with the phase term in the twiddle
factors.
Im checking that out at the moment. I have a niggling in the back of my
head that something about how I consider how the phase factors should be
calculated isnt 100% correct.
Try restrict this to N = 2^M, M integer, first. That's how most FFTs
are
designed. Only after that one works, does one extend to general N.
A bad sign... could it be that the FFT algorithm is based on a
real-valued
input, which is guaranteed to produce a symmetric spectrum, and
pops out half the number of real and imaginary coefficients?
Ah, thats news to me. Looks like Ive got a very mixed up view of the whole
real/complex FFT. I always thought that;
x[N] -> FFT -> X[N]
where x[N] is an array of real numbers (ie no complex component)
Nope. See below.
first half X[N] is real part of resulant DFT
second half X[N] is imaginary part of resultant DFT
Only if the FFT routine is specifically designed to accept only
real-valued sequences. In general, you get N complex-valued
coefficients.
Seems I need to go back over this topic. I think then the problem is the
FFT Ive implemented is specifcally for complex inputs or something...Gotta
hate when you think youve finally understood something you regard as
difficult and then realise that youre still as confused as ever :P
Been there, done that. Not with the FFT (never attempted that one
from scratch, but you've got me thinking...), but still. Never mind,
all that is forgotten when you, in the end, know that you finally got
it right...
thanks again, its great to have a soundboard that I can use to figure out
these things rather muttering incoherent abuse at my books. Ill let you
know how I get on.
Rune
.
- References:
- Something astray in my FFT understanding
- From: SeanOg
- Re: Something astray in my FFT understanding
- From: Rune Allnor
- Re: Something astray in my FFT understanding
- From: SeanOg
- Something astray in my FFT understanding
- Prev by Date: Re: Digitally mimicing an RLC filter section
- Next by Date: Re: LTI
- Previous by thread: Re: Something astray in my FFT understanding
- Next by thread: Re: Something astray in my FFT understanding
- Index(es):
Relevant Pages
|