Azzera filtri
Azzera filtri

How to generate random amplitude pulse signal?

7 visualizzazioni (ultimi 30 giorni)
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 Commenti
Ameer Hamza
Ameer Hamza il 16 Apr 2020
Are you trying to create it in MATLAB or simulink?
Chen Kevin
Chen Kevin il 16 Apr 2020
Hi Ameer,
I am trying to create in Matlab

Accedi per commentare.

Risposta accettata

Ameer Hamza
Ameer Hamza il 16 Apr 2020
Modificato: Ameer Hamza il 16 Apr 2020
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 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Electrical Block Libraries in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by