设y(t)=(A+M*cos2pi*fm*t)*cos2pi*fc*t 其中M=2,fm=1000hz,A=2,fc=10000hz,取样率为100000,取样间隔为0.00001,补全以下程序 参考程序: dt=1e-5; T=3*1e-3; t=0:dt:T; fs=1/dt; %抽样频率 df=fs/length(t); %频率分辨率 f=-fs/2:df:fs/2-df; %频率绘制区间 M=2; fm=1e3; A=2 fc=1e4 input=M*cos(2*pi*fm*t); INPUT=fft(input); %绘制调制信号频谱 %fft 函数实现从时域到频域的转换(fft—快速傅里叶变换) carrier=cos( ); envelop_AM=input+( ); output=( ).*carrier; CARRIER=fft( ); %绘制载波频谱 OUTPUT=fft( ); %绘制已调信号频谱 figure; subplot(3,1,1);plot(t,input); xlabel('时间/s');ylabel('调制信号'); ……. subplot(3,1,1); plot(f,abs(fftshift(INPUT))); % fft 变换的结果需要使用 fftshift 修正偏移 title('基带信号频谱'); % abs 函数为取修正结果的绝对值 …….
时间: 2023-08-03 18:09:32 浏览: 42
dt=1e-5;
T=3*1e-3;
t=0:dt:T;
fs=1/dt; %抽样频率
df=fs/length(t); %频率分辨率
f=-fs/2:df:fs/2-df; %频率绘制区间
M=2;
fm=1e3;
A=2;
fc=1e4;
input=M*cos(2*pi*fm*t);
INPUT=fft(input); %绘制调制信号频谱
carrier=cos(2*pi*fc*t);
envelop_AM=input+A; %求包络信号
output=envelop_AM.*carrier;
CARRIER=fft(carrier); %绘制载波频谱
OUTPUT=fft(output); %绘制已调信号频谱
figure;
subplot(3,1,1);plot(t,input);
xlabel('时间/s');ylabel('调制信号');
title('调制信号时域波形');
subplot(3,1,2); plot(f,abs(fftshift(INPUT))); % fft 变换的结果需要使用 fftshift 修正偏移
title('调制信号频域波形');
subplot(3,1,3); plot(f,abs(fftshift(OUTPUT)));
title('已调信号频域波形');
相关问题
rt=s_dsb.*cos(2*pi*fc*t);
这段代码是一个调幅信号的生成过程。首先,通过mt.*cos(2*pi*fc*t)生成一个调制信号,其中mt是调制信号的幅度,fc是载波频率,t是时间变量。然后,通过sqrt(2).*sin(2*pi*fm*t).*sin(2*pi*fc*t)生成一个调制信号的辅助信号。最后,通过s_dsb.*cos(2*pi*fc*t)将调制信号和辅助信号相乘,得到最终的调幅信号rt。
下面是一个示例代码,演示了如何生成调幅信号:
```matlab
% 定义参数
fc = 1000; % 载波频率
fm = 100; % 调制信号频率
t = 0:0.001:1; % 时间变量
% 生成调幅信号
mt = sin(2*pi*fm*t); % 调制信号
s_dsb = mt.*cos(2*pi*fc*t); % 调幅信号
% 绘制调幅信号图像
plot(t, s_dsb);
xlabel('时间');
ylabel('幅度');
title('调幅信号');
```
设y(t)=(A+M*cos2pi*fm*t)*cos2pi*fc*t 其中M=2,fm=1000hz,A=2,fc=10000hz,画出调制信号和已调信号频谱 取样率为100000,取样间隔为0.00001, 并补全以下程序 参考程序: dt=1e-5; T=3*1e-3; t=0:dt:T; fs=1/dt; %抽样频率 df=fs/length(t); %频率分辨率 f=-fs/2:df:fs/2-df; %频率绘制区间 M=2; fm=1e3; A=2 fc=1e4 input=M*cos(2*pi*fm*t); INPUT=fft(input); %绘制调制信号频谱 %fft 函数实现从时域到频域的转换(fft—快速傅里叶变换) carrier=cos( ); envelop_AM=input+( ); output=( ).*carrier; CARRIER=fft( ); %绘制载波频谱 OUTPUT=fft( ); %绘制已调信号频谱 figure; subplot(3,1,1);plot(t,input); xlabel('时间/s');ylabel('调制信号'); ……. subplot(3,1,1); plot(f,abs(fftshift(INPUT))); % fft 变换的结果需要使用 fftshift 修正偏移 title('基带信号频谱'); % abs 函数为取修正结果的绝对值 …….
dt=1e-5;
T=3*1e-3;
t=0:dt:T;
fs=1/dt; %抽样频率
df=fs/length(t); %频率分辨率
f=-fs/2:df:fs/2-df; %频率绘制区间
M=2;
fm=1e3;
A=2;
fc=1e4;
input=M*cos(2*pi*fm*t);
INPUT=fft(input); %绘制调制信号频谱
carrier=cos(2*pi*fc*t);
envelop_AM=input+(A*M*cos(2*pi*fm*t));
output=envelop_AM.*carrier;
CARRIER=fft(carrier); %绘制载波频谱
OUTPUT=fft(output); %绘制已调信号频谱
figure;
subplot(3,1,1);plot(t,input);
xlabel('时间/s');ylabel('调制信号');
title('调制信号时域波形');
subplot(3,1,2);plot(t,envelop_AM);
xlabel('时间/s');ylabel('幅度');
title('幅度调制信号时域波形');
subplot(3,1,3);plot(t,output);
xlabel('时间/s');ylabel('幅度');
title('幅度调制后的信号时域波形');
figure;
subplot(3,1,1); plot(f,abs(fftshift(INPUT))); % fft 变换的结果需要使用 fftshift 修正偏移
title('基带信号频谱');
xlabel('频率/Hz');ylabel('幅度');
subplot(3,1,2); plot(f,abs(fftshift(CARRIER)));
title('载波频谱');
xlabel('频率/Hz');ylabel('幅度');
subplot(3,1,3); plot(f,abs(fftshift(OUTPUT)));
title('幅度调制后的信号频谱');
xlabel('频率/Hz');ylabel('幅度');