我是靠谱客的博主 寂寞茉莉,这篇文章主要介绍信号实验:随机信号的产生和分析,现在分享给大家,希望可以做个参考。

实验内容

  • 3.1 产生随机噪声信号
    (1)分别满足均匀分布、高斯分布、指数分布。
    (2)估计它们的均值、方差、自相关函数、功率谱密度、概率密度函数、概率分布函数。
    (3)绘制时域波形、直方图、自相关函数曲线、功率谱密度曲线、概率密度函数曲线、概率分布函数曲线。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
x1 = rand(1,1000) subplot(1,3,1) stairs(x1) title('均匀分布的时域波形') subplot(1,3,2) hist(x1, -4:4) title('直方图') c1 = xcorr(x1, 'coeff') % 自相关函数 subplot(1,3,3) plot(c1) title('自相关函数') % 高斯随机信号 x2 = idinput(1000, 'rgs'); x2=x2' subplot(1,3,1) stairs(x2) title('高斯随机信号的时域波形') subplot(1,3,2) hist(x2, -4:4) title('直方图') c2 = xcorr(x2, 'coeff') % 自相关函数 subplot(1,3,3) plot(c2) title('自相关函数') x3 = exprnd(1,1,1000) subplot(1,3,1) stairs(x2) title('指数分布的随机信号') subplot(1,3,2) hist(x3, -4:4) title('直方图') [c3,lags3] = xcorr(x3) % 自相关函数 subplot(1,3,3) title('自相关函数') %信号的平均值 N=1000; Xmean1=sum(x1)/N Xmean2=sum(x2)/N Xmean3=sum(x2)/N %方差 X1var=var(x1) X2var=var(x2) X3var=var(x3) %功率谱密度 subplot(1,3,1); [pxx1,w1] = periodogram(x1) plot(w1,10*log10(pxx1)) title('功率谱1'); subplot(1,3,2); [pxx2,w2] = periodogram(x2) plot(w2,10*log10(pxx2)) title('功率谱2'); subplot(1,3,3); [pxx3,w3] = periodogram(x3) plot(w3,10*log10(pxx3)) title('功率谱3'); %概率密度函数 subplot(1,3,1); [f1,xi]=ksdensity(x1) plot(xi,f1); title('概率密度函数1'); subplot(1,3,2); [f2,xi]=ksdensity(x2) plot(xi,f2); title('概率密度函数2'); subplot(1,3,3); [f3,xi]=ksdensity(x3) plot(xi,f3); title('概率密度函数3'); %概率分布函数 y1=unidpdf(x1,N) y2=normpdf(x2,N) y3=exppdf(x3,N) %时域图 t=linspace(0,1,N); subplot(1,3,1); plot(t,x1); xlabel('Time'); ylabel('Amplitude'); title('时域图1') subplot(1,3,2); plot(t,x2); xlabel('Time'); ylabel('Amplitude'); title('时域图2') subplot(1,3,3); plot(t,x3); xlabel('Time'); ylabel('Amplitude'); title('时域图3')
  • 3.2 产生叠加高斯白噪声的正弦信号
    (1)估计均值、方差、自相关函数、功率谱密度、概率密度函数、概率分布函数。
    (2)绘制时域波形、直方图、自相关函数曲线、功率谱密度曲线、概率密度函数曲线、概率分布函数曲线。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%叠加高斯白噪声的正弦信号 t = (0:0.01:10)'; x=sin(t); plot(t,x) xlabel('时间/s'); ylabel('幅度'); y = awgn(x,10,'measured'); plot(t,[x y]) legend('Original Signal','Signal with AWGN') title('时域图') %均值 m=mean(y) %方差 v=var(y) subplot(1,2,1) hist(y, -4:4) title('直方图') c = xcorr(y, 'coeff') % 自相关函数 subplot(1,2,2) plot(c) title('自相关函数') %功率谱密度 subplot(1,2,1); [pxx,w] = periodogram(y) plot(w,10*log10(pxx)) title('功率谱1'); %概率密度函数 subplot(1,2,2); [f,xi]=ksdensity(y) plot(xi,f); title('概率密度函数1'); %概念分布函数 e=raylrnd(y)
  • 3.3 产生两个叠加白噪声的正弦信号
    (1)估计它们的互相关函数、互协方差函数。
    (2)绘制信号的时域波形、互相关函数曲线、互协方差函数曲线。
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%叠加高斯白噪声的正弦信号 t = (0:0.01:10)'; x=sin(t); subplot(1,2,1) plot(t,x) xlabel('时间/s'); ylabel('幅度'); y = awgn(x,10,'measured'); subplot(1,2,2) plot(t,[x y]) legend('Original Signal','Signal with AWGN') title('时域图1') %叠加高斯白噪声的正弦信号 t1 = (0:0.01:10)'; x1=sin(t1); subplot(1,2,1) plot(t1,x1) xlabel('时间/s'); ylabel('幅度'); y1 = awgn(x1,10,'measured'); subplot(1,2,2) plot(t1,[x1 y1]) legend('Original Signal','Signal with AWGN') title('时域图2') c = xcorr(y,y1) subplot(1,2,1) plot(c) title('互相关函数') c1 = xcov(y,y1) subplot(1,2,2) plot(c1) title('互协方差函数')

最后

以上就是寂寞茉莉最近收集整理的关于信号实验:随机信号的产生和分析的全部内容,更多相关信号实验:随机信号内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部