In many research articles, the effect of measurement noise on estimation performance is often reported. But it is not clear to me what is the proper way of using the signal to noise ratio (SNR). For example, the variance of measurement noise which is assumed to be Additive White Gaussian Noise( AWGN) is varied to obtain different SNRs. Then for each SNR the mean square error (MSE) between the parameter estimates and the known parameters are calculated. When SNR is high, it means that the amount of noise is less.
The following code in Matlab is based on my understanding that SNR is defined after the input to a system is passed and we get the output from the system, then we add noise for a particular SNR. Also, please correct me if I have put any incorrect information. Thank you.
In the code, I first generate some data $x$ consisting of $N=100$ data points. Then I have randomly generated 3 coefficients representing the impulse response of an FIR system. The data $x$ is passed through the FIR system to obtain $y$. I then add AWGN of SNR = 40dB.
Question1: My question is which step of the estimation stage is the SNR defined? Can somebody please confirm if this is the correct approach or not?
Question2: If SNR = 40dB, how does one know the variance of the noise at the receiver end? In practice (in industry application) does the receiver end always know about the level of SNR and the variance of the noise?
N=100; x = randn(1,N); %generating random data h = rand(1,3); %some unknown parameters representing impulse response y=filter(h,1,x); %FIR filter z = awgn(y,40,'measured'); % adding AWGN measurement noise at SNR = 40dB %Run some estimation method to estimate h_hat