⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cp0301_psd.m

📁 这是一本超宽带通信书籍< 超宽带无线通信>>的原代码,ds_uwb,mb_ofdm,脉冲信号的形成
💻 M
字号:
%
% FUNCTION 3.2 : "cp0301_PSD"
%
% Evaluates the Power Spectral Density of the
% signal represented by the input vector 'x'
% The input signal is sampled with frequency 'fc'
%
% This function returns the Power Spectral Density ('PSD')
% and the corresponding frequency resolution ('df')
%
% Programmed by Guerino Giancola
%

function [PSD,df]=cp0301_PSD(x,fc)

% --------------------------------
% Step One - Evaluation of the PSD
% --------------------------------

dt=1/fc;
N=length(x);
T=N*dt;
df=1/T;
X = fft(x);
X = X / N;
mPSD=abs(X).^2/(df^2);
PSD = fftshift(mPSD);
PSD = (1/T).*PSD;

% -----------------------------------
% Step Two - Graphical representation
% -----------------------------------

frequency = linspace(-fc/2,fc/2,length(PSD));
PF=plot(frequency,PSD);
set(PF,'LineWidth',[2]);
AX=gca;
set(AX,'FontSize',12);
X=xlabel('Frequency [Hz]');
set(X,'FontSize',14);
Y=ylabel('Power Spectral Density [V^2/Hz]');
set(Y,'FontSize',14);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -