# Add impulsive noise generated by ε mixture of Gaussian noise

9 views (last 30 days)
Sabaudian on 2 Jul 2022
Commented: Sabaudian on 3 Jul 2022
I have to add noise to a signal following a function on a scientific paper. The noise, like specified in the title, is generated by ε mixture of Gaussian noise that has a porbability density function of: I have try to translate this function into a code, and I think that is right, but I am very insecure about this kind of things and I want to be 100% sure that what I have done is correct.
Explanation of the function: ϕ(y) is the probability density function of a Gaussian random variable with zero mean and unit variance. σ2 is tipically much larger than σ1. ε is a weight, wich controls the distribution of the two ϕ, the background noise and the impulse noise, respectively.
My Attempt:
clc;
close all;
clear;
y = val; % MY Signal
L = length(y); % length of the signal
E = 0.1 + (0.5).*rand(1); % epsilon (range 0.1-0.5)
s_1 = 10; % sigma1 (σ1)
s_2 = 100; % sigma2 (σ2)
noise = (1-E)*s_1.*randn(L) + E*s_2.*randn(L); % generated noise
yn = y + noise; % noisy signal
##### 1 CommentShowHide None
Sabaudian on 3 Jul 2022
I'm just asking for a check. I just need to know if what I wrote is right or wrong. thank you