tejap
Newbie level 1
Hi all,
I am trying to implement a frequency hopping signal in MATLAB, and have a doubt about the following code:
N = 20;
Nf = 200;
Tvar = N;
alpha = rand(N, Nf);
t = linspace(0,1,Tvar);
p = zeros(Tvar,Nf);
f = linspace(20*(10^6), 60*(10^6), Nf); % Frequency hopping signal range
p1 = zeros(1,N);
for k = 1:N
for i = 1:Nf
p(k,i) = exp(1j*2*pi*f(i)*t(k))*alpha(k,i);
p1(k) = p1(k) + p(k,i);
end
end
% Message signal
m0 = sin(2*pi*t);
n = length(m0);
figure(1)
plot(t, m0);
b = m0.*p1;
Please tell me whether p(k,i) is the correct way of declaring the signal in time domain or not
I have taken the idea of p(k,i) from an IEEE paper( have attached the reference equation - ignore the noise and time shift for time being)
How can I verify that what is done here is correct?
I am trying to implement a frequency hopping signal in MATLAB, and have a doubt about the following code:
N = 20;
Nf = 200;
Tvar = N;
alpha = rand(N, Nf);
t = linspace(0,1,Tvar);
p = zeros(Tvar,Nf);
f = linspace(20*(10^6), 60*(10^6), Nf); % Frequency hopping signal range
p1 = zeros(1,N);
for k = 1:N
for i = 1:Nf
p(k,i) = exp(1j*2*pi*f(i)*t(k))*alpha(k,i);
p1(k) = p1(k) + p(k,i);
end
end
% Message signal
m0 = sin(2*pi*t);
n = length(m0);
figure(1)
plot(t, m0);
b = m0.*p1;
Please tell me whether p(k,i) is the correct way of declaring the signal in time domain or not
I have taken the idea of p(k,i) from an IEEE paper( have attached the reference equation - ignore the noise and time shift for time being)
How can I verify that what is done here is correct?