How create a signal?

Hi my english is not good but i will try.
i need create the next signal:
m2(t)=u(t+1)+6*u(t-3)-10*u(t-6)
u(t):impluse of amplitude equal 1
how i cant do it?
well after i need modulate... but i dont need help in that.
thx :)

3 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 28 日
what about the width of your pulse, or are you working with discret time?
Felipe Farias
Felipe Farias 2012 年 10 月 29 日
well i use a widht very small... but in discrete time would be better.
PD: thx for function
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 29 日
if the pulse had a width(even with eps width) that means it's continuous. Check my answer, you can set the width and the amplitude

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 10 月 28 日
編集済み: Azzi Abdelmalek 2012 年 10 月 28 日

0 投票

save this function
function p= puls(w,A,t)
% w:pulse width
% A:pulse amplitude
% t:time vector
n=length(t);
p=zeros(1,n);
idx=find(abs(t)<=w/2)
p(idx)=A
then call in your m file call the function
w=4 % the width of your pulse
A=1 % the Amplitude of your pulse
t=-10:0.01:10; % time vector
m2=puls(w,A,t+1)+6*puls(w,A,t-3)-10*puls(w,A,t-6)

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 10 月 28 日

0 投票

Your signal is just a superposition (sum) of shifted unit step sequences.
For t = -1,0,1,2 m2(t) = 1
For t = 3,4,5 m2(t) = 7
For t = 6,7,8,9,...
m2(t) = -3
u1 = ones(100,1);
u2 = [zeros(4,1); 6*ones(96,1)];
u3 = [zeros(7,1); -10*ones(93,1)];
m2 = u1+u2+u3;
n = -1:98;
stem(n,m2,'markerfacecolor','b')

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by