+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Member level 2
    Points: 840, Level: 6

    Join Date
    Dec 2014
    Posts
    45
    Helped
    0 / 0
    Points
    840
    Level
    6

    How to calculate the frequency of a signal without knowing the sampling frequency

    Hi everyone

    I have a signal and I am using Matlab command pwelch to calculate the frequency of the signal, but the frequency I obtained is changed as I changed the sampling frequency.

    Code:
    pwelch(x,window,noverlap,f,fs)
    For example, when using sampling frequency equal 8000, the frequency appear to be 1 Khz, while when I use 16000 sampling frequency the frequency of the signal appear to be 2 Khz.

    which is the correct frequency? and is there other method to calculate the frequency of a signal without prior knowledge of the sampling frequency?

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 3
    Points: 4,971, Level: 16
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    905
    Helped
    156 / 156
    Points
    4,971
    Level
    16

    Re: How to calculate the frequency of a signal without knowing the sampling frequency

    Without knowing details of Matlab command, different frequency results for different Fs would happen if your sampling freq was a sub-frequency of the sampled one. I.e. when you do sub-sampling and the aliased component only is output.

    Is your example case a real case or hypothetical ? I cannot work out what would the actual freq be based on your example numbers ?

    However lets say that with Fs of 8Khz you get a freq of 1KHz, while with 16KHz you get output 7Khz. In such an example a real signal freq of 25Khz would be possible.

    I believe only in the case where you are a priori sure that your Fs is > 2x F would you not need to know the exact sampling freq. and the output would be the actual freq of the signal.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 2
    Points: 3,813, Level: 14

    Join Date
    Nov 2013
    Posts
    510
    Helped
    237 / 237
    Points
    3,813
    Level
    14

    Re: How to calculate the frequency of a signal without knowing the sampling frequency

    In a sampled system all the frequency calculations are inherently really outputting a fraction of the sample rate....

    Thus the core of the maths is in your example coming up with a result of 1/8th, which when multiplied by 8K, gives 1K and when multiplied by 16K gives 2K.

    The system is measuring in terms of the sample rate, therefore if you want an output in any other terms you must know the same rate.

    There are also cases where the sampled data is not a time series of course in which case the sampling might be in terms of distance or radians or something.

    Regards, Dan.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  4. #4
    Full Member level 3
    Points: 1,894, Level: 10

    Join Date
    Oct 2012
    Location
    India
    Posts
    162
    Helped
    36 / 36
    Points
    1,894
    Level
    10

    Re: How to calculate the frequency of a signal without knowing the sampling frequency

    Why not you try with Fs=10^9 kind of value (some very high value), that might give you the true result.
    Or keep increasing the Fs until you see that there is no change in the result that you see.



  5. #5
    Advanced Member level 3
    Points: 4,971, Level: 16
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    905
    Helped
    156 / 156
    Points
    4,971
    Level
    16

    Re: How to calculate the frequency of a signal without knowing the sampling frequency

    Quote Originally Posted by Dan Mills View Post
    In a sampled system all the frequency calculations are inherently really outputting a fraction of the sample rate....

    Thus the core of the maths is in your example coming up with a result of 1/8th, which when multiplied by 8K, gives 1K and when multiplied by 16K gives 2K.

    The system is measuring in terms of the sample rate, therefore if you want an output in any other terms you must know the same rate.

    There are also cases where the sampled data is not a time series of course in which case the sampling might be in terms of distance or radians or something.

    Regards, Dan.
    I think you're on the right track Dan. Clearly the variable 'f' is a pre-sampled vector, and hence to obtain a correct psd we have to know the correct Fs. Exactly because of the reasons you have stated.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  6. #6
    Member level 2
    Points: 840, Level: 6

    Join Date
    Dec 2014
    Posts
    45
    Helped
    0 / 0
    Points
    840
    Level
    6

    Re: How to calculate the frequency of a signal without knowing the sampling frequency

    Thanks to all
    I think that it is clear that one can not obtained the correct frequency without prior information about sampling frequency



--[[ ]]--