the quastion is create a set of K pulses with awidth of Tk where Tk=T/K the signals are shifted from each other by Tk?

조회 수: 1 (최근 30일)
i want to build agroup of pulses with specific specifications
the quastion is create a set of (K) pulses with a width T=L/k the signals are shifted from each other by T ?

답변 (1개)

Vaibhav
Vaibhav 2023년 11월 17일
Hi Mahmood,
I understand that you would like to create a set of "K" pulses with a specific width.
To generate the sequence of pulses, possible workaround is to utilize the "rectpuls" function. This function produces a rectangular pulse with a specified width, centered at time t=0.
The below code snippet creates a series of "K" rectangular pulses one after the other. Each pulse is made using the "rectpuls" function, with a width of "T", and it's placed in time based on its position in the sequence. Afterward, each pulse is plotted separately.
% Parameters
L = 1; % Total duration
K = 5; % Number of pulses
T = L / K; % Width of each pulse
% Time vector
Fs = 1000; % Sampling frequency
t = 0:1/Fs:L;
% Plot each pulse separately
figure;
hold on;
for i = 1:K
plot(t, rectpuls(t - (i-1)*T, T), 'DisplayName', ['Pulse ', num2str(i)]);
end
hold off;
xlabel('Time');
ylabel('Amplitude');
title('Set of Shifted Pulses');
legend('show');
You can refer to the following MathWorks documentation link to know more about "rectpuls" function:
Hope this helps!

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by