Question

1) Besides the negative frequencies, which is the minimum frequency provided by the FFT function? Is it zero?
2) If it is zero how do we plot zero on a logarithmic scale?
3) The result is always symmetrical? Or it just appears to be symmetrical?
4) If I use abs(fft(y)) to compare 2 signals, may I lose some accuracy?

Was it helpful?

Solution

1) Besides the negative frequencies, which is the minimum frequency provided by the FFT function? Is it zero?

fft(y) returns a vector with the 0-th to (N-1)-th samples of the DFT of y, where y(t) should be thought of as defined on 0 ... N-1 (hence, the 'periodic repetition' of y(t) can be thought of as a periodic signal defined over Z).

The first sample of fft(y) corresponds to the frequency 0. The Fourier transform of real, discrete-time, periodic signals has also discrete domain, and it is periodic and Hermitian (see below). Hence, the transform for negative frequencies is the conjugate of the corresponding samples for positive frequencies.

For example, if you interpret (the periodic repetition of) y as a periodic real signal defined over Z (sampling period == 1), then the domain of fft(y) should be interpreted as N equispaced points 0, 2π/N ... 2π(N-1)/N. The samples of the transform at the negative frequencies -π ... -π/N are the conjugates of the samples at frequencies π ... π/N, and are equal to the samples at frequencies π ... 2π(N-1)/N.

2) If it is zero how do we plot zero on a logarithmic scale?

If you want to draw some sort of Bode plot you may plot the transform only for positive frequencies, ignoring the samples corresponding to the lowest frequencies (in particular 0).

3) The result is always symmetrical? Or it just appears to be symmetrical?

It has Hermitian symmetry if y is real: Its real part is symmetric, its imaginary part is anti-symmetric. Stated another way, its amplitude is symmetric and its phase anti-symmetric.

4) If I use abs(fft(y)) to compare 2 signals, may I lose some accuracy?

If you mean abs(fft(x - y)), this is OK and you can use it to get an idea of the frequency distribution of the difference (or error, if x is an estimate of y). If you mean abs(fft(x)) - abs(fft(y)) (???) you lose at least phase information.

OTHER TIPS

Well, if you want to understand the Fast Fourier Transform, you want to go back to the basics and understand the DFT itself. But, that's not what you asked, so I'll just suggest you do that in your own time :)

But, in answer to your questions:

  1. Yes, (excepting negatives, as you said) it is zero. The range is 0 to (N-1) for an N-point input.
  2. In MATLAB? I'm not sure I understand your question - plot zero values as you would any other value... Though, as rightly pointed out by duffymo, there is no natural log of zero.
  3. It's essentially similar to a sinc (sine cardinal) function. It won't necessarily be symmetrical, though.
  4. You won't lose any accuracy, you'll just have the magnitude response (but I guess you knew that already).

Consulting "Numerical Recipes in C", Chapter 12 on "Fast Fourier Transform" says:

  1. The frequency ranges from negative fc to positive fc, where fc is the Nyquist critical frequency, which is equal to 1/(2*delta), where delta is the sampling interval. So frequencies can certainly be negative.

  2. You can't plot something that doesn't exist. There is no natural log of zero. You'll either plot frequency as the x-axis or choose a range that doesn't include zero for your semi-log axis.

  3. The presence or lack of symmetry in the frequency range depends on the nature of the function in the time domain. You can have a plot in the frequency domain that is not symmetric about the y-axis.

  4. I don't think that taking the absolute value like that is a good idea. You'll want to read a great deal more about convolution, correction, and signal processing to compare two signals.

  1. result of fft can be 0. already answered by other people.
  2. to plot 0 frequency, the trick is to set it to a very small positive number (I use exp(-15) for that purpose).
  3. already answered by other people.
  4. if you are only interested in the magnitude, yes you can do that. this is applicable, say, in many image processing problems.

Half your question:

3) The results of the FFT operation depend on the nature of the signal; hence there's nothing requiring that it be symmetrical, although if it is you may get some more information about the properties of the signal

4) That will compare the magnitudes of a pair of signals, but those being equal do no guarantee that the FFTs are identical (don't forget about phase). It may, however, be enough for your purposes, but you should be sure of that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top