How can I create a pulse train which is not periodic? A sample program has been attached.

7 ビュー (過去 30 日間)
BIPIN SAMUEL
BIPIN SAMUEL 2022 年 8 月 2 日
コメント済み: BIPIN SAMUEL 2022 年 8 月 3 日
The matlab code shown below is for generating the pulse signal. However, when I try to plot 'b_n' the output I got is only first and the last shifted part. But I want to hold the in-between pulses also. The plotted figure is also shown below.
s=zeros(1,length(signal);
q=[q zeros(1,length(s)-length(q))];
a=s+q;
for i=1:length(f)
a_n=circshift(a,f(i)-20);
if i==1
b=a_n;
else
b_n=b+a_n;
end
b_n1=b_n;
end
figure();
plot(b_n)

回答 (1 件)

Sam Chak
Sam Chak 2022 年 8 月 2 日
I followed an example in this link and modifed values of the parameters. Do you think it can be applied to your problem?
t = 0:1e-3:10;
d = [0:8:10]';
x = @rectpuls;
y = pulstran(t-1, d, x);
plot(t,y)
grid on
ylim([-0.5 1.5])
xlabel('Time (s)')
ylabel('Waveform')
  1 件のコメント
BIPIN SAMUEL
BIPIN SAMUEL 2022 年 8 月 3 日
Thank You @Sam Chak, but I need the shifted at variable intervals of samples not in time. You can see in my plot there is only two samples, however, I need 12 more pulses in-between that is shifted at different samples that are not periodic.

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

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by