Does anybody know how to generate a signal for this? T=0.01 seconds and sampling frequency = 10000Hz.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Réponse acceptée
Dimitris Kalogiros
le 6 Sep 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 commentaires
Dimitris Kalogiros
le 6 Sep 2018
Modifié(e) : Dimitris Kalogiros
le 6 Sep 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).
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
