matlab | 生成脉冲噪声
·
依照下列公式生成脉冲噪声

clc;close all;clear all;
length = 100; % 生成信号长度
power_w = 1;
power_z = 1e-3;
n = 2; % 伯努利过程的实验次数
pr = 0.1;
b = binornd(n,pr,[length,1]);
w = sqrt(power_w) * randn(length,1);
z = sqrt(power_z) * randn(length,1);
n = b .* w + z;
figure;
plot(n);

更多推荐

所有评论(0)