I have a question that I should know the answer to but for some
reason, I just can't get my mind around.
I'm testing a function that generates FIR taps from a frequency
response template. The template is a complex array. In this
case, all the imaginary coefficients are 0, and the real
coefficients are either 0 or 1. I have created the template
for a bandpass filter, with 1s in the template bins
corresponding to the range 0.125*Fs to 0.25*Fs and 0.75*Fs to
0.875*Fs. The rest of the bins are 0. The FFT/IFFT routines
perform their operations using complex arithmetic.
To begin, I Inverse-FFT the template. The IFFT coefficients
are real-only. I then circularly ****ft the IFFT coefficients
until the Bin-0 coefficient is in the center of my FIR's
impulse response. Here's where the trouble starts.
If the frequency-response template was the same size as the
impulse response, the IFFT coefficient that was formerly in the
center of the IFFT is now in Bin-0 of the ****fted impulse
response. This coefficient is real-only (the imaginary part is
zero), non-zero, and non-negligible in magnitude. The other
impulse response coefficients are symmetrical about the IFFT
coefficient that used to be in Bin-0.
If at this point, I apply a Hann window to the impulse
response, the window squashes the Bin-0 coefficient and the FFT
of the impulse response is real-only. If, however, I leave the
****fted impulse response un-windowed, (Rectangular Window), the
FFT of the impulse response has alternating zero and non-zero
values in its imaginary part. The non-zero value (all the
non-zero values are the same) is not large, but it's not
negligible.
If I leave the ****fted impulse response un-windowed, but I
force Bin-0 to (0+j0), the FFT of the impulse response is again
real-only. If I choose an impulse response size that is odd
(and less than the template size, of course), the FFT of the
impulse response is also real-only.
In all cases, the magnitude of the FFTed impulse response
corresponds fairly closely to the corresponding template values
(except for a constant factor of 0.5) and allowing for expected
ripple and droop in the frequency response.
Can anyone offer an explanation for what I'm seeing? Could it
possibly be a bug in my FFT/IFFT software or is what I
described the expected behavior?


|