0

.suppose that we have some sample

y =

   31.2241
   -5.9830
   22.6058
   -2.2309
  -42.8272
   29.2850
   -6.2652
   20.8502
   -2.4639
  -44.7525
   30.1104
   -6.0180
   21.4476
   -1.5089
  -45.1826
   29.2744

and somehow i know that it it got by sinusoidal method which contains two sin function at different frequency and amplitude,so i apply music method

pmusic(y,4)

and picture

enter image description here

i know location of peaks at normalized peaks, but i dont know actual frequency, how to find it?as i know formula is normalized frequency*fs/2, but what about fs? can i find it?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • You might want to try http://math.stackexchange.com/ – NG. Feb 16 '14 at 15:56
  • You can't find it just from the samples. You need to know it from other means. For example, if the samples are from a `.wav` file, the file contains that information. See outputs of `wavread` function – Luis Mendo Feb 16 '14 at 15:56
  • does not music method help to determine frequencies? –  Feb 16 '14 at 15:59
  • This looks more like a question for dsp.stackexchange.com. Try asking there. You'll need to know the sample rate of the signal. – dB' Feb 16 '14 at 16:03
  • You asked a [very similar question](http://stackoverflow.com/questions/21812674/how-to-convert-normalized-frequency-to-actual-frequency) 2 hours earlier, which got good answers. Better to delete this one ... – Bas Swinckels Feb 16 '14 at 17:52
  • but i did not get still complete answer –  Feb 16 '14 at 18:04

1 Answers1

1

If you don't have the sampling rate given explicitly, you can just get it by dividing the length (in time) of your dataset by the number of samples.

Without fs, duration or some other information relating your samples to points in time, you're out of luck.

If you do have the necessary info, pmusic will accept it and return values in proper, non-normalized, frequency.

Below, we've got two cos waves added together, total dataset is 5s in duration with 512 samples. The two terms to add are the number of samples for it to use (I put 256, but [] would have done the same because 256 is the default value.) and the sampling rate in Hz.

This will give you a non-normalized plot of your results.

x = linspace(0,5,512);
y = 1*cos(2*pi*2*x)+1*cos(2*pi*10*x);

pmusic(y,4,256,512/5)
Dan
  • 608
  • 1
  • 5
  • 9