📄 fashejiboxing.m
字号:
function asdas
Pow = -30; % Average transmitted power (dBm)
fc = 50e9; % sampling frequency
numbits = 4; % number of bits generated by the source
Ts =5e-9; % frame time, i.e. average pulse
% repetition period [s]
Tm = 5e-9; % pulse duration [s]
B=4e9;
G = 1;
bits =bits(numbits);
power = (10^(Pow/10))/1000; % average transmitted power
% (watt)
Ex = power * Ts;
w0=zeros(1,Ts*numbits*fc);
for i=1:numbits
if bits(i)==0
w1=waveformdown(fc,Tm,B)
w0((Ts*(i-1)*fc+1):fc*Ts*i)=w1(1:fc*Tm);% Energy Normalized pulse
else
w2=waveformup(fc,Tm,B);
w0((Ts*(i-1)*fc+1):fc*Ts*i)=w2(1:fc*Tm);
end % waveform
end
wtx = w0 .* sqrt(Ex); % pulse waveform
Sa = conv(bits,wtx); % Output of the filter
% Output generation
L = (floor(Ts*fc))*numbits;
Stx = Sa(1:L);
% ---------------------------
% Step Two - Graphical Output
% ---------------------------
if G
F = figure(1);
set(F,'Position',[32 223 951 420]);
tmax = numbits*Ts;
time = linspace(0,tmax,length(Stx));
P = plot(time,Stx);
set(P,'LineWidth',[2]);
ylow=-1.5*abs(min(wtx));
yhigh=1.5*max(wtx);
axis([0 tmax ylow yhigh]);
AX=gca;
set(AX,'FontSize',12);
X=xlabel('Time [s]');
set(X,'FontSize',14);
Y=ylabel('Amplitude [V]');
set(Y,'FontSize',14);
for j = 1 : numbits
tj = (j-1)*Ts;
L1=line([tj tj],[ylow yhigh]);
set(L1,'Color',[0 0 0],'LineStyle', ...
'--','LineWidth',[2]);
end
end % end of graphical output
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -