📄 modul.m
字号:
function [g,g1,g2]=modul(omg,wc);
%信号调制的时域与频域过程。
%截至频率为wc,omg为原始信号频率。
%最好取wc=0.08,omg=2.
t=0:0.01:10;
g=cos(omg.*t);
ft=cos(10.*omg.*t);
g1=g.*ft;
g2=g1.*ft;
[b,a]=butter(14,wc);
[H,w]=freqz(b,a);
figure(1);
plot(abs(H));
g3=filter(b,a,g2);
figure(2);
subplot(2,2,1);
plot(t,g);
subplot(2,2,2);
plot(t,g1);
subplot(2,2,3);
plot(t,g2);
subplot(2,2,4);
plot(t,g3);
gp=fftshift(fft(g));
gp1=fftshift(fft(g1));
gp2=fftshift(fft(g2));
gp3=fftshift(fft(g3));
figure(3);
subplot(2,2,1);
plot(abs(gp));
subplot(2,2,2);
plot(abs(gp1));
subplot(2,2,3);
plot(abs(gp2));
subplot(2,2,4);
plot(abs(gp3));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -