Search code examples
matlabnoiseeuclidean-distance

Issue in generating noise and euclidean distance


(a) How do I generate noise such that the maximum levels of the added noise correspond with 3.9% to 50% of the average absolute deviation.

(b) How do I generate white Gaussian noise and uniform noise?


Solution

  • I can only help with b)

    Uniform noise (according to wikipedia) only has a uniform distribution, which should make it white as well): http://en.wikipedia.org/wiki/Image_noise#Quantization_noise_.28uniform_noise.29

    uni_noise = rand(100000,1); % uniform noise
    hist(uni_noise,500) % uniform distribution
    pwelch(uni_noise) % also white noise (even power density)
    

    Gaussian White noise requires an even power density and a normal distribution: http://en.wikipedia.org/wiki/White_noise

    gauss_noise = randn(100000,1); % gaussian noise
    hist(gauss_noise,500) % gaussian (or normal) distribution (bell curve) + zero mean
    pwelch(gauss_noise) % even power density