📄 fg_10_05.m
字号:
% fg_10_05 Seismic amplitude distributions.
skp=10000; K=1000;
% Read the signal.
fid=fopen(['signal_2.txt']);
x=fscanf(fid,'%7d%8d%8d%8d%8d%8d%8d%8d%8d%8d\n',skp+K);
fclose(fid);
x=x(skp:skp+K-1);
% Plot the signal.
sp_fig(1);
subplot(3,1,1);
set(gca,'fontsize',16);
line(0:K-1,x,'color','r'); grid on;
h=ylabel('Signal x_k','position',[-70 -606 17.3]);
title(['K=',int2str(K),' samples']);
% Plot the symbol frequencies.
subplot(3,1,2);
set(gca,'fontsize',16);
[f,u0,u1]=freq(x);
line(u0:u1,f,'color','b'); grid on;
axis([-15000 15000 0 max(f)]);
set(gca,'xticklabel',-15000:5000:15000);
set(gca,'yticklabel','0.000|0.001|0.002');
ylabel('f_x(n)','position',[-18500 0.00097 17.3]);
% Plot the category frequencies.
subplot(3,1,3);
set(gca,'fontsize',16);
x=round(x/2048);
[f,x0,x1]=freq(x);
bar2(2048*[x0:x1],f,'b'); grid on;
axis([-15000 15000 0 0.25]);
set(gca,'xticklabel',-15000:5000:15000);
%set(gca,'yticklabel','0.000|0.001|0.002');
ylabel('f_c(n)','position',[-18000 0.1225 17.3205]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -