【发布时间】:2015-02-24 22:05:57
【问题描述】:
我是 matlab 和信号处理的新手。我写了下面发布的代码。我无法理解的是,代码开头的time soecification 部分。我不知道为什么我们在指定间隔或持续时间时需要采样,我认为指定如下内容就足够了:
t = (0: 0.2: 1.0) for an example,
为什么我需要像采样这样的东西来绘制静止信号。
另一个问题是,这段代码给了我一个错误,告诉我paranthesis imbalance 如何解决它。
代码
%% Time specifications:
Fs = 8000; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 1; % seconds
t = (0:dt:StopTime-dt); % seconds
x = (10)*cos(2*pi*3*t) ...
+ (20)*cos(2*pi*6*t ...
+ (30)*cos(2*pi*10*t) ...
+ (50)*cos(2*pi*15*t);
% Plot the signal versus time:
figure;
plot(t,x);
xlabel('time (in seconds)');
ylabel('Amplitude');
title('Signal versus Time');
title('{\bf Periodogram}');
【问题讨论】:
标签: matlab signal-processing wavelet wavelet-transform continuous-fourier