필터 지우기
필터 지우기

How to generate random amplitude pulse signal?

조회 수: 7 (최근 30일)
Chen Kevin
Chen Kevin 2020년 4월 16일
댓글: Ameer Hamza 2020년 4월 16일
Hi all,
I want to make a series of signal of 10 pulses but each pulses have different amplitude.
The repitition rate: 50kHz
Pulse width: 5ns
Thanks!
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 4월 16일
Are you trying to create it in MATLAB or simulink?
Chen Kevin
Chen Kevin 2020년 4월 16일
Hi Ameer,
I am trying to create in Matlab

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 16일
편집: Ameer Hamza 2020년 4월 16일
Try this. It generates a periodic pulse with width of 5 ns and random amplitude.
fs = 50000; % 50 kHz frequency
Ts = 1/fs*10^9; % sample rate in neno seconds
t = 1:Ts;
pulse = t<=5;
rand_amp = rand(10,1);
sig = pulse.*rand_amp;
sig = reshape(sig', [], 1);
t_total = 1:numel(sig);
plot(t_total, sig);
xlabel('Time (ns)');
ylabel('Amplitude');
  댓글 수: 4
Chen Kevin
Chen Kevin 2020년 4월 16일
Thanks!
Ameer Hamza
Ameer Hamza 2020년 4월 16일
Glad to be of help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Electrical Block Libraries에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by