The wnoise in MATLAB is explained as follows:
Wnoise Generate Noisy wavelet test data.
X = wnoise (fun,n) returns values of the test function
Given by fun, on a 2^n sample of [0,1].
[X,xn] = wnoise (Fun,n,sqrt_snr) returns the previous vector X
Rescaled such that STD (x) = Sqrt_snr. The returned vector XN
Contains the same test vector X corrupted by an
Additive Gaussian White Noise N (0,1). Then XN have a
Signal-to-noise ratio of (sqrt_snr^2).
[X,xn] = wnoise (fun,n,sqrt_snr,init) returns previous
Vectors X and XN, but the generator seed was set to INIT
Value.
for [X,xn]=wnoise (Fun,n,sqrt_snr) Form, the signal-to-noise ratio of xn is interpreted in MATLAB as sqrt_snr^2. Now I'm going to produce a signal to see if that's the case.
CLC;
CLC;
Clear all;
[X,sx]=wnoise (4,10,3,231434);
The signal-to-noise ratio is calculated using the following formula:
SNR=10*LOG10 (SUM (x.^2)/sum ((sx-x). ^2)); (1)
Matlb operation result is: snr= 9.8628
It can be seen that snr!=!=sqrt_snr^2 = 9 results are not the same, which is why. The following analysis
The known x is a pure signal, (sx-x) is a noise signal, the SNR calculated by the formula (1) is certainly no problem.
But unlike the results of sqrt_snr^2, I think it is the difference between the two formulas for the signal-to-noise ratio.
The Matlab Citic noise ratio is used (for the differentiated 1 here using the SNR Representation):
Variance of snr= pure signal/variance of Noise signal (2)
The theoretical analysis is:
Wnoise () produces a Gaussian white noise with a mean value of 0 standard deviation of 1
So the variance of pure noise is =3^2=9; noise variance =1^2=1
The snr=9 the theory gets
But in the actual kind by calculation to get
STD (x) = 3;
STD (sx-x) = 0.9769 is not equal to 1
Actually get the snr=9.2125
This is mainly because the standard deviation of noise is not equal to 1 due to the wnoise from the "mean value of 0, the standard deviation is 1 of the Gaussian distribution of the data sampled." However, the finite length of the wnoise itself does not satisfy the mean value of 0, the standard deviation is 1, that is, random variables randomly distributed, it is impossible to use the finite length of the sample value to extract the full characteristics of the random variable.
So the SNR calculated by the Formula 1 is also true.
The above is the author's own humble opinion, in order to stimulate.
Please specify the source if you want to load.