How to convert a normalized frequency to a real frequency

suppose we have the following code

function [ x ] = generate1(N,m,A3)
f1 = 100;
f2 = 200;
T = 1./f1;
t = (0:(N*T/m):(N*T))'; %'
wn = randn(length(t),1); %zero mean variance 1
x = 20.*sin(2.*pi.*f1.*t) + 30.*cos(2.*pi.*f2.*t) + A3.*wn;
%[pks,locs] = findpeaks(x);
 plot(x)
end

I generated a signal using the following command

y=generate1(3,500,1);

and I have a sample of length 501, now I want to use the music method to determine the frequencies, namely 100 and 200, suppose the number of parameters is 2, so I tried

pmusic(y,4)

enter image description here

How to determine the actual frequencies from this image? I think I need to convert from the normalized frequency to the actual frequency, since I know that the normalized frequency is the same as $ f / f_s $, where $ f_s $ is the sampling frequency, but what should I do?

+3
source share
1 answer

. I.e, "1,0" Fsample/2.

200 4 :

x=sin(2*pi*200/4000*[0:1000])

pmusic(x, 2) 0,1. , 0,1 * 4000/2 = 200 .

, ( ):

 function x = gen(N,m)
    f1 = 100;
    T  = 1/f1;
    dt = N*T/m;

    x = sin(2*pi*f1*dt*[0:num_of_samples]);
 end

 x = gen(3,500,1e3);

, pmusic(x,2,[0:.01:0.2]).

+4

All Articles