Does anybody know how to generate a signal for this? T=0.01 seconds and sampling frequency = 10000Hz.

조회 수: 1 (최근 30일)

채택된 답변

Dimitris Kalogiros
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
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개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by