function x=modulation2ask(a,fc,r) n=2000; i=linspace(0,1,n);% 生成0到1之间的n个等间距采样点 x1=sin(2*pi*i*fc/r);% 生成载波信号 an=length(a); x0=zeros(size(an*n)); % 生成长度为an*n的全零向量 for j=1:an if a(j) y=x1; else y=x0; end x(1,(j-1)*n+1:j*n)=y;% 将生成的信号拼接起来 end nn=(1:length(x))/n;% 生成时间序列 plot(nn,x);grid on;xlabel('2ASK已调制信号'); %设计2ASK相干解调程序如下: deat=x; for j=1:an deat(1,(j-1)*n+1:j*n)=x(1,(j-1)*n+1:j*n).*x1; end subplot(233); plot(nn,deat);grid;xlabel('2ASK解调 1-与载波相乘'); deat=deat-mean(deat); 接着写出后续代码
时间: 2023-12-08 21:06:46 浏览: 28
%设计2ASK相干解调程序如下:
deat1=filter([1 1 1]/3,1,deat);% 生成移动平均滤波器
deat1=deat1(2:end);% 去掉前两个滤波器的无效值
subplot(236); plot(nn,deat1);grid on;xlabel('2ASK解调 2-移动平均滤波');
dem=zeros(1,an);% 生成长度为an的全零向量
for j=1:an
s=sum(deat1((j-1)*n+1:j*n));% 对每一个调制信号段进行积分
if s>0.5*n % 由于在解调时信号进行了归一化,所以这里的阈值为0.5*n
dem(j)=1;
end
end
subplot(235);stem(dem);grid on;xlabel('解调后的二进制信号');
相关问题
function x=modulation2ask(a,fc,r) n=2000; i=linspace(0,1,n); x1=sin(2*pi*i*fc/r); an=length(a); x0=zeros(size(an*n)); for j=1:an if a(j) y=x1; else y=x0; end x(1,(j-1)*n+1:j*n)=y; end nn=(1:length(x))/n; plot(nn,x);grid on;xlabel('2ASK已调制信号'); title('20211260562胡盈盈'); deat=x; for j=1:an deat(1,(j-1)*n+1:j*n)=x(1,(j-1)*n+1:j*n).*x1; end subplot(233); plot(nn,deat);grid;xlabel('2ASK解调 1-与载波相乘'); 接着写2ASK解调 2-低通滤波;2ASK解调 恢复的信号代码
2ASK解调 2-低通滤波的代码如下:
fcut = fc*2; % 设置低通滤波器截止频率为载波频率的2倍
[b,a] = butter(6, fcut/(r*n/2), 'low'); % 计算6阶巴特沃斯低通滤波器系数
y = filter(b,a,deat); % 对解调信号进行滤波
2ASK解调 恢复的信号代码如下:
x_rec = zeros(1,an); % 初始化恢复的数据
for j = 1:an
x_rec(j) = mean(y((j-1)*n+1:j*n))/mean(x1); % 计算每个符号的平均值,并除以载波幅值
end
其中,x_rec即为解调后恢复的数据。
(2) frequency modulation (x_FM) (m(t) = 0 for t < 0).
Frequency modulation is a type of modulation in which the frequency of the carrier wave is varied in accordance with the amplitude of the modulating signal. The mathematical expression for frequency modulation is given as:
x_FM(t) = A*cos[2πf_c*t + β*sin(2πf_m*t)]
where A is the amplitude of the carrier wave, f_c is the frequency of the carrier wave, β is the modulation index (which represents the degree of frequency deviation), and f_m is the frequency of the modulating signal.
In frequency modulation, the modulating signal is used to vary the frequency of the carrier wave. When the amplitude of the modulating signal is high, the frequency of the carrier wave increases, and when the amplitude of the modulating signal is low, the frequency of the carrier wave decreases.
The modulating signal m(t) in frequency modulation is assumed to be zero for t < 0, which means that the modulation signal is applied only for positive values of time. This is a common assumption in signal processing and is made to simplify the mathematical analysis of the modulated signal.
Frequency modulation is used in a variety of applications, including radio and television broadcasting, wireless communications, and radar systems. It is preferred over other types of modulation techniques due to its ability to provide better noise immunity and wider bandwidth.
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)