The problem of signal-to-noise ratio of wnoise function in MATLAB

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.