function x = randSignal(Fs,FreqNum)
%RANDSIGNAL creates a random signal consisting of FreqNum different frequencies 
%     s = randSignal(Fs,FreqNum), Fs is the sampling rate of the signal 
%     FreqNum is the number of frequencies to be included in the signal and s
%     is the normalized output signal with duration equal to 10seconds
 
t=0:1/Fs:10;
x=zeros(1,length(t));
for i=1:FreqNum,
    x=x+2/i*(rand(1)-0.5)*sin(2*pi*t*round((0.1+2*i*rand(1))*0.5*Fs/(2.1*FreqNum)));
end
x=x(1:floor(length(x)/1024)*1024);
% x=0.1/FreqNum*(rand(size(x))-0.5);        % add noise

x=x/max(abs(x));