Matlab生成宽带信号
1 简介
Matlab生成宽带信号
2 完整代码
%
% FUNCTION 1.2 : "gaosi_bandwidth"
%
% Evaluates the bandwidth of the input 'signal' with sampling period
% 'dt'
% Bandwidth is evaluated according to the given 'threshold' (in dB)
% 'BW' is the bandwidth
% 'f_high' is the higher limit
% 'f_low' is the lower limit
%
% Programmed by Guerino Giancola
%
function [ss_E,f_high,f_low,BW] = ...
wideBAND(signal,dt,threshold)
% -----------------------------------------------------------------
% Step One - Evaluation of the single-sided Energy Spectral Density
% -----------------------------------------------------------------
dt=1000;
TT=1:dt;
signal=sin(TT);
threshold=0.51;
fs = 1 / dt; % sampling frequency
N = length(signal); % number of samples (i.e. size of the FFT)
T = N * dt; % time window
df = 1 / T; % fundamental frequency