Does anybody know how to generate a signal for this? T=0.01 seconds and sampling frequency = 10000Hz.
2 次查看(过去 30 天)
显示 更早的评论

2 个评论
采纳的回答
Dimitris Kalogiros
2018-9-6
clear; clc; close all;
% parameters
T=0.01;
Fs=10E3;
Ts=1/Fs;
% define base signal
s= @(t) ((0<=t) & (t<=T/2))*1
% create wanted signal
t=-T:Ts:5*T;
signal=s(t)+s(t-T)+s(t-2*T)+s(t-3*T);
% plot wanted signal
figure;
plot(t,signal,'-b.'); zoom on; grid on;
xlabel('t'); ylabel('signal');
Your signal is stored into the "signal" variable.
If you run the script, you will get the following:

3 个评论
Dimitris Kalogiros
2018-9-6
编辑:Dimitris Kalogiros
2018-9-6
Could you explain me please why did you choose 5 in t=-T:Ts:5*T;
You need 4 replicas of your signal, which is defined inside the interval [0 T]. So I created an interval of duration (1+4+1)*T
And a little explanation for the base signal: s= @(t) ((0<=t) & (t<=T/2))*1
I defined a function, usind the function handler @ , in order to define the "branched" signal (s(t) with the tilde).
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!