-1

I have a signal that I sample at some frequency (currently 100Hz), and want to extract low frequency information (between 0.8 and 3 Hz)

I have three constraints on this:

  1. I would prefer to compute FFTs on small data segments, ideally no longer than 5 seconds.
  2. I require high resolution on this information - 0.033 Hz between bins or better. I need to accurate resolve the frequencies at this resolution.
  3. I do not need to resolve the difference between closely spaced frequencies - just one frequency, accurately.

How do i go about doing this? This page suggests that increasing sample frequency makes things worse, and that i need more points - which i would prefer to avoid. Additionally, This page suggests that 0-padding will not add any actual resolution. How accurate is this?

Mauvai
  • 101
  • 6
  • The first page you link too (National Instruments) is talking about zero-padding not about increasing the sampling frequency. Could you explain why and how you're sampling at a variable frequency rate? One possibility is to use an adaptive notch filter - the frequency could be read directly from the filter parameters, but I doubt this would work with a variable sample rate. – David Oct 17 '16 at 12:40
  • The page discusses how zero padding doesn't add spectral resolution in the fft, which is not the same as sampling frequency.

    With regard to the sampling frequency, I was trying to express that i can change it if needed, but it does not vary - apologies for the lack of clarity, and edited to reflect

    – Mauvai Oct 17 '16 at 14:22

2 Answers2

1

Zero-padding an FFT does not add frequency estimation resolution in the presence of adjacent interference or noise. However the frequency estimation resolution it can add for isolated narrow frequency peaks is similar to high quality interpolation (for instance, windowed Sinc reconstruction) of the FFT results, which can add significant "between bin" estimation resolution if the signal-to-noise ratio is (a-priori known to be) sufficiently high.

But, beware of a problem in using a zero-padded FFT for frequency estimation of very low frequency signals. The FFT of any strictly real input includes a complex conjugate image in the mirrored half of the result. Thus, signals near the DC or Fs/2 FFT result bins of an FFT have a nearby complex conjugate image peak. This constitutes an interfering adjacent frequency peak, which can be close enough to create a situation which requires resolving (e.g. separating) adjacent frequency peaks, which zero-padding an FFT does not improve.

However for a known single isolated pure sinusoid in Gaussian noise, a parametric estimator may be more suitable than an FFT, since more is known about the signal.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90
  • How near to the edges does this occur?

    My signal is neither a pure sinusoid nor in Gaussian noise, so in the absence of further knowledge a padded FFT is probably easiest for me. Though i may switch to this sinc interpolation i keep reading about if performance is an isue

    – Mauvai Oct 17 '16 at 14:27
-1

Interpolating will not increase resolution. For only 5 seconds you only get 0.2 Hz resolution regardless of interpolation or how fast you'll sample. You want resolution you have two choices. Either increase the observation window to 30 seconds or more. Or. Use super resolution spectral estimation methods (not DFT). Like MUSIC, Capon, AR(MA) etc.

Dr. Nir Regev
  • 618
  • 5
  • 9
  • If i have an isolated signal can i not zero pad to more accurately resolve the single frequency? – Mauvai Oct 17 '16 at 14:59
  • No. Zero padding means sinc interpolation. This will not increase the resolution. Try it. Very easy to simulate. – Dr. Nir Regev Oct 17 '16 at 15:03
  • @Mauvai: Please see my answer about padding and frequency resolution. – jojeck Oct 17 '16 at 15:16
  • I have tried it. A single pure sinusoid in zero noise with a frequency halfway between FFT result bins will show up between those original bins when a new FFT is zero-padded to double the length. Noise will of course decrease resolution, so the new higher resolution depends on the S/N. – hotpaw2 Oct 17 '16 at 16:49
  • @hotpaw2 you're wrong. FFT resolution is determined only by the time window in which you observe the signal. You're mixing accuracy (which is SNR dependent) of spectral estimation with spectral resolution. Again. FFT frequency resolution is dictated only by the observation window length. – Dr. Nir Regev Oct 17 '16 at 16:55
  • The OP specified that he did not need to resolve the difference between closely spaced signals. Therefore his specific question is about accuracy resolution, not peak separation resolution. And resolving multiple peaks as clearly separated is also dependent on the S/N ratio, not just the window length. – hotpaw2 Oct 17 '16 at 17:27
  • If you wish to argue the OP used the "wrong" terminology in his question, that's probably a separate topic for meta or chat. – hotpaw2 Oct 17 '16 at 17:30
  • There is no "accuracy resolution". These are two different terms with two different definitions. – Dr. Nir Regev Oct 17 '16 at 17:39
  • @NirRegev Eventually got round to testing it in matlab without making mistakes, and can confirm that, at least for my purposes, you are incorrect. Zero padding added exactly what i needed, and i can now distinguish the frequencies i need. – Mauvai Oct 24 '16 at 11:27
  • @hotpaw2 see above – Mauvai Oct 24 '16 at 11:27
  • Then you are concluding the wrong conclusions. I am not wrong. Not in this matter. – Dr. Nir Regev Oct 24 '16 at 12:15
  • @NirRegev Then please explain why zero padding allows me to observe arbitrarily small shifts in frequency that i could not without doing it? – Mauvai Oct 24 '16 at 14:43
  • Post your code and I will explain. – Dr. Nir Regev Oct 24 '16 at 14:48
  • t = 0:0.001:0.999; data = sin(2pit*11.09);

    data = [data, zeros(1, 1024*1024-length(data))];

    @NirRegev

    fft_data = abs((fft(data(1:end)))); fft_freqs =( 0:length(fft_data)-1) * (1/0.001)/((length(fft_data)*2));

    plot(fft_freqs(1:floor(end/20)), fft_data(1:floor(end/20)));

    – Mauvai Oct 25 '16 at 12:29
  • Your simulation is wrong. The FFT frequencies should be between 0 to fs and not fs/2. Moreover, pla add another sine at 11.15 (close to your sine ) and see if you can detect both with FFT. You can zero pad all you want, resolution will start 1 Hz. Moreover, the simulation you sent does not reflect at all the constraints and fs you defined in your question. – Dr. Nir Regev Oct 25 '16 at 13:16
  • @NirRegev Not only are you partially wrong , you have ignored everything i said in the question for the sake of being pedantic. The frequenies past fs/2 are a mirror image, as i am very sure you understand, and arent useful or relevant. Never mind that I said I only need to use low frequency information.

    More importantly, I *very specifically* said i had no need to resolve closely spaced frequencies, only one frequency accurately! please take the time to actually read the question! If you wish to correct my terminology please do, but answer my actual question instead of being awkward.

    – Mauvai Oct 25 '16 at 13:44
  • You're fft_freqs are scaled wrong. It has nothing to do with the mirror image. But I give up :). Good luck. – Dr. Nir Regev Oct 25 '16 at 14:02
  • @NirRegev How are they scaled wrong? – Mauvai Oct 25 '16 at 14:46