概述
1.软件版本
MATLAB2021a
2.本算法理论知识
这里,基于小数分频的频率合成器,考虑到你需要实现sigma-delta以及mash等结构。因此,系统的模块结构如下图所示:
下面,我们对这个结构图进行SIMULINK建模。
1.鉴相器采用XOR模块设计。
2.环路滤波器结构如下:
这里通过一个低通滤波器进行设计。
3.压控振荡器的设计,
上述几个模块都是可以通过现成的模块进行搭建,
3.核心代码
clc;
close all;
warning off;
window = hann(length(yout));
[Pyy,w] = periodogram(yout,window,100000);
PSD2 = 1/M+1/100*(2*(w)).^4;
Len = length(PSD2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
semilogx(w/pi,10*log10(pi*Pyy),'b');
hold
semilogx(w(Len/100:Len)/pi,10*log10(PSD2(Len/100:Len)),'k','linewidth',2);
grid on
xlabel('Normalized Frequency (xpi rad/sample)')
ylabel('Power/frequency(dB/rad/sample)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
plot(yout,'linewidth',2);
grid on;
xlabel('times');
ylabel('sigmadelta调制器输出');
grid on
figure;
hist(yout,5)
xlabel('output yout')
ylabel('number of occurance');
figure;
plot(yout2(1:3*Len/4),'linewidth',2);
grid on;
xlabel('times');
ylabel('V');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%分析频率稳定度
Fre = yout3;
K = 1;
t1 = yout3(1:end-K);
t2 = yout3(K+1:end);
Err = abs(t1-t2)./t1;
figure;
loglog(Err,'linewidth',2);
grid on;
xlabel('times');
ylabel('频率稳定度');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%最后进行杂散分析
N = 16; %累加器的位数;
K = fix((2^N)*0.2); %频率控制字,即累加的步长;
D = 8; %8bit DAC
g = gcd(K,2^N);
pe = 2^N/(g);
n = 1:pe;
pp = pe+1; %频谱分析点数
add_y = mod(n*K,2^N); %累加器的输出表达式;
%设定量化区间
pat = -1 + 1/ (2^ (D - 1) ):1/ (2^ (D - 1) ):1 - 1/ (2^ (D -1) );
%设定量化码本值
codebook = -1 + 1/ (2^D):1/ (2^(D - 1) ) :1 - 1/ (2^D);
rom_x = cos(2*pi*add_y/(2^N));
[index,quants2] = quantiz(rom_x,pat,codebook);
[Pzz,wz] = periodogram(quants2,[],'onesided',pp);
figure;
psdplot(Pzz/max(Pzz),wz);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4.操作步骤与仿真结论
5.参考文献
A37-01
6.完整源码获得方式
方式1:微信或者QQ联系博主
方式2:订阅MATLAB/FPGA教程,免费获得教程案例以及任意2份完整源码
最后
以上就是独特汉堡为你收集整理的【MASHIII调制器】MASHIII调制器的Simulink建模与仿真的全部内容,希望文章能够帮你解决【MASHIII调制器】MASHIII调制器的Simulink建模与仿真所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复