Does anybody know how to generate a signal for this? T=0.01 seconds and sampling frequency = 10000Hz.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Respuesta aceptada
Dimitris Kalogiros
el 6 de Sept. de 2018
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 comentarios
Dimitris Kalogiros
el 6 de Sept. de 2018
Editada: Dimitris Kalogiros
el 6 de Sept. de 2018
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).
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
