基本信息
源码名称:DSB_AM调制
源码大小:0.86KB
文件格式:.m
开发语言:MATLAB
更新时间:2020-11-08
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 3 元×
微信扫码支付:3 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
function [M,m,df]=fftseq(m,ts,df)
% [M,m,df]=fftseq(m,ts,df)
% [M,m,df]=fftseq(m,ts)
% FFTSEQ Generates M,the FFT of the sequence m.
% The sequence is zero-padded to meet the required frequency resolution df.
% ts is the sampling interval.The output df is the final frequency resolution.
% Output m is the zero-padded version of input m,M is the FFT.
fs=1/ts;
if nargin == 2
n1=0;
else
n1=fs/df;
end
n2=length(m);
n=2^(max(nextpow2(n1),nextpow2(n2)));
M=fft(m,n);
m=[m,zeros(1,n-n2)];
df=fs/n;
end
clear
t=0.15; %信号保持时间
ts=0.001; %采样时间间隔
fc=250; %载波频率
fs=1/ts; %采样频率
df=0.3; %频率分辨率
t1=[0:ts:t]; %时间矢量
m=[ones(1,t/(3*ts)),-2*ones(1,t/(3*ts)),zeros(1,t/(3*ts) 1)];%定义信号序列
y=cos(2*pi*fc.*t1);%载波信号
u=m.*y; %调制信号
[M,m,df1]=fftseq(m,ts,df);%傅里叶变换
M=M/fs;
[ub,u,df1]=fftseq(u,ts,df);
ub=ub/fs;
[Y,y,df1]=fftseq(y,ts,df);
f=[0:df1:df1*(length(m)-1)]-fs/2; %频率矢量
subplot(4,1,1);
plot(t1,m(1:length(t1))); %未调制信号
title('未调制信号');
subplot(4,1,2);
plot(t1,u(1:length(t1))); %调制信号
title('调制信号');
subplot(4,1,3);
plot(f,abs(fftshift(M))); %未调制信号频谱
title('未调制信号频谱');
subplot(4,1,4);
plot(f,abs(fftshift(ub))); %调制信号频谱
title('调制信号频谱');