Reputation:
.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
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?
Upvotes: 0
Views: 288
Reputation: 638
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)
Upvotes: 1