[問題] plot x軸 歸一化 及 只畫部分範圍已回收
小弟 上DSP課 老師教我們寫個convolution的簡單程式
1.用兩個方波 convolution
2.用兩個exp convolution
一.小弟寫完了 不過因為 點取太細 0 ~ 10 每0.01 1點
在畫圖的時候 不會變回原來的x軸點數 0~10
請問如何講點數 變回原來的 x= 0 ~ 10 ?
二.請問 如果只想要plot 部分範圍 或是平移
y範圍為 0~20 小弟只想要plot 0~10
plot裡面應該要如何寫?
三. step 方波 應該要用什麼函數? square是週期函數 不是step的?
萬分感謝
以下是小弟的code 獻醜了
clc; clear;
T= 0:0.01:10;
A=0.5;P=2;
x = A*square(P*T)+1;
h = A*square(P*T)+1;
y = conv(x,h);
figure
subplot(3,1,1); plot(x,'LineWidth',3); title('X(t)');
subplot(3,1,2); plot(h,'red','LineWidth',3); title('H(t)');
subplot(3,1,3); plot(y,'green','LineWidth',3); title('Y(t)');
clc; clear;
T= 0:0.01:10;
A=1;
alpha=1; x=A*exp(-1*alpha*(T));
beta=2; h=A*exp(-2*beta*(T));
y = conv(x,h);
figure
subplot(3,1,1); plot(x,'LineWidth',3); title('X(t)');
subplot(3,1,2); plot(h,'red','LineWidth',3); title('H(t)');
subplot(3,1,3); plot(y,'green','LineWidth',3); title('Y(t)');
--
好折凳使用要領 簡易版
●
╲╲ 舉起剛坐著的折凳,摺疊成為攻擊狀態,
》0》 迅速舉高至右肩後,與身體夾角約30度, 0 ╴
█ 鼓起全身吃奶之力,面朝目標迅速揮下, █— ╲
∕﹨ 直至目標無力反抗,求生不得求死不能, ∕﹨ \●
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.130.50.223
※ 編輯: youwin0125 來自: 220.228.151.221 (11/12 18:19)
推
11/12 18:53, , 1F
11/12 18:53, 1F
→
11/12 18:57, , 2F
11/12 18:57, 2F
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章