You need to multiply by half the sampling rate. I.e., the normalized frequency "1.0" is Fsample/2.
For a simple example, here's a 200 Hz signal sampled at 4KHz:
x=sin(2*pi*200/4000*[0:1000])
Running pmusic(x, 2)
gives a pronounced peak at the normalized frequency 0.1.
Converted to Hz, this is 0.1*4000/2 = 200 Hz.
I have modified your function to make it easier to analyze (just one sine function and no randomness):
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);
To get better resolution use pmusic(x,2,[0:.01:0.2])
.