how to convolute 2 signals and generate the pulse train from half cycle sine wave?
2 ビュー (過去 30 日間)
古いコメントを表示
clc;
clear all;
close all;
%wt = 0:0.2:pi;
tp=2.2676*10^-3;
Ts=22.67*10^-6;
n=1:Ts:101;
fp=(1/tp);
w=2*pi*fp;
%p=sin(wt);
p=sin(w*n*Ts);
p(find(p<0))=0;
plot(n,p);
data = randi([0,1],1,101);
for k=1:2:100
if data(k)==0 && data(k+1)==0
a(k)=1;
elseif data(k)==0 && data(k+1)==1
a(k)=i;
elseif data(k)==1 && data(k+1)==0
a(k)=-1;
elseif data(k)==1 && data(k+1)==1
a(k)=-i;
end
end
y_s=[];
% syms k
y_s=conv(a,p);
plot(n,y_s);
Im trying the convolution but getting error!! can anyone help?
expexted output

0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!