📄 gonglvpu.m
字号:
function fasheji=fashe()
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
% Output generation
% ---------------------------
% Step Two - Graphical Output
% ---------------------------
dt=1/fc;
N=length(wtx);
T=N*dt;
df=1/T;
X = fft(wtx);
X = X / N;
mPSD=abs(X).^2/(df^2);
PSD = fftshift(mPSD);
PSD = 10*log((1/T).*PSD);
% -----------------------------------
% Step Two - Graphical representation
% -----------------------------------
frequency = linspace(-fc/2,fc/2,length(PSD));
PF=plot(frequency,PSD);
set(PF,'LineWidth',[2]);
axis([0 9e9 -600 -400]);
AX=gca;
set(AX,'FontSize',12);
X=xlabel('Frequency [Hz]');
set(X,'FontSize',12);
Y=ylabel('Power Spectral Density [dBm]');
set(Y,'FontSize',12);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -