I am a Matlab beginner & need to understand what is going on this code. I know it is for Gaussian noise generation, but what do these variables mean mathematically?
N=5000;
W0= [0.1 0.3 0.5 ];
L= length(W0);
input= randn(1,N+L-1);
SNR_DB= 30;
SP=1;
NP=10^(-SNR_DB/10);
noise= sqrt(NP)*randn(1,N);
plot(1:N,noise)
inputis a $1\times(N+L-1)$ matrix, i.e. a row vector of length $5002$. Its entries are filled with stardard normal (pseudo)random numbers (randn). For some curious reason, this vector is not used anywhere.SNR_DB,SPandNPare three parameters. Again, the first two parameters are initiated but not used anywhere.noiseis a row vector of length $5000$ whose entries are standard normal random numbers scaled by $\sqrt{NP}$; that is, its entries are normally distributed with mean zero and standard deviation $\sqrt{NP}$.noiseare plotted in a graph.For any further questions about Matlab commands, type
helpin the Matlab command window. E.g.help randnwould tell you the meaning ofrandn.