我需要找到信号的带宽。
(其中 [标准化] 或 [未标准化])
我将如何在 MATLAB 中执行此操作?
我需要找到信号的带宽。
(其中 [标准化] 或 [未标准化])
我将如何在 MATLAB 中执行此操作?
这实际上将是一个很好的面试问题。让我们从头开始:
所以总的来说,我们预计频谱是三角形的(在双线性图上),从 -125 Hz 到 +125 Hz,总带宽为 250 Hz。
为此编写 Matlab 代码并不像看起来那么简单。代码本身很简单,但是您必须选择采样率和适当的时间轴。为此,您需要首先评估信号的一般形状。例如,时域信号在技术上从到并且以 = 10s 为中心。,真的不会做的伎俩。所以本质上你必须在编写代码之前进行理论分析(这往往是 DSP 中反复出现的主题 :-))t = 0:.01:5
% 1000 HZ sample rate, since we now the BW is smaller than 500 Hz
fs = 1000;
% pick a good time length. Because of the time shift we need significantly more
% than 10s. Technically the sinc() has inifite length so we need to extend
% it far enough to cover the vast part of the energy AND we need to start
% at negative times, not at t = 0;
n = 2^16; % that's about 60s. Should be plenty
t = (-n/2:n/2-1)'/fs; % time axis in seconds, symmetric around t = 0;
x = 50*sinc(125*(t-10)).^2;
% frequency axis:
f0 = fs/n; % frequency resoution in Hz
faxis = (-n/2:n/2-1)'*f0; % frequency axis in Hz seconds, symmetric around f = 0;
fx = fft(x);
plot(faxis,circshift(abs(fx),n/2));
title('Spectrum of 50*sinc(125*(t-10)).^2');
xlabel('Frequency in Hz');