I’ve been trying to estimate the frequency of a signal I obtained at 1000Hz sampling frequency. The dominant frequency is expected to be not more than 4 or 5 Hz. I’ve estimated the PSD using autocorrelation method however for some signal it seems to noisy and it’s difficult to find the dominant frequency. I’ve tested the method for 60 signals and the output was not as expected (the frequency goes up and down when it should either increase or decrease according to the process). I shall be grateful for any suggestions The details of the signal can be found in this post: How to estimate PSD, and time delay of a random signal?

here's the code I used

%% estimate the power spectral density, where the spectrum is the FFT of the autocorrelation sequence.

for i=1:numel(files)
   nfft{i} = 2^nextpow2(length(Rxx{1,i}));
   % Compute Fourier transform of x using nfft
   Xxx{i} = fft(Rxx{1,i}(1:4000),nfft{1,i});

   % Frequency vector

   F{i}= 0 : fs/(nfft{1,i}-1) : fs;

   % Powerspectral density 

   Pxx1{i} =2* abs(Xxx{1,i}).^2/N;     
   [mx{i},ind{i}] = max(Pxx1{i});    
   plot(F{i},Pxx1{1,i}), grid 
   axis([0 10 0 max(Pxx1{1,i})])
   title('power spectrum')
  • $\begingroup$ Could you post your matlab code? $\endgroup$ – JRE Sep 19 '14 at 8:38
  • $\begingroup$ @JRE I've updated my post and added the code. thanks $\endgroup$ – Rajab Sep 19 '14 at 10:02
  • $\begingroup$ Do you require the whole PSD or just the one dominant frequency? $\endgroup$ – jan Sep 21 '14 at 22:38
  • $\begingroup$ @jan At the moment the dominant frequency is required. However it would be great if I can get the whole PSD. $\endgroup$ – Rajab Sep 22 '14 at 9:47
  • $\begingroup$ @jan Does the sampling frequency matter, as my sampling frequency is 1000Hz while the maximum dominant frequency seems to be not higher than 4 Hz. Could you please suggest a better way to process this signal? $\endgroup$ – Rajab Sep 22 '14 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.