📄 jtcx.m
字号:
Fs=100; %采样频率
T=1/Fs; %采样周期
Tp=10; %观察时间
N=Tp/T; %采样点数
n=(0:1:N-1);
t=n*T;
xi=2.*cos(pi.*t).*cos(18.*pi.*t);
x0=xi.*cos(18.*pi.*t)
subplot(2,1,1)
plot(t,x0)
grid
title('乘以载波信号后的信号时域特性')
xlable( ' 时间:单位:s' )
ylable( ' 幅度 ' )
Yk=fft(x0,2048)
Yw=2*pi/N*abs(fftshift(Yk));
Fw=[-1024:1023]/2048*Fs
subplot(2,1,2)
plot(Fw,Yw)
grid
titile( '乘以载波信号后的频域特性' )
xlable( '频率:单位:Hz' )
ylable( '幅度' )
Rp=0.1 %通量最大衰减为0.1dB
Rs=40 %阻带最小衰减为40dB
Wp=3/20 %通带截止频率3Hz
Ws=4/20 %阻带起始频率4Hz
[n,Wn]=ellipord(Wp,Ws,Rp,Rs); %计算椭圆滤波器参数
[b,a]=ellip(n,Rp,Rs,Wn); %设计椭圆滤波器
freqz(b,a,800,40)
xh=filler(b,a,x0);
figure
subplot(2,1,1)
plot(t,xh);
grid
title( '载波后的信号' )
xlable('时间:单位:S')
ylable( '幅度' )
Yk=fft(xh,2048)
Yw=2*pi/N*abs(fftshift(Yk));
Fw=[-1024:1023]/2048*Fs;
subplot(2,1,2)
plot(Fw,Yw)
grid
title( '载波后的信号频谱 ' )
xlable( '频率:单位:Hz' )
ylable( '幅度' )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -