feat(matlab): comm lab1
This commit is contained in:
parent
e426c92968
commit
500c21b984
3 changed files with 15 additions and 0 deletions
15
Matlab/comm/lab1_0.m
Normal file
15
Matlab/comm/lab1_0.m
Normal file
|
@ -0,0 +1,15 @@
|
|||
Fs=1e4;N=1e4; %定义采样频率、FFT 长度
|
||||
t=(0:N-1)/Fs; %定义时间向量
|
||||
f=Fs*(-N/2:N/2-1)/N; %定义频谱自变量 f 向量
|
||||
ft=200*(sinc(200*(t-0.6))).^2; %产生三角频谱信号
|
||||
yt=ft.*cos(2000*pi*t);
|
||||
F=fftshift(fft(yt,N))/N; %求频谱
|
||||
AF=abs(F); %求幅度谱
|
||||
AFdB=20*log10(AF); %求幅度谱/dB
|
||||
subplot(311);plot(t,yt);
|
||||
xlabel('t/s');grid on
|
||||
axis([0.55,0.65,-10,210])
|
||||
subplot(312);plot(f,AF);
|
||||
ylabel('幅度谱');xlabel('f/Hz');grid on
|
||||
subplot(313);plot(f,AFdB);
|
||||
ylabel('对数幅度谱/dB');xlabel('f/Hz');grid on
|
BIN
Matlab/comm/lab1_1.slx
Normal file
BIN
Matlab/comm/lab1_1.slx
Normal file
Binary file not shown.
BIN
Matlab/comm/lab1_2.slx
Normal file
BIN
Matlab/comm/lab1_2.slx
Normal file
Binary file not shown.
Reference in a new issue